Index: openacs-4/packages/dotlrn-invoices/dotlrn-invoices.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-invoices/dotlrn-invoices.info,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/dotlrn-invoices/dotlrn-invoices.info 9 Sep 2005 16:27:34 -0000 1.4
+++ openacs-4/packages/dotlrn-invoices/dotlrn-invoices.info 26 Oct 2005 22:44:36 -0000 1.5
@@ -7,15 +7,15 @@
f
f
-
+
Kiesbye Kiesbye
Malte Sussdorff
dotLRN Invoices Applet.
Cognovis
dotLRN Invoices Applet.
0
-
+
Index: openacs-4/packages/dotlrn-invoices/tcl/dotlrn-invoices-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-invoices/tcl/dotlrn-invoices-procs.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/dotlrn-invoices/tcl/dotlrn-invoices-procs.tcl 9 Sep 2005 16:27:35 -0000 1.4
+++ openacs-4/packages/dotlrn-invoices/tcl/dotlrn-invoices-procs.tcl 26 Oct 2005 22:44:37 -0000 1.5
@@ -122,7 +122,9 @@
invoices_offers_portlet::add_self_to_page -portal_id $portal_id -package_id $package_id
+ invoices_offers_project_portlet::add_self_to_page -portal_id $portal_id -package_id $package_id
+
set admin_portal_id [dotlrn_community::get_admin_portal_id \
-community_id $community_id
]
@@ -187,7 +189,12 @@
-package_id $package_id \
-param_action $param_action
+ invoices_offers_project_portlet::add_self_to_page \
+ -portal_id $portal_id \
+ -package_id $package_id \
+ -param_action $param_action
+
}
ad_proc -public dotlrn_invoices::remove_user_from_community {
@@ -216,6 +223,10 @@
invoices_offers_portlet::add_self_to_page \
-portal_id $portal_id \
-package_id 0
+
+ invoices_offers_project_portlet::add_self_to_page \
+ -portal_id $portal_id \
+ -package_id 0
}
@@ -241,7 +252,11 @@
-portal_id $portal_id \
-package_id [ns_set get $args "package_id"]
+ invoices_offers_project_portlet::remove_self_from_page \
+ -portal_id $portal_id \
+ -package_id [ns_set get $args "package_id"]
+
}
ad_proc -public dotlrn_invoices::clone {
@@ -323,6 +338,17 @@
-package_id 0
}
}
+
+ 0.1d3 0.1d4 {
+ # We are going to add invoice portlet to the
+ # templates
+
+ db_foreach get_portal_templates { } {
+ invoices_offers_project_portlet::add_self_to_page \
+ -portal_id $portal_id \
+ -package_id 0
+ }
+ }
}
}
Index: openacs-4/packages/invoices-portlet/invoices-portlet.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices-portlet/invoices-portlet.info,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/invoices-portlet/invoices-portlet.info 31 Aug 2005 18:59:51 -0000 1.2
+++ openacs-4/packages/invoices-portlet/invoices-portlet.info 26 Oct 2005 22:45:09 -0000 1.3
@@ -7,15 +7,15 @@
f
f
-
+
Kiesbye Kiesbye
Malte Sussdorff
Invoices Portlet
Cognovis
Invoices Portlet
0
-
+
Index: openacs-4/packages/invoices-portlet/catalog/invoices-portlet.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices-portlet/catalog/invoices-portlet.en_US.ISO-8859-1.xml,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/invoices-portlet/catalog/invoices-portlet.en_US.ISO-8859-1.xml 31 Aug 2005 18:59:51 -0000 1.2
+++ openacs-4/packages/invoices-portlet/catalog/invoices-portlet.en_US.ISO-8859-1.xml 26 Oct 2005 22:45:10 -0000 1.3
@@ -1,10 +1,11 @@
-
+
Invoice Admin
Invoices Administration
<a href="/invoices/invoice-list">Invoices List Portlet</a>
Offer Portlet
+ Offers Open Projects
Invoices
Offers
Billable Projects
Index: openacs-4/packages/invoices-portlet/lib/invoice-list.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices-portlet/lib/invoice-list.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/invoices-portlet/lib/invoice-list.xql 31 Aug 2005 17:05:21 -0000 1.1
+++ openacs-4/packages/invoices-portlet/lib/invoice-list.xql 26 Oct 2005 22:45:10 -0000 1.2
@@ -3,42 +3,62 @@
-
- select cr.item_id as invoice_id, cr.title, cr.description,
- t.invoice_nr, t.total_amount, t.currency, t.paid_amount,
- t.paid_currency, p.first_names, p.last_name, o.creation_user,
- to_char(o.creation_date, :timestamp_format) as creation_date,
- to_char(t.due_date, :date_format) as due_date, t.parent_invoice_id,
- t.invoice_id as invoice_rev_id, t.cancelled_p
- from cr_folders cf, cr_items ci, cr_revisions cr, iv_invoices t,
- acs_objects o, persons p
- where cr.revision_id = ci.latest_revision
- and t.invoice_id = cr.revision_id
- and t.organization_id = :organization_id
- and ci.parent_id = cf.folder_id
- and cf.package_id = :package_id
- and o.object_id = t.invoice_id
- and p.person_id = o.creation_user
- [template::list::filter_where_clauses -and -name iv_invoice]
-
+ select
+ cr.item_id as invoice_id,
+ cr.title,
+ cr.description,
+ t.invoice_nr,
+ t.total_amount,
+ t.currency,
+ t.paid_amount,
+ t.paid_currency,
+ p.first_names,
+ p.last_name,
+ o.creation_user,
+ to_char(o.creation_date, :timestamp_format) as creation_date,
+ to_char(t.due_date, :date_format) as due_date,
+ t.parent_invoice_id,
+ t.invoice_id as invoice_rev_id,
+ t.cancelled_p
+ from
+ cr_folders cf,
+ cr_items ci,
+ cr_revisions cr,
+ iv_invoices t,
+ acs_objects o,
+ persons p
+ where
+ cr.revision_id = ci.latest_revision
+ and t.invoice_id = cr.revision_id
+ and t.organization_id = :organization_id
+ and ci.parent_id = cf.folder_id
+ and cf.package_id = :package_id
+ and o.object_id = t.invoice_id
+ and p.person_id = o.creation_user
+ [template::list::filter_where_clauses -and -name iv_invoice]
-
- select cr.item_id as invoice_id
- from cr_folders cf, cr_items ci, cr_revisions cr, iv_invoices t,
- acs_objects o, persons p
- where cr.revision_id = ci.latest_revision
- and t.invoice_id = cr.revision_id
- and t.organization_id = :organization_id
- and ci.parent_id = cf.folder_id
- and cf.package_id = :package_id
- and o.object_id = t.invoice_id
- and p.person_id = o.creation_user
- [template::list::filter_where_clauses -and -name iv_invoice]
-
+ select
+ cr.item_id as invoice_id
+ from
+ cr_folders cf,
+ cr_items ci,
+ cr_revisions cr,
+ iv_invoices t,
+ acs_objects o,
+ persons p
+ where
+ cr.revision_id = ci.latest_revision
+ and t.invoice_id = cr.revision_id
+ and t.organization_id = :organization_id
+ and ci.parent_id = cf.folder_id
+ and cf.package_id = :package_id
+ and o.object_id = t.invoice_id
+ and p.person_id = o.creation_user
+ [template::list::filter_where_clauses -and -name iv_invoice]
Index: openacs-4/packages/invoices-portlet/lib/offer-list.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices-portlet/lib/offer-list.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/invoices-portlet/lib/offer-list.tcl 31 Aug 2005 17:05:21 -0000 1.1
+++ openacs-4/packages/invoices-portlet/lib/offer-list.tcl 26 Oct 2005 22:45:10 -0000 1.2
@@ -1,6 +1,6 @@
set required_param_list [list]
-set optional_param_list [list orderby elements base_url package_id organization_id]
-set optional_unset_list [list]
+set optional_param_list [list orderby elements base_url package_id organization_id page]
+set optional_unset_list [list status_id]
foreach required_param $required_param_list {
if {![info exists $required_param]} {
@@ -106,6 +106,9 @@
organization_id {
where_clause {t.organization_id = :organization_id}
}
+ status)id {
+ where_clause { 1 = 1 }
+ }
} \
-formats {
normal {
Index: openacs-4/packages/invoices-portlet/lib/projects-billable.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices-portlet/lib/projects-billable.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/invoices-portlet/lib/projects-billable.xql 31 Aug 2005 17:05:21 -0000 1.1
+++ openacs-4/packages/invoices-portlet/lib/projects-billable.xql 26 Oct 2005 22:45:10 -0000 1.2
@@ -3,54 +3,95 @@
-
- select r.item_id as project_id, r.title, r.description, sub.amount_open,
- to_char(sub.creation_date, :timestamp_format) as creation_date, total.count_total, billed.count_billed, name
- from (
- select oi.item_id as offer_id, pr.revision_id, o.creation_date,
- sum(ofi.item_units * ofi.price_per_unit * (1-(ofi.rebate/100))) as amount_open,
- p.customer_id , (oz.name ) as name
- from cr_items pi, cr_revisions pr, pm_projects p,
- acs_objects o, acs_rels r, iv_offer_items ofi,
- acs_objects oo, cr_items oi , organizations oz
- where pi.latest_revision = pr.revision_id
- and p.project_id = pr.revision_id
- and o.object_id = p.project_id
- and r.object_id_one = pi.item_id
- and r.object_id_two = oi.item_id
- and r.rel_type = 'application_data_link'
- and p.status_id = :p_closed_id
- and ofi.offer_id = oi.latest_revision
- and oo.object_id = oi.item_id
- and oo.package_id = :package_id
- and p.customer_id = oz.organization_id
- and not exists (select 1
- from iv_invoice_items ii, iv_invoices i
- where ii.offer_item_id = ofi.offer_item_id
- and i.invoice_id = ii.invoice_id
- and i.cancelled_p = 'f')
- group by oi.item_id, pr.revision_id, o.creation_date, p.customer_id, oz.name
- ) sub, (
- select count(*) as count_total, oi.item_id
- from cr_items oi, iv_offer_items ofi
- where ofi.offer_id = oi.latest_revision
- group by oi.item_id
- ) total, (
- select count(i.invoice_id) as count_billed, oi.item_id
- from cr_items oi, iv_offer_items ofi
- left outer join iv_invoice_items ii
- on (ii.offer_item_id = ofi.offer_item_id)
- left outer join iv_invoices i
- on (ii.invoice_id = i.invoice_id
- and i.cancelled_p = 'f')
- where ofi.offer_id = oi.latest_revision
- group by oi.item_id
- ) billed, cr_revisions r
- where r.revision_id = sub.revision_id
- and total.item_id = sub.offer_id
- and billed.item_id = sub.offer_id
- [template::list::filter_where_clauses -and -name projects]
-
+ select
+ r.item_id as project_id,
+ r.title,
+ r.description,
+ sub.amount_open,
+ to_char(sub.creation_date, :timestamp_format) as creation_date,
+ total.count_total,
+ billed.count_billed,
+ name
+ from
+ (
+ select
+ oi.item_id as offer_id,
+ pr.revision_id,
+ o.creation_date,
+ sum(ofi.item_units * ofi.price_per_unit * (1-(ofi.rebate/100))) as amount_open,
+ p.customer_id,
+ (oz.name ) as name
+ from
+ cr_items pi,
+ cr_revisions pr,
+ pm_projects p,
+ acs_objects o,
+ acs_rels r,
+ iv_offer_items ofi,
+ acs_objects oo,
+ cr_items oi ,
+ organizations oz
+ where
+ pi.latest_revision = pr.revision_id
+ and p.project_id = pr.revision_id
+ and o.object_id = p.project_id
+ and r.object_id_one = pi.item_id
+ and r.object_id_two = oi.item_id
+ and r.rel_type = 'application_data_link'
+ and p.status_id = :p_closed_id
+ and ofi.offer_id = oi.latest_revision
+ and oo.object_id = oi.item_id
+ and oo.package_id = :package_id
+ and p.customer_id = oz.organization_id
+ and not exists (
+ select
+ 1
+ from
+ iv_invoice_items ii,
+ iv_invoices i
+ where
+ ii.offer_item_id = ofi.offer_item_id
+ and i.invoice_id = ii.invoice_id
+ and i.cancelled_p = 'f')
+ group by
+ oi.item_id,
+ pr.revision_id,
+ o.creation_date,
+ p.customer_id,
+ oz.name
+ ) sub,
+ (
+ select
+ count(*) as count_total,
+ oi.item_id
+ from
+ cr_items oi,
+ iv_offer_items ofi
+ where
+ ofi.offer_id = oi.latest_revision
+ group by
+ oi.item_id
+ ) total,
+ (
+ select
+ count(i.invoice_id) as count_billed,
+ oi.item_id
+ from
+ cr_items oi,
+ iv_offer_items ofi
+ left outer join iv_invoice_items ii on (ii.offer_item_id = ofi.offer_item_id)
+ left outer join iv_invoices i on (ii.invoice_id = i.invoice_id and i.cancelled_p = 'f')
+ where
+ ofi.offer_id = oi.latest_revision
+ group by
+ oi.item_id
+ ) billed,
+ cr_revisions r
+ where
+ r.revision_id = sub.revision_id
+ and total.item_id = sub.offer_id
+ and billed.item_id = sub.offer_id
+ [template::list::filter_where_clauses -and -name projects]
Index: openacs-4/packages/invoices-portlet/sql/postgresql/invoices-offers-project-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices-portlet/sql/postgresql/invoices-offers-project-portlet-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/invoices-portlet/sql/postgresql/invoices-offers-project-portlet-create.sql 26 Oct 2005 22:46:37 -0000 1.1
@@ -0,0 +1,213 @@
+--
+-- Copyright (C) 2005 Cognovis
+--
+-- This file is part of dotLRN.
+--
+-- dotLRN is free software; you can redistribute it and/or modify it under the
+-- terms of the GNU General Public License as published by the Free Software
+-- Foundation; either version 2 of the License, or (at your option) any later
+-- version.
+--
+-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+-- details.
+--
+
+--
+--
+
+-- Creates invoices offers project portlet
+
+-- This is free software distributed under the terms of the GNU Public
+-- License version 2 or higher. Full text of the license is available
+-- from the GNU Project: http://www.fsf.org/copyleft/gpl.html
+
+create function inline_0()
+returns integer as '
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+ ds_id := portal_datasource__new(
+ ''invoices_offers_project_portlet'',
+ ''Displays the Invoices Offers Project Portlet''
+ );
+
+
+ -- the standard 4 params
+
+ -- shadeable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''shadeable_p'',
+ ''t''
+);
+
+
+ -- hideable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''hideable_p'',
+ ''t''
+);
+
+ -- user_editable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''user_editable_p'',
+ ''t''
+);
+
+ -- shaded_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''shaded_p'',
+ ''f''
+);
+
+ -- link_hideable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''link_hideable_p'',
+ ''t''
+);
+
+
+ perform portal_datasource__set_def_param(
+ ds_id,
+ ''t'',
+ ''f'',
+ ''scoped_p'',
+ ''t''
+ );
+
+
+ return 0;
+
+end;' language 'plpgsql';
+select inline_0();
+drop function inline_0();
+
+
+create function inline_0()
+returns integer as '
+declare
+ foo integer;
+begin
+ -- create the implementation
+ foo := acs_sc_impl__new (
+ ''portal_datasource'',
+ ''invoices_offers_project_portlet'',
+ ''invoices_offers_project_portlet''
+ );
+
+ return 0;
+
+end;' language 'plpgsql';
+select inline_0();
+drop function inline_0();
+
+
+
+create function inline_0()
+returns integer as '
+declare
+ foo integer;
+begin
+
+ -- add all the hooks
+ foo := acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''invoices_offers_project_portlet'',
+ ''GetMyName'',
+ ''invoices_offers_project_portlet::get_my_name'',
+ ''TCL''
+ );
+
+ foo := acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''invoices_offers_project_portlet'',
+ ''GetPrettyName'',
+ ''invoices_offers_project_portlet::get_pretty_name'',
+ ''TCL''
+ );
+
+ foo := acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''invoices_offers_project_portlet'',
+ ''Link'',
+ ''invoices_offers_project_portlet::link'',
+ ''TCL''
+ );
+
+ foo := acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''invoices_offers_project_portlet'',
+ ''AddSelfToPage'',
+ ''invoices_offers_project_portlet::add_self_to_page'',
+ ''TCL''
+ );
+
+ foo := acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''invoices_offers_project_portlet'',
+ ''Show'',
+ ''invoices_offers_project_portlet::show'',
+ ''TCL''
+ );
+
+ foo := acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''invoices_offers_project_portlet'',
+ ''Edit'',
+ ''invoices_offers_project_portlet::edit'',
+ ''TCL''
+ );
+
+ foo := acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''invoices_offers_project_portlet'',
+ ''RemoveSelfFromPage'',
+ ''invoices_offers_project_portlet::remove_self_from_page'',
+ ''TCL''
+ );
+
+ return 0;
+
+end;' language 'plpgsql';
+select inline_0();
+drop function inline_0();
+
+
+
+create function inline_0()
+returns integer as '
+declare
+ foo integer;
+begin
+
+ -- Add the binding
+ perform acs_sc_binding__new (
+ ''portal_datasource'',
+ ''invoices_offers_project_portlet''
+ );
+
+ return 0;
+
+end;' language 'plpgsql';
+select inline_0();
+drop function inline_0();
+
+
+
+
Index: openacs-4/packages/invoices-portlet/sql/postgresql/invoices-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices-portlet/sql/postgresql/invoices-portlet-create.sql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/invoices-portlet/sql/postgresql/invoices-portlet-create.sql 16 Aug 2005 20:14:55 -0000 1.1
+++ openacs-4/packages/invoices-portlet/sql/postgresql/invoices-portlet-create.sql 26 Oct 2005 22:45:10 -0000 1.2
@@ -219,6 +219,7 @@
\i invoices-list-portlet-create.sql
\i invoices-offers-portlet-create.sql
+\i invoices-offers-project-portlet-create.sql
\i invoices-admin-portlet-create.sql
Index: openacs-4/packages/invoices-portlet/sql/postgresql/upgrade/upgrade-0.1d1-0.1d2.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices-portlet/sql/postgresql/upgrade/Attic/upgrade-0.1d1-0.1d2.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/invoices-portlet/sql/postgresql/upgrade/upgrade-0.1d1-0.1d2.sql 26 Oct 2005 22:46:37 -0000 1.1
@@ -0,0 +1,209 @@
+--
+-- Copyright (C) 2005 Cognovis
+--
+-- This file is part of dotLRN.
+--
+-- dotLRN is free software; you can redistribute it and/or modify it under the
+-- terms of the GNU General Public License as published by the Free Software
+-- Foundation; either version 2 of the License, or (at your option) any later
+-- version.
+--
+-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+-- details.
+--
+
+--
+--
+
+-- Creates invoices offers project portlet
+
+-- This is free software distributed under the terms of the GNU Public
+-- License version 2 or higher. Full text of the license is available
+-- from the GNU Project: http://www.fsf.org/copyleft/gpl.html
+
+create function inline_0()
+returns integer as '
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+ ds_id := portal_datasource__new(
+ ''invoices_offers_project_portlet'',
+ ''Displays the Invoices Offers Project Portlet''
+ );
+
+
+ -- the standard 4 params
+
+ -- shadeable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''shadeable_p'',
+ ''t''
+);
+
+
+ -- hideable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''hideable_p'',
+ ''t''
+);
+
+ -- user_editable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''user_editable_p'',
+ ''t''
+);
+
+ -- shaded_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''shaded_p'',
+ ''f''
+);
+
+ -- link_hideable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''link_hideable_p'',
+ ''t''
+);
+
+
+ perform portal_datasource__set_def_param(
+ ds_id,
+ ''t'',
+ ''f'',
+ ''scoped_p'',
+ ''t''
+ );
+
+
+ return 0;
+
+end;' language 'plpgsql';
+select inline_0();
+drop function inline_0();
+
+
+create function inline_0()
+returns integer as '
+declare
+ foo integer;
+begin
+ -- create the implementation
+ foo := acs_sc_impl__new (
+ ''portal_datasource'',
+ ''invoices_offers_project_portlet'',
+ ''invoices_offers_project_portlet''
+ );
+
+ return 0;
+
+end;' language 'plpgsql';
+select inline_0();
+drop function inline_0();
+
+
+
+create function inline_0()
+returns integer as '
+declare
+ foo integer;
+begin
+
+ -- add all the hooks
+ foo := acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''invoices_offers_project_portlet'',
+ ''GetMyName'',
+ ''invoices_offers_project_portlet::get_my_name'',
+ ''TCL''
+ );
+
+ foo := acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''invoices_offers_project_portlet'',
+ ''GetPrettyName'',
+ ''invoices_offers_project_portlet::get_pretty_name'',
+ ''TCL''
+ );
+
+ foo := acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''invoices_offers_project_portlet'',
+ ''Link'',
+ ''invoices_offers_project_portlet::link'',
+ ''TCL''
+ );
+
+ foo := acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''invoices_offers_project_portlet'',
+ ''AddSelfToPage'',
+ ''invoices_offers_project_portlet::add_self_to_page'',
+ ''TCL''
+ );
+
+ foo := acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''invoices_offers_project_portlet'',
+ ''Show'',
+ ''invoices_offers_project_portlet::show'',
+ ''TCL''
+ );
+
+ foo := acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''invoices_offers_project_portlet'',
+ ''Edit'',
+ ''invoices_offers_project_portlet::edit'',
+ ''TCL''
+ );
+
+ foo := acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''invoices_offers_project_portlet'',
+ ''RemoveSelfFromPage'',
+ ''invoices_offers_project_portlet::remove_self_from_page'',
+ ''TCL''
+ );
+
+ return 0;
+
+end;' language 'plpgsql';
+select inline_0();
+drop function inline_0();
+
+
+
+create function inline_0()
+returns integer as '
+declare
+ foo integer;
+begin
+
+ -- Add the binding
+ perform acs_sc_binding__new (
+ ''portal_datasource'',
+ ''invoices_offers_project_portlet''
+ );
+
+ return 0;
+
+end;' language 'plpgsql';
+select inline_0();
+drop function inline_0();
\ No newline at end of file
Index: openacs-4/packages/invoices-portlet/tcl/invoices-offers-project-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices-portlet/tcl/invoices-offers-project-portlet-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/invoices-portlet/tcl/invoices-offers-project-portlet-procs.tcl 26 Oct 2005 22:46:37 -0000 1.1
@@ -0,0 +1,124 @@
+#
+# Copyright (C) 2005 Cognovis
+# Author: Bjoern Kiesbye (kiesbye@theservice.de)
+
+# This file is part of dotLRN.
+#
+# dotLRN is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+
+ad_library {
+
+ Procedures to support the Invoices Package
+
+}
+
+
+
+
+
+namespace eval invoices_offers_project_portlet {
+
+ ad_proc -private my_package_key {
+ } {
+ return "invoices-portlet"
+ }
+
+ ad_proc -private get_my_name {
+ } {
+ return "invoices_offers_project_portlet"
+ }
+
+ ad_proc -public get_pretty_name {
+ } {
+ return "#invoices-portlet.invoices_offers_project_portlet#"
+ }
+
+ ad_proc -public link {
+ } {
+ return "invoices"
+ }
+
+ ad_proc -public add_self_to_page {
+ {-portal_id:required}
+ {-package_id:required}
+ {-page_name ""}
+ {-pretty_name ""}
+ {-force_region ""}
+ {-scoped_p ""}
+ {-param_action "overwrite"}
+
+ } {
+ Adds a Invoices Portlet to the given page.
+
+ @param portal_id The page to add self to
+ @return element_id The new element's id
+ } {
+
+ # allow overrides of pretty_name and force_region
+ if {[empty_string_p $pretty_name]} {
+ set pretty_name [get_pretty_name]
+ }
+
+ if {[empty_string_p $force_region]} {
+ set force_region [parameter::get_from_package_key \
+ -package_key [my_package_key] \
+ -parameter "force_region"
+ ]
+ }
+
+ set extra_params ""
+
+ if {![empty_string_p $scoped_p]} {
+ set extra_params [list scoped_p $scoped_p]
+ }
+
+ return [portal::add_element_parameters \
+ -portal_id $portal_id \
+ -page_name $page_name \
+ -portlet_name [get_my_name] \
+ -pretty_name $pretty_name \
+ -force_region $force_region \
+ -value $package_id \
+ -key package_id \
+ -param_action $param_action \
+ -extra_params $extra_params
+ ]
+ }
+
+ ad_proc -public remove_self_from_page {
+ {-portal_id:required}
+ {-package_id "0"}
+ } {
+ Removes a Invoices Package from the given page.
+
+ @param portal_id The page to remove self from
+
+ } {
+ portal::remove_element_parameters \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
+ -key package_id \
+ -value $package_id
+ }
+
+ ad_proc -public show {
+ cf
+ } {
+ } {
+
+ portal::show_proc_helper \
+ -package_key [my_package_key] \
+ -config_list $cf \
+ -template_src "invoices-offers-project-portlet"
+ }
+
+}
Index: openacs-4/packages/invoices-portlet/www/invoices-offers-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices-portlet/www/invoices-offers-portlet.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/invoices-portlet/www/invoices-offers-portlet.adp 31 Aug 2005 17:05:21 -0000 1.2
+++ openacs-4/packages/invoices-portlet/www/invoices-offers-portlet.adp 26 Oct 2005 22:45:11 -0000 1.3
@@ -1 +1,5 @@
-
\ No newline at end of file
+
\ No newline at end of file
Index: openacs-4/packages/invoices-portlet/www/invoices-offers-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices-portlet/www/invoices-offers-portlet.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/invoices-portlet/www/invoices-offers-portlet.tcl 16 Aug 2005 20:14:55 -0000 1.1
+++ openacs-4/packages/invoices-portlet/www/invoices-offers-portlet.tcl 26 Oct 2005 22:45:11 -0000 1.2
@@ -8,7 +8,6 @@
set package_id [apm_package_id_from_key invoices]
set organization_id [lindex [application_data_link::get_linked -from_object_id $community_id -to_object_type "organization"] 0]
-
if {[empty_string_p $community_id]} {
Index: openacs-4/packages/invoices-portlet/www/invoices-offers-project-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices-portlet/www/invoices-offers-project-portlet.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/invoices-portlet/www/invoices-offers-project-portlet.adp 26 Oct 2005 22:46:38 -0000 1.1
@@ -0,0 +1,6 @@
+
\ No newline at end of file
Index: openacs-4/packages/invoices-portlet/www/invoices-offers-project-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices-portlet/www/invoices-offers-project-portlet.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/invoices-portlet/www/invoices-offers-project-portlet.tcl 26 Oct 2005 22:46:38 -0000 1.1
@@ -0,0 +1,7 @@
+set row_list {offer_nr {} title {} description {} amount_total {} creation_user {} creation_date {} finish_date {} action {}}
+
+set user_id [ad_conn user_id]
+set community_id [dotlrn_community::get_community_id_from_url]
+set package_id [apm_package_id_from_key invoices]
+set organization_id [lindex [application_data_link::get_linked -from_object_id $community_id -to_object_type "organization"] 0]
+