Index: openacs-4/packages/dotlrn-ecommerce/lib/cal-view-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/lib/cal-view-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-ecommerce/lib/cal-view-oracle.xql 4 Jul 2005 14:28:32 -0000 1.1
@@ -0,0 +1,27 @@
+
+
+
+
+ oracle
+ 8.1.6
+
+
+
+
+ select dc.course_id, dc.course_key, dc.course_name,
+ dc.assessment_id, dec.section_id, dec.section_name,
+ dec.product_id, dec.community_id, dc.course_info,
+ ci.item_id
+ from dotlrn_catalog dc,
+ cr_items ci,
+ dotlrn_ecommerce_section dec
+ where ci.item_id = dec.course_id(+)
+ and dc.course_id = ci.live_revision
+
+ [template::list::filter_where_clauses -and -name course_list]
+
+ order by lower(dc.course_name), lower(dec.section_name)
+
+
+
+
Index: openacs-4/packages/dotlrn-ecommerce/lib/cal-view-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/lib/cal-view-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-ecommerce/lib/cal-view-postgresql.xql 4 Jul 2005 14:28:32 -0000 1.1
@@ -0,0 +1,26 @@
+
+
+
+ postgresql
+ 7.1
+
+
+
+
+ select dc.course_id, dc.course_key, dc.course_name,
+ dc.assessment_id, dec.section_id, dec.section_name,
+ dec.product_id, dec.community_id, dc.course_info,
+ ci.item_id
+ from dotlrn_catalog dc,
+ cr_items ci
+ left join dotlrn_ecommerce_section dec
+ on (ci.item_id = dec.course_id)
+
+ where dc.course_id = ci.live_revision
+ [template::list::filter_where_clauses -and -name course_list]
+
+ order by lower(dc.course_name), lower(dec.section_name)
+
+
+
+
Index: openacs-4/packages/dotlrn-ecommerce/lib/cal-view.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/lib/cal-view.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/dotlrn-ecommerce/lib/cal-view.tcl 19 Jun 2005 06:05:06 -0000 1.3
+++ openacs-4/packages/dotlrn-ecommerce/lib/cal-view.tcl 4 Jul 2005 14:28:32 -0000 1.4
@@ -188,6 +188,7 @@
set _instructors [dotlrn_community::list_users $instructor_community_id]
if { [llength $_instructors] == 0 } {
set _instructors 0
+ set instructors_filter ""
} else {
foreach _instructor $_instructors {
lappend __instructors [ns_set get $_instructor user_id]
Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn-ecommerce/lib/cal-view.xql'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/dotlrn-ecommerce/lib/section-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/lib/section-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-ecommerce/lib/section-oracle.xql 4 Jul 2005 14:28:32 -0000 1.1
@@ -0,0 +1,134 @@
+
+
+
+
+ oracle
+ 8.1.6
+
+
+
+
+
+ select item_type_id from cal_item_types where type='Session' and calendar_id = :template_calendar_id and rownum = 1
+
+
+
+
+
+ select sale_price as member_price
+ from ec_sale_prices
+ where product_id = :product_id and rownum = 1
+
+
+
+
+
+ select 'cal_item_id',
+ ci.cal_item_id,
+ 'typical_start_time',
+ to_char(start_date,'HH24:MI') as typical_start_time,
+ 'typical_end_time',
+ to_char(end_date,'HH24:MI') as typical_end_time,
+ 'session_name',
+ nvl(e.name, a.name) as session_name,
+ 'session_description',
+ nvl(e.status_summary, a.status_summary) as session_description,
+ 'start_date',
+ to_char(start_date, 'yyyy-mm-dd'),
+ 'end_date',
+ to_char(end_date, 'yyyy-mm-dd')
+ from acs_activities a,
+ acs_events e,
+ timespans s,
+ time_intervals t,
+ calendars cals,
+ cal_items ci,
+ cal_item_types cit
+ where cit.item_type_id(+) = ci.item_type_id
+ and e.timespan_id = s.timespan_id
+ and s.interval_id = t.interval_id
+ and e.activity_id = a.activity_id
+ and ci.cal_item_id= e.event_id
+ and cals.calendar_id = ci.on_which_calendar
+ and e.event_id = ci.cal_item_id
+ and ci.on_which_calendar = :template_calendar_id
+ and ci.item_type_id = :template_item_type_id
+
+
+
+
+
+ begin
+ :1 := ec_product.new(product_id => :product_id,
+ object_type => 'ec_product',
+ creation_date => sysdate,
+ creation_user => :user_id,
+ creation_ip => :peeraddr,
+ context_id => :context_id,
+ product_name => :product_name,
+ price => :price,
+ sku => :sku,
+ one_line_description => :one_line_description,
+ detailed_description => :detailed_description,
+ search_keywords => :search_keywords,
+ present_p => :present_p,
+ stock_status => :stock_status,
+ dirname => :dirname,
+ available_date => to_date(sysdate, 'YYYY-MM-DD'),
+ color_list => :color_list,
+ size_list => :size_list,
+ style_list => '',
+ email_on_purchase_list => '',
+ url => '',
+ no_shipping_avail_p => '',
+ shipping => '',
+ shipping_additional => '',
+ weight => '',
+ active_p => 't',
+ template_id => ''
+ );
+ end;
+
+
+
+
+
+ insert into ec_custom_product_field_values
+ ([join $custom_columns_to_insert ", "], last_modified, last_modifying_user, modified_ip_address)
+ values
+ ([join $custom_column_values_to_insert ","], sysdate, :user_id, :peeraddr)
+
+
+
+
+
+ update ec_custom_product_field_values set [join $custom_columns_to_update ,] where product_id = :product_id
+
+
+
+
+
+ insert into ec_sale_prices
+ (sale_price_id, product_id, sale_price, sale_begins, sale_ends, sale_name, offer_code, last_modified, last_modifying_user, modified_ip_address)
+ values
+ (:sale_price_id, :product_id, :sale_price, to_date(sysdate,'YYYY-MM-DD HH24:MI:SS'), to_date(sysdate+99,'YYYY-MM-DD HH24:MI:SS'), 'MemberPrice', :offer_code, sysdate, :user_id, :peeraddr)
+
+
+
+
+
+ select sale_price
+ from ec_sale_prices
+ where product_id = :product_id and rownum = 1
+
+
+
+
+
+ update ec_sale_prices
+ set sale_price = :member_price
+ where product_id = :product_id
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/dotlrn-ecommerce/lib/section-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/lib/section-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-ecommerce/lib/section-postgresql.xql 4 Jul 2005 14:28:32 -0000 1.1
@@ -0,0 +1,121 @@
+
+
+
+ postgresql
+ 7.1
+
+
+
+
+ select item_type_id from cal_item_types where type='Session' and calendar_id = :template_calendar_id limit 1
+
+
+
+
+
+ select sale_price as member_price
+ from ec_sale_prices
+ where product_id = :product_id
+ limit 1
+
+
+
+
+
+ select 'cal_item_id',
+ ci.cal_item_id,
+ 'typical_start_time',
+ to_char(start_date,'HH24:MI') as typical_start_time,
+ 'typical_end_time',
+ to_char(end_date,'HH24:MI') as typical_end_time,
+ 'session_name',
+ coalesce(e.name, a.name) as session_name,
+ 'session_description',
+ coalesce(e.status_summary, a.status_summary) as session_description,
+ 'start_date',
+ to_char(start_date, 'yyyy-mm-dd'),
+ 'end_date',
+ to_char(end_date, 'yyyy-mm-dd')
+ from acs_activities a,
+ acs_events e,
+ timespans s,
+ time_intervals t,
+ calendars cals,
+ cal_items ci left join
+ cal_item_types cit on cit.item_type_id = ci.item_type_id
+ where e.timespan_id = s.timespan_id
+ and s.interval_id = t.interval_id
+ and e.activity_id = a.activity_id
+ and ci.cal_item_id= e.event_id
+ and cals.calendar_id = ci.on_which_calendar
+ and e.event_id = ci.cal_item_id
+ and ci.on_which_calendar = :template_calendar_id
+ and ci.item_type_id = :template_item_type_id
+
+
+
+
+
+ select ec_product__new(
+ :product_id,
+ :user_id,
+ :context_id,
+ :product_name,
+ :price,
+ :sku,
+ :one_line_description,
+ :detailed_description,
+ :search_keywords,
+ :present_p,
+ :stock_status,
+ :dirname,
+ to_date(now(), 'YYYY-MM-DD'),
+ :color_list,
+ :size_list,
+ :peeraddr
+ )
+
+
+
+
+
+ insert into ec_custom_product_field_values
+ ([join $custom_columns_to_insert ", "], last_modified, last_modifying_user, modified_ip_address)
+ values
+ ([join $custom_column_values_to_insert ","], now(), :user_id, :peeraddr)
+
+
+
+
+
+ update ec_custom_product_field_values set [join $custom_columns_to_update ,] where product_id = :product_id
+
+
+
+
+
+ insert into ec_sale_prices
+ (sale_price_id, product_id, sale_price, sale_begins, sale_ends, sale_name, offer_code, last_modified, last_modifying_user, modified_ip_address)
+ values
+ (:sale_price_id, :product_id, :sale_price, to_date(now() - '1 day':: interval,'YYYY-MM-DD HH24:MI:SS'), to_date(now() + '99 years':: interval,'YYYY-MM-DD HH24:MI:SS'), 'MemberPrice', :offer_code, now(), :user_id, :peeraddr)
+
+
+
+
+
+ select sale_price
+ from ec_sale_prices
+ where product_id = :product_id
+ limit 1
+
+
+
+
+
+ update ec_sale_prices
+ set sale_price = :member_price
+ where product_id = :product_id
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/dotlrn-ecommerce/lib/section.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/lib/section.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/dotlrn-ecommerce/lib/section.tcl 30 Jun 2005 08:14:14 -0000 1.3
+++ openacs-4/packages/dotlrn-ecommerce/lib/section.tcl 4 Jul 2005 14:28:32 -0000 1.4
@@ -25,7 +25,7 @@
where course_id = :course_id
}
set template_calendar_id [dotlrn_calendar::get_group_calendar_id -community_id $template_community_id]
- set template_item_type_id [db_string item_type_id "select item_type_id from cal_item_types where type='Session' and calendar_id = :template_calendar_id limit 1" -default 0]
+ set template_item_type_id [db_string get_item_type_id { } -default 0]
}
if {![info exists mode]} {
@@ -198,37 +198,7 @@
# Create the section for predefined sessions
if { [info exists template_calendar_id] } {
- set sessions_list [db_list_of_lists sessions {
- select 'cal_item_id',
- ci.cal_item_id,
- 'typical_start_time',
- to_char(start_date,'HH24:MI') as typical_start_time,
- 'typical_end_time',
- to_char(end_date,'HH24:MI') as typical_end_time,
- 'session_name',
- coalesce(e.name, a.name) as session_name,
- 'session_description',
- coalesce(e.status_summary, a.status_summary) as session_description,
- 'start_date',
- to_char(start_date, 'yyyy-mm-dd'),
- 'end_date',
- to_char(end_date, 'yyyy-mm-dd')
- from acs_activities a,
- acs_events e,
- timespans s,
- time_intervals t,
- calendars cals,
- cal_items ci left join
- cal_item_types cit on cit.item_type_id = ci.item_type_id
- where e.timespan_id = s.timespan_id
- and s.interval_id = t.interval_id
- and e.activity_id = a.activity_id
- and ci.cal_item_id= e.event_id
- and cals.calendar_id = ci.on_which_calendar
- and e.event_id = ci.cal_item_id
- and ci.on_which_calendar = :template_calendar_id
- and ci.item_type_id = :template_item_type_id
- }]
+ set sessions_list [db_list_of_lists sessions { }]
} else {
set sessions_list [list]
}
@@ -350,12 +320,7 @@
}]
if { [parameter::get -package_id [ad_conn package_id] -parameter MemberPriceP -default 0 ] } {
- if { [db_0or1row member_price {
- select sale_price as member_price
- from ec_sale_prices
- where product_id = :product_id
- limit 1
- }] } {
+ if { [db_0or1row member_price { }] } {
# HAM
# member_price is using currency_widget
set member_price_split [split $member_price .]
@@ -396,9 +361,7 @@
# add the calendar item type "session"
set calendar_id [dotlrn_calendar::get_group_calendar_id -community_id $community_id]
- if { ! [db_0or1row session_type {
- select item_type_id from cal_item_types where type='Session' and calendar_id = :calendar_id limit 1
- }] } {
+ if { ! [db_0or1row get_item_type_id {}] } {
set item_type_id [calendar::item_type_new -calendar_id $calendar_id -type "Session"]
}
@@ -426,26 +389,7 @@
set color_list ""
set size_list ""
set peeraddr [ad_conn peeraddr]
- set product_id [db_exec_plsql product_insert {
- select ec_product__new(
- :product_id,
- :user_id,
- :context_id,
- :product_name,
- :price,
- :sku,
- :one_line_description,
- :detailed_description,
- :search_keywords,
- :present_p,
- :stock_status,
- :dirname,
- to_date(now(), 'YYYY-MM-DD'),
- :color_list,
- :size_list,
- :peeraddr
- )
- }]
+ set product_id [db_exec_plsql product_insert { }]
db_dml product_update {
update ec_products
@@ -454,8 +398,8 @@
}
# take care of custom fields
# we have to generate audit information
- set audit_fields "last_modified, last_modifying_user, modified_ip_address"
- set audit_info "now(), :user_id, :peeraddr"
+ # set audit_fields "last_modified, last_modifying_user, modified_ip_address"
+ # set audit_info "now(), :user_id, :peeraddr"
# things to insert into ec_custom_product_field_values if they exist
set custom_columns_to_insert [list product_id]
@@ -481,12 +425,7 @@
}
}
}
- db_dml custom_fields_insert "
- insert into ec_custom_product_field_values
- ([join $custom_columns_to_insert ", "], $audit_fields)
- values
- ([join $custom_column_values_to_insert ","], $audit_info)
- " -bind $bind_set
+ db_dml custom_fields_insert { } -bind $bind_set
#HAM: create a sale item from the member price
# do so only if member price is provided
@@ -502,11 +441,7 @@
set sale_price $member_price
set offer_code ""
- db_dml sale_insert "
- insert into ec_sale_prices
- (sale_price_id, product_id, sale_price, sale_begins, sale_ends, sale_name, offer_code, last_modified, last_modifying_user, modified_ip_address)
- values
- (:sale_price_id, :product_id, :sale_price, to_date(now() - '1 day':: interval,'YYYY-MM-DD HH24:MI:SS'), to_date(now() + '99 years':: interval,'YYYY-MM-DD HH24:MI:SS'), 'MemberPrice', :offer_code, now(), :user_id, :peeraddr)"
+ db_dml sale_insert { }
}
#CM: We should probably add ecomerce_product_id to ecommerce_Section and insert it here.
@@ -614,9 +549,7 @@
}
}
}
- db_dml custom_fields_insert "
- update ec_custom_product_field_values set [join $custom_columns_to_update ,] where product_id = :product_id
- " -bind $bind_set
+ db_dml custom_fields_update { } -bind $bind_set
category::map_object -remove_old -object_id $community_id $categories
@@ -669,17 +602,8 @@
# Set member price, this can be 1 to n but ignore for now
if { [parameter::get -package_id [ad_conn package_id] -parameter MemberPriceP -default 0 ] && [exists_and_not_null member_price]} {
- if { [db_0or1row sale_price {
- select sale_price
- from ec_sale_prices
- where product_id = :product_id
- limit 1
- }] } {
- db_dml set_member_price {
- update ec_sale_prices
- set sale_price = :member_price
- where product_id = :product_id
- }
+ if { [db_0or1row sale_price { }] } {
+ db_dml set_member_price { }
} else {
set sale_price_id [db_nextval ec_sale_price_id_sequence]
set sale_price $member_price
Index: openacs-4/packages/dotlrn-ecommerce/lib/tree-chunk-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/lib/tree-chunk-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-ecommerce/lib/tree-chunk-oracle.xql 4 Jul 2005 14:28:32 -0000 1.1
@@ -0,0 +1,67 @@
+
+
+
+
+ oracle
+ 8.1.6
+
+
+
+
+ select name
+ from category_trees t, category_tree_translations tt
+ where t.tree_id = tt.tree_id
+ and t.tree_id = :tree_id
+
+
+
+
+
+
+ select dc.course_id, dc.course_key, dc.course_name,
+ dc.assessment_id, dec.section_id, dec.section_name,
+ dec.product_id, dec.community_id, dc.course_info,
+ ci.item_id, v.maxparticipants
+ from
+ dotlrn_catalog dc,
+ cr_items ci,
+ dotlrn_ecommerce_section dec,
+ ec_custom_product_field_values v
+ where
+ ci.item_id = dec.course_id(+) and
+ dec.product_id = v.product_id(+) and
+ dc.course_id = ci.live_revision
+
+ [template::list::filter_where_clauses -and -name course_list]
+
+ order by lower (dc.course_name), lower(dec.section_name)
+
+
+
+
+
+ select sale_price as member_price
+ from ec_sale_prices
+ where product_id = :product_id and rownum=1
+
+
+
+
+
+ select count(*) as attendees
+ from dotlrn_member_rels_approved
+ where community_id = :community_id
+ and (rel_type = 'dotlrn_member_rel' or rel_type = 'dotlrn_club_student_rel')
+
+
+
+
+
+ select price as prices
+ from ec_products
+ where product_id = :product_id
+
+
+
+
+
Index: openacs-4/packages/dotlrn-ecommerce/lib/tree-chunk-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/lib/tree-chunk-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-ecommerce/lib/tree-chunk-postgresql.xql 4 Jul 2005 14:28:32 -0000 1.1
@@ -0,0 +1,64 @@
+
+
+
+
+ postgresql
+ 7.1
+
+
+
+
+ select name
+ from category_trees t, category_tree_translations tt
+ where t.tree_id = tt.tree_id
+ and t.tree_id = :tree_id
+
+
+
+
+
+ select dc.course_id, dc.course_key, dc.course_name,
+ dc.assessment_id, dec.section_id, dec.section_name,
+ dec.product_id, dec.community_id, dc.course_info,
+ ci.item_id, v.maxparticipants
+ from dotlrn_catalog dc,
+ cr_items ci
+ left join dotlrn_ecommerce_section dec
+ on (ci.item_id = dec.course_id)
+ left join ec_custom_product_field_values v
+ on (dec.product_id = v.product_id)
+
+ where dc.course_id = ci.live_revision
+ [template::list::filter_where_clauses -and -name course_list]
+
+ order by lower(dc.course_name), lower(dec.section_name)
+
+
+
+
+
+ select sale_price as member_price
+ from ec_sale_prices
+ where product_id = :product_id
+ limit 1
+
+
+
+
+
+ select count(*) as attendees
+ from dotlrn_member_rels_approved
+ where community_id = :community_id
+ and (rel_type = 'dotlrn_member_rel' or rel_type = 'dotlrn_club_student_rel')
+
+
+
+
+
+ select price as prices
+ from ec_products
+ where product_id = :product_id
+
+
+
+
Index: openacs-4/packages/dotlrn-ecommerce/lib/tree-chunk.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/lib/tree-chunk.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/dotlrn-ecommerce/lib/tree-chunk.tcl 23 Jun 2005 12:30:30 -0000 1.6
+++ openacs-4/packages/dotlrn-ecommerce/lib/tree-chunk.tcl 4 Jul 2005 14:28:32 -0000 1.7
@@ -101,12 +101,7 @@
set tree_list [category_tree::get_tree -all $tree_id]
set tree_length [llength $tree_list]
- db_1row get_tree_name {
- select name
- from category_trees t, category_tree_translations tt
- where t.tree_id = tt.tree_id
- and t.tree_id = :tree_id
- }
+ db_1row get_tree_name { }
# Create a list of values for the list filter
set $name [list]
@@ -418,32 +413,17 @@
append instructors " [_ dotlrn-ecommerce.view_bios]"
}
- db_1row attendees {
- select count(*) as attendees
- from dotlrn_member_rels_approved
- where community_id = :community_id
- and (rel_type = 'dotlrn_member_rel'
- or rel_type = 'dotlrn_club_student_rel')
- }
+ db_1row attendees { }
if { ! [empty_string_p $maxparticipants] } {
set available_slots [expr $maxparticipants - $attendees]
}
}
if { ! [empty_string_p $product_id] } {
- db_1row price {
- select price as prices
- from ec_products
- where product_id = :product_id
- }
+ db_1row price { }
if { [parameter::get -package_id [ad_conn package_id] -parameter MemberPriceP -default 0 ] } {
- if { [db_0or1row member_price {
- select sale_price as member_price
- from ec_sale_prices
- where product_id = :product_id
- limit 1
- }] } {
+ if { [db_0or1row member_price { }] } {
if { ! [empty_string_p $member_price] } {
append prices " / $member_price"
}
Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn-ecommerce/lib/tree-chunk.xql'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/dotlrn-ecommerce/sql/oracle/dotlrn-ecommerce-admin-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/sql/oracle/dotlrn-ecommerce-admin-portlet-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-ecommerce/sql/oracle/dotlrn-ecommerce-admin-portlet-create.sql 4 Jul 2005 14:28:32 -0000 1.1
@@ -0,0 +1,167 @@
+
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+ ds_id := portal_datasource.new(
+ name => 'dotlrn_ecommerce_admin_portlet',
+ description => 'Displays the dotlrn_ecommerce_admin'
+ );
+
+ -- 4 defaults procs
+
+ -- shadeable_p
+ portal_datasource.set_def_param (
+ datasource_id => ds_id,
+ config_required_p => 't',
+ configured_p => 't',
+ key => 'shadeable_p',
+ value => 'f'
+);
+
+ -- shaded_p
+ portal_datasource.set_def_param (
+ datasource_id => ds_id,
+ config_required_p => 't',
+ configured_p => 't',
+ key => 'shaded_p',
+ value => 'f'
+);
+
+ -- hideable_p
+ portal_datasource.set_def_param (
+ datasource_id => ds_id,
+ config_required_p => 't',
+ configured_p => 't',
+ key => 'hideable_p',
+ value => 't'
+);
+
+ -- user_editable_p
+ portal_datasource.set_def_param (
+ datasource_id => ds_id,
+ config_required_p => 't',
+ configured_p => 't',
+ key => 'user_editable_p',
+ value => 'f'
+);
+
+ -- link_hideable_p
+ portal_datasource.set_def_param (
+ datasource_id => ds_id,
+ config_required_p => 't',
+ configured_p => 't',
+ key => 'link_hideable_p',
+ value => 't'
+);
+
+
+ -- ecommerce_admin-specific procs
+
+ -- package_id must be configured
+ portal_datasource.set_def_param (
+ datasource_id => ds_id,
+ config_required_p => 't',
+ configured_p => 'f',
+ key => 'package_id',
+ value => ''
+);
+
+
+end;
+/
+show errors
+
+
+declare
+ foo integer;
+begin
+ -- create the implementation
+ foo := acs_sc_impl.new (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'dotlrn_ecommerce_admin_portlet',
+ impl_pretty_name => 'dotlrn_ecommerce_admin_portlet',
+ impl_owner_name => 'dotlrn_ecommerce_admin_portlet'
+ );
+
+end;
+/
+show errors
+
+declare
+ foo integer;
+begin
+
+ -- add all the hooks
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_ecommerce_admin_portlet',
+ 'GetMyName',
+ 'dotlrn_ecommerce_admin_portlet::get_my_name',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_ecommerce_admin_portlet',
+ 'GetPrettyName',
+ 'dotlrn_ecommerce_admin_portlet::get_pretty_name',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_ecommerce_admin_portlet',
+ 'Link',
+ 'dotlrn_ecommerce_admin_portlet::link',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_ecommerce_admin_portlet',
+ 'AddSelfToPage',
+ 'dotlrn_ecommerce_admin_portlet::add_self_to_page',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_ecommerce_admin_portlet',
+ 'Show',
+ 'dotlrn_ecommerce_admin_portlet::show',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_ecommerce_admin_portlet',
+ 'Edit',
+ 'dotlrn_ecommerce_admin_portlet::edit',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_ecommerce_admin_portlet',
+ 'RemoveSelfFromPage',
+ 'dotlrn_ecommerce_admin_portlet::remove_self_from_page',
+ 'TCL'
+ );
+
+end;
+/
+show errors
+
+declare
+ foo integer;
+begin
+
+ -- Add the binding
+ acs_sc_binding.new (
+ contract_name => 'portal_datasource',
+ impl_name => 'dotlrn_ecommerce_admin_portlet'
+ );
+end;
+/
+show errors
+
Index: openacs-4/packages/dotlrn-ecommerce/sql/oracle/dotlrn-ecommerce-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/sql/oracle/dotlrn-ecommerce-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-ecommerce/sql/oracle/dotlrn-ecommerce-create.sql 4 Jul 2005 14:28:32 -0000 1.1
@@ -0,0 +1,73 @@
+--- creating table to add section
+
+create table dotlrn_ecommerce_section (
+ section_id integer primary key,
+ course_id integer references cr_items(item_id),
+ community_id integer references dotlrn_communities_all(community_id),
+ product_id integer references ec_products,
+ section_name varchar(2000),
+ age varchar(2000),
+ date_time_start date,
+ date_time_end date,
+ daily_p char(1) check (daily_p in ('t','f')),
+ weekly_p char(1) check (weekly_p in ('t','f')),
+ qualified_age_low integer,
+ qualified_age_high integer,
+ account_code_revenue varchar(100),
+ account_code_expense varchar(100),
+ max_participants integer,
+ waiting_list_p char(1) check (waiting_list_p in ('t','f')),
+ notify_waiting_number integer,
+ member_price_number numeric,
+ non_member_price numeric
+);
+
+create index de_community_id_idx ON dotlrn_ecommerce_section (community_id);
+create index de_product_id_idx ON dotlrn_ecommerce_section (product_id);
+create index de_course_id_idx ON dotlrn_ecommerce_section (course_id);
+
+-- Term - comes from site-wide categories
+-- instructors - come from from instructors group
+-- asssistants - come from assistants group
+-- actual dates - comes from the calendar items in the community
+declare
+begin
+ acs_rel_type.create_role('as_session_role', 'Assessment Sessions Role', 'Assessment Sessions Role');
+ acs_rel_type.create_role('ec_product_role', 'Ecommerce Product Role', 'Ecommerce Product Role');
+ acs_rel_type.create_role('member_rel_role', 'Member Relationship Role', 'Member Relationship Role');
+ commit;
+end;
+/
+show errors
+
+create table person_info (
+ person_id integer not null,
+ grade clob,
+ allergies clob,
+ age integer,
+ special_needs clob,
+ CONSTRAINT dotlrn_ecommerce_persons_fk
+ FOREIGN KEY (person_id)
+ REFERENCES persons(person_id)
+);
+
+create table dotlrn_ecommerce_orders (
+ item_id integer references ec_items on delete cascade not null,
+-- Can be a user or group
+ patron_id integer references users(user_id) on delete cascade not null,
+ participant_id integer references parties(party_id) on delete cascade not null
+);
+
+create table dotlrn_ecommerce_transactions (
+ order_id integer references ec_orders on delete cascade not null unique,
+ method char(1) check (method in ('cc', 'internal_account', 'check')) not null,
+ internal_account clob
+);
+
+-- Create custom ecommerce field
+insert into ec_custom_product_fields (field_identifier, field_name, default_value, column_type, last_modified,last_modifying_user, modified_ip_address) values ('maxparticipants', 'Max Participants', '', 'integer', sysdate, '0', '0.0.0.0');
+alter table ec_custom_product_field_values add maxparticipants integer;
+alter table ec_custom_p_field_values_audit add maxparticipants integer;
+
+@@ dotlrn-ecommerce-memberships-create.sql
+@@ dotlrn-ecommerce-admin-portlet-create.sql
\ No newline at end of file
Index: openacs-4/packages/dotlrn-ecommerce/sql/oracle/dotlrn-ecommerce-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/sql/oracle/dotlrn-ecommerce-drop.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-ecommerce/sql/oracle/dotlrn-ecommerce-drop.sql 4 Jul 2005 14:28:32 -0000 1.1
@@ -0,0 +1,8 @@
+drop table dotlrn_ecommerce_section;
+drop table person_info;
+
+begin
+ acs_rel_type.drop_role('as_session_role');
+ acs_rel_type.drop_role('ec_product_role');
+ commit;
+end;
\ No newline at end of file
Index: openacs-4/packages/dotlrn-ecommerce/sql/oracle/dotlrn-ecommerce-memberships-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/sql/oracle/dotlrn-ecommerce-memberships-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-ecommerce/sql/oracle/dotlrn-ecommerce-memberships-create.sql 4 Jul 2005 14:28:32 -0000 1.1
@@ -0,0 +1,209 @@
+create table dotlrn_club_student_rels (
+ rel_id integer constraint dcs_rels_rel_id_pk primary key
+ constraint dcs_rels_fk references membership_rels(rel_id)
+);
+
+create or replace view dcs_rels_full
+as
+ select acs_rels.rel_id as rel_id,
+ acs_rels.object_id_one as community_id,
+ acs_rels.object_id_two as user_id,
+ acs_rels.rel_type,
+ (select acs_rel_types.role_two
+ from acs_rel_types
+ where acs_rel_types.rel_type = acs_rels.rel_type) as role,
+ membership_rels.member_state
+ from dotlrn_club_student_rels,
+ acs_rels,
+ membership_rels
+ where dotlrn_club_student_rels.rel_id = acs_rels.rel_id
+ and acs_rels.rel_id = membership_rels.rel_id;
+
+create or replace view dcs_rels_approved
+as
+ select *
+ from dcs_rels_full
+ where member_state = 'approved';
+
+create or replace package dotlrn_club_student_rel
+as
+
+-- dotlrn_club_student_rel__new
+ function new (
+ rel_id in membership_rels.rel_id%TYPE default null,
+ rel_type in acs_rels.rel_type%TYPE default 'membership_rel',
+ community_id in dotlrn_communities.community_id%TYPE,
+ user_id in users.user_id%TYPE,
+ member_state in membership_rels.member_state%TYPE,
+ creation_user in acs_objects.creation_user%TYPE default null,
+ creation_ip in acs_objects.creation_ip%TYPE default null
+ ) return dotlrn_club_student_rels.rel_id%TYPE;
+
+-- dotlrn_club_student_rel__delete
+ procedure del (
+ rel_id in composition_rels.rel_id%TYPE
+ );
+
+end dotlrn_club_student_rel;
+/
+show errors
+
+create or replace package body dotlrn_club_student_rel
+as
+
+-- dotlrn_club_student_rel__new
+ function new (
+ rel_id in membership_rels.rel_id%TYPE default null,
+ rel_type in acs_rels.rel_type%TYPE default 'membership_rel',
+ community_id in dotlrn_communities.community_id%TYPE,
+ user_id in users.user_id%TYPE,
+ member_state in membership_rels.member_state%TYPE,
+ creation_user in acs_objects.creation_user%TYPE default null,
+ creation_ip in acs_objects.creation_ip%TYPE default null
+ ) return dotlrn_club_student_rels.rel_id%TYPE
+ is
+ v_rel_id membership_rels.rel_id%TYPE;
+ begin
+ v_rel_id:= dotlrn_member_rel.new(
+ rel_id => rel_id,
+ rel_type => rel_type,
+ community_id => community_id,
+ user_id => user_id,
+ member_state => member_state,
+ creation_user => creation_user,
+ creation_ip => creation_ip
+ );
+
+ insert
+ into dotlrn_club_student_rels
+ (rel_id)
+ values
+ (v_rel_id);
+
+ return v_rel_id;
+ end;
+
+-- dotlrn_club_student_rel__delete
+ procedure del (
+ rel_id in composition_rels.rel_id%TYPE
+ )
+ is
+ begin
+ delete
+ from dotlrn_club_student_rels
+ where rel_id = rel_id;
+
+ membership_rel.del(rel_id);
+
+ end;
+
+end dotlrn_club_student_rel;
+/
+show errors
+
+
+create table dotlrn_club_instructor_rels (
+ rel_id integer constraint dci_rels_rel_id_pk primary key
+ constraint dci_rels_fk references membership_rels(rel_id)
+);
+
+create or replace view dci_rels_full
+as
+ select acs_rels.rel_id as rel_id,
+ acs_rels.object_id_one as community_id,
+ acs_rels.object_id_two as user_id,
+ acs_rels.rel_type,
+ (select acs_rel_types.role_two
+ from acs_rel_types
+ where acs_rel_types.rel_type = acs_rels.rel_type) as role,
+ membership_rels.member_state
+ from dotlrn_club_instructor_rels,
+ acs_rels,
+ membership_rels
+ where dotlrn_club_instructor_rels.rel_id = acs_rels.rel_id
+ and acs_rels.rel_id = membership_rels.rel_id;
+
+create view dci_rels_approved
+as
+ select *
+ from dci_rels_full
+ where member_state = 'approved';
+
+create or replace package dotlrn_club_instructor_rel
+as
+
+-- dotlrn_club_instructor__new
+ function new (
+ rel_id in membership_rels.rel_id%TYPE default null,
+ rel_type in acs_rels.rel_type%TYPE default 'membership_rel',
+ community_id in dotlrn_communities.community_id%TYPE,
+ user_id in users.user_id%TYPE,
+ member_state in membership_rels.member_state%TYPE,
+ creation_user in acs_objects.creation_user%TYPE default null,
+ creation_ip in acs_objects.creation_ip%TYPE default null
+ ) return dotlrn_club_instructor_rels.rel_id%TYPE;
+
+-- dotlrn_club_student_rel__delete
+ procedure delete (
+ rel_id in composition_rels.rel_id%TYPE
+ );
+
+end dotlrn_club_instructor_rel;
+/
+show errors
+
+create or replace package body dotlrn_club_instructor_rel
+as
+
+-- dotlrn_club_instructor_rel__new
+ function new (
+ rel_id in membership_rels.rel_id%TYPE default null,
+ rel_type in acs_rels.rel_type%TYPE default 'membership_rel',
+ community_id in dotlrn_communities.community_id%TYPE,
+ user_id in users.user_id%TYPE,
+ member_state in membership_rels.member_state%TYPE,
+ creation_user in acs_objects.creation_user%TYPE default null,
+ creation_ip in acs_objects.creation_ip%TYPE default null
+ ) return dotlrn_club_instructor_rels.rel_id%TYPE
+ is
+ v_rel_id membership_rels.rel_id%TYPE;
+ begin
+ v_rel_id:= dotlrn_member_rel.new(
+ rel_id => rel_id,
+ rel_type => rel_type,
+ community_id => community_id,
+ user_id => user_id,
+ member_state => member_state,
+ creation_user => creation_user,
+ creation_ip => creation_ip
+ );
+
+ insert
+ into dotlrn_club_instructor_rels
+ (rel_id)
+ values
+ (v_rel_id);
+
+ return v_rel_id;
+
+ end new;
+
+-- dotlrn_club_instructor_rel__delete
+ procedure delete (
+ rel_id in composition_rels.rel_id%TYPE
+ )
+ is
+ v_rel_id membership_rels.rel_id%TYPE;
+ begin
+ delete
+ from dotlrn_club_instructor_rels
+ where rel_id = rel_id;
+
+ membership_rel.del(rel_id);
+
+ end delete;
+
+end dotlrn_club_instructor_rel;
+/
+show errors
+
Index: openacs-4/packages/dotlrn-ecommerce/sql/postgresql/dotlrn-ecommerce-memberships-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/sql/postgresql/dotlrn-ecommerce-memberships-create.sql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/dotlrn-ecommerce/sql/postgresql/dotlrn-ecommerce-memberships-create.sql 31 May 2005 22:04:53 -0000 1.1
+++ openacs-4/packages/dotlrn-ecommerce/sql/postgresql/dotlrn-ecommerce-memberships-create.sql 4 Jul 2005 14:28:32 -0000 1.2
@@ -11,7 +11,7 @@
primary key
);
-create view dotlrn_club_student_rels_full
+create view dcs_rels_full
as
select acs_rels.rel_id as rel_id,
acs_rels.object_id_one as community_id,
@@ -27,10 +27,10 @@
where dotlrn_club_student_rels.rel_id = acs_rels.rel_id
and acs_rels.rel_id = membership_rels.rel_id;
-create view dotlrn_club_student_rels_approved
+create view dcs_rels_approved
as
select *
- from dotlrn_club_student_rels_full
+ from dcs_rels_full
where member_state = 'approved';
select define_function_args('dotlrn_club_student_rel__new','rel_id,rel_type;dotlrn_club_student_rel,portal_id,community_id,user_id,member_state;approved,creation_user,creation_ip');
@@ -96,7 +96,7 @@
primary key
);
-create view dotlrn_club_instructor_rels_full
+create view dci_rels_full
as
select acs_rels.rel_id as rel_id,
acs_rels.object_id_one as community_id,
@@ -112,10 +112,10 @@
where dotlrn_club_instructor_rels.rel_id = acs_rels.rel_id
and acs_rels.rel_id = membership_rels.rel_id;
-create view dotlrn_club_instructor_rels_approved
+create view dci_rels_approved
as
select *
- from dotlrn_club_instructor_rels_full
+ from dci_rels_full
where member_state = 'approved';
select define_function_args('dotlrn_club_instructor_rel__new','rel_id,rel_type;dotlrn_club_instructor_rel,portal_id,community_id,user_id,member_state;approved,creation_user,creation_ip');
Index: openacs-4/packages/dotlrn-ecommerce/tcl/section-procs-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/tcl/section-procs-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-ecommerce/tcl/section-procs-oracle.xql 4 Jul 2005 14:28:32 -0000 1.1
@@ -0,0 +1,69 @@
+
+
+
+
+ oracle
+ 8.1.6
+
+
+
+
+ select t.name
+ from category_object_map_tree m, category_translations t
+ where t.category_id = m.category_id
+ and t.locale = nvl(:locale, 'en_US')
+ and m.object_id = :community_id
+ and m.tree_id = :grade_tree_id
+
+
+
+
+
+ select distinct t.name
+ from category_object_map_tree m, category_translations t
+ where t.category_id = m.category_id
+ and t.locale = nvl(:locale, 'en_US')
+ and m.object_id in (select community_id
+ from dotlrn_ecommerce_section
+ where course_id = :item_id)
+ and m.tree_id = :grade_tree_id
+
+
+
+
+
+ select item_type_id from cal_item_types where type='Session' and calendar_id = :calendar_id and rownum=1
+
+
+
+
+
+ select distinct to_char(start_date, 'Mon') as month,
+ to_char(start_date, 'dd') as day,
+ to_char(start_date, 'hh:mi') as timestart,
+ to_char(end_date, 'hh:mi') as timeend,
+ to_char(start_date, 'am') as startampm,
+ to_char(end_date, 'am') as endampm
+ from cal_items ci, acs_events e, acs_activities a, timespans s, time_intervals t
+ where e.timespan_id = s.timespan_id
+ and s.interval_id = t.interval_id
+ and e.activity_id = a.activity_id
+ and e.event_id = ci.cal_item_id
+ and start_date >= sysdate
+ and ci.on_which_calendar = :calendar_id
+ and ci.item_type_id = :item_type_id
+
+
+
+
+
+ select u.first_names||' '||u.last_name
+ from dotlrn_users u, dotlrn_member_rels_approved r
+ where u.user_id = r.user_id
+ and r.community_id = :community_id
+ and r.rel_type = 'dotlrn_admin_rel'
+ and r.user_id in ([join $instructors ,])
+
+
+
+
Index: openacs-4/packages/dotlrn-ecommerce/tcl/section-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/tcl/section-procs-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-ecommerce/tcl/section-procs-postgresql.xql 4 Jul 2005 14:28:32 -0000 1.1
@@ -0,0 +1,63 @@
+
+
+
+ postgresql
+ 7.1
+
+
+
+
+ select t.name
+ from category_object_map_tree m, category_translations t
+ where t.category_id = m.category_id
+ and t.locale = coalesce(:locale, 'en_US')
+ and m.object_id = :community_id
+ and m.tree_id = :grade_tree_id
+
+
+
+
+
+ select distinct t.name
+ from category_object_map_tree m, category_translations t
+ where t.category_id = m.category_id
+ and t.locale = coalesce(:locale, 'en_US')
+ and m.object_id in (select community_id
+ from dotlrn_ecommerce_section
+ where course_id = :item_id)
+ and m.tree_id = :grade_tree_id
+
+
+
+
+
+ select item_type_id from cal_item_types where type='Session' and calendar_id = :calendar_id limit 1
+
+
+
+
+
+ select distinct to_char(start_date, 'Mon') as month, to_char(start_date, 'dd') as day, to_char(start_date, 'hh:mi') as timestart, to_char(end_date, 'hh:mi') as timeend, to_char(start_date, 'am') as startampm, to_char(end_date, 'am') as endampm
+ from cal_items ci, acs_events e, acs_activities a, timespans s, time_intervals t
+ where e.timespan_id = s.timespan_id
+ and s.interval_id = t.interval_id
+ and e.activity_id = a.activity_id
+ and e.event_id = ci.cal_item_id
+ and start_date >= current_date
+ and ci.on_which_calendar = :calendar_id
+ and ci.item_type_id = :item_type_id
+
+
+
+
+
+ select u.first_names||' '||u.last_name
+ from dotlrn_users u, dotlrn_member_rels_approved r
+ where u.user_id = r.user_id
+ and r.community_id = :community_id
+ and r.rel_type = 'dotlrn_admin_rel'
+ and r.user_id in ($instructor_string)
+
+
+
+
Index: openacs-4/packages/dotlrn-ecommerce/tcl/section-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/tcl/section-procs.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/dotlrn-ecommerce/tcl/section-procs.tcl 30 Jun 2005 11:49:06 -0000 1.6
+++ openacs-4/packages/dotlrn-ecommerce/tcl/section-procs.tcl 4 Jul 2005 14:28:32 -0000 1.7
@@ -29,14 +29,12 @@
@error
} {
- return [db_list instructors [subst {
- select u.first_names||' '||u.last_name
- from dotlrn_users u, dotlrn_member_rels_approved r
- where u.user_id = r.user_id
- and r.community_id = :community_id
- and r.rel_type = 'dotlrn_admin_rel'
- and r.user_id in ([join $instructors ,])
- }]]
+ set instructor_string [join $instructors ,]
+ if { ![empty_string_p $instructor_string] } {
+ return [db_list instructors { }]
+ } else {
+ return ""
+ }
}
ad_proc -public dotlrn_ecommerce::section::section_grades {
@@ -53,14 +51,7 @@
@error
} {
- return [db_list section_grades {
- select t.name
- from category_object_map_tree m, category_translations t
- where t.category_id = m.category_id
- and t.locale = coalesce(:locale, 'en_US')
- and m.object_id = :community_id
- and m.tree_id = :grade_tree_id
- }]
+ return [db_list section_grades { }]
}
ad_proc -public dotlrn_ecommerce::section::course_grades {
@@ -77,16 +68,7 @@
@error
} {
- return [db_list course_grades {
- select distinct t.name
- from category_object_map_tree m, category_translations t
- where t.category_id = m.category_id
- and t.locale = coalesce(:locale, 'en_US')
- and m.object_id in (select community_id
- from dotlrn_ecommerce_section
- where course_id = :item_id)
- and m.tree_id = :grade_tree_id
- }]
+ return [db_list course_grades { }]
}
ad_proc -public dotlrn_ecommerce::section::sessions {
@@ -101,26 +83,13 @@
@error
} {
- if { ! [db_0or1row session_type {
- select item_type_id from cal_item_types where type='Session' and calendar_id = :calendar_id limit 1
- }] } {
+ if { ! [db_0or1row session_type { }] } {
set item_type_id [calendar::item_type_new -calendar_id $calendar_id -type "Session"]
}
set text_sessions [list]
array set arr_sessions [list]
- db_foreach sessions {
- select distinct to_char(start_date, 'Mon') as month, to_char(start_date, 'dd') as day, to_char(start_date, 'hh:mi') as start, to_char(end_date, 'hh:mi') as end, to_char(start_date, 'am') as startampm, to_char(end_date, 'am') as endampm
- from cal_items ci, acs_events e, acs_activities a, timespans s, time_intervals t
- where e.timespan_id = s.timespan_id
- and s.interval_id = t.interval_id
- and e.activity_id = a.activity_id
- and e.event_id = ci.cal_item_id
- and start_date >= current_date
-
- and ci.on_which_calendar = :calendar_id
- and ci.item_type_id = :item_type_id
- } {
- lappend arr_sessions(${month}_${start}_${end}_${startampm}_${endampm}) $day
+ db_foreach sessions { } {
+ lappend arr_sessions(${month}_${timestart}_${timeend}_${startampm}_${endampm}) $day
}
set days [list]
Index: openacs-4/packages/dotlrn-ecommerce/www/admin/course-info-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/admin/course-info-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-ecommerce/www/admin/course-info-oracle.xql 4 Jul 2005 14:28:32 -0000 1.1
@@ -0,0 +1,23 @@
+
+
+
+
+ oracle
+ 8.1.6
+
+
+
+
+
+ select item_type_id from cal_item_types where type='Session' and calendar_id = :template_calendar_id and rownum = 1
+
+
+
+
+
+ select item_type_id from cal_item_types where type='Session' and calendar_id = :calendar_id and rownum = 1
+
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/dotlrn-ecommerce/www/admin/course-info-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/admin/course-info-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-ecommerce/www/admin/course-info-postgresql.xql 4 Jul 2005 14:28:32 -0000 1.1
@@ -0,0 +1,20 @@
+
+
+
+ postgresql
+ 7.1
+
+
+
+
+ select item_type_id from cal_item_types where type='Session' and calendar_id = :template_calendar_id limit 1
+
+
+
+
+
+ select item_type_id from cal_item_types where type='Session' and calendar_id = :calendar_id limit 1
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/dotlrn-ecommerce/www/admin/course-info.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/admin/course-info.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/dotlrn-ecommerce/www/admin/course-info.tcl 19 Jun 2005 06:05:07 -0000 1.3
+++ openacs-4/packages/dotlrn-ecommerce/www/admin/course-info.tcl 4 Jul 2005 14:28:32 -0000 1.4
@@ -190,17 +190,11 @@
set calendar_url [calendar_portlet_display::get_url_stub $calendar_id]
- set item_type_id [db_string item_type_id "select item_type_id from cal_item_types where type='Session' and calendar_id = :calendar_id limit 1" -default 0]
+ set item_type_id [db_string item_type_id { } -default 0]
- set num_sessions [db_string num_sessions "select count(cal_item_id) from cal_items where on_which_calendar = :calendar_id and item_type_id = :item_type_id"]
+ set num_sessions [db_string num_sessions {} ]
- db_1row attendees {
- select count(*) as attendees
- from dotlrn_member_rels_approved
- where community_id = :community_id
- and (rel_type = 'dotlrn_member_rel'
- or rel_type = 'dotlrn_club_student_rel')
- }
+ db_1row attendees { }
if { ! [empty_string_p $maxparticipants] } {
set available_slots [expr $maxparticipants - $attendees]
@@ -312,7 +306,7 @@
} else {
set template_community_url [dotlrn_community::get_community_url $template_community_id]
set template_calendar_id [dotlrn_calendar::get_group_calendar_id -community_id $template_community_id]
- set template_item_type_id [db_string item_type_id "select item_type_id from cal_item_types where type='Session' and calendar_id = :template_calendar_id limit 1" -default 0]
+ set template_item_type_id [db_string get_item_type_id { } -default 0]
set template_calendar_url [export_vars -base ${template_community_url}calendar/cal-item-new { {item_type_id $template_item_type_id} {calendar_id $template_calendar_id} {view day} }]
}
}
\ No newline at end of file
Index: openacs-4/packages/dotlrn-ecommerce/www/admin/course-info.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/admin/course-info.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/dotlrn-ecommerce/www/admin/course-info.xql 31 May 2005 22:04:54 -0000 1.1
+++ openacs-4/packages/dotlrn-ecommerce/www/admin/course-info.xql 4 Jul 2005 14:28:32 -0000 1.2
@@ -53,4 +53,20 @@
+
+
+ select count(cal_item_id) from cal_items where on_which_calendar = :calendar_id and item_type_id = :item_type_id
+
+
+
+
+
+ select count(*) as attendees
+ from dotlrn_member_rels_approved
+ where community_id = :community_id
+ and (rel_type = 'dotlrn_member_rel'
+ or rel_type = 'dotlrn_club_student_rel')
+
+
+
\ No newline at end of file
Index: openacs-4/packages/dotlrn-ecommerce/www/admin/one-section.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/admin/one-section.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/dotlrn-ecommerce/www/admin/one-section.adp 19 Jun 2005 06:05:07 -0000 1.1
+++ openacs-4/packages/dotlrn-ecommerce/www/admin/one-section.adp 4 Jul 2005 14:28:32 -0000 1.2
@@ -18,21 +18,23 @@
Process Purchase for @section_name@
-
+
Sessions and Attendance
+
Registration
@num_attendees@ participants registered
List Registrants
Related Users
-
+
Expense Tracking
+
Related Items
Index: openacs-4/packages/dotlrn-ecommerce/www/admin/one-section.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/admin/one-section.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/dotlrn-ecommerce/www/admin/one-section.tcl 19 Jun 2005 06:05:07 -0000 1.1
+++ openacs-4/packages/dotlrn-ecommerce/www/admin/one-section.tcl 4 Jul 2005 14:28:32 -0000 1.2
@@ -16,7 +16,7 @@
set return_url "section?section_id=$section_id"
# course id is the revision_id
-db_1row get_section "select live_revision as course_id, community_id, product_id, section_name from cr_items, dotlrn_ecommerce_section where section_id = :section_id and cr_items.item_id = dotlrn_ecommerce_section.course_id"
+db_1row get_section { }
set community_url [dotlrn_community::get_community_url $community_id]
dotlrn_catalog::get_course_data -course_id $course_id
@@ -32,10 +32,7 @@
set context [list [list "course-list" "Course List"] [list "course-info?course_id=$course_id" "$course_name"] $section_name ]
-set num_attendees [db_string num_attendees {
- select count(*) as attendees
- from dotlrn_member_rels_approved
- where community_id = :community_id
- and (rel_type = 'dotlrn_member_rel'
- or rel_type = 'dotlrn_club_student_rel')
-}]
+set num_attendees [db_string num_attendees { }]
+
+set attendance_show_p [apm_package_installed_p "attendance"]
+set expensetracking_show_p [apm_package_installed_p "expenses"]
Index: openacs-4/packages/dotlrn-ecommerce/www/admin/one-section.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/admin/one-section.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-ecommerce/www/admin/one-section.xql 4 Jul 2005 14:28:32 -0000 1.1
@@ -0,0 +1,19 @@
+
+
+
+
+
+ select live_revision as course_id, community_id, product_id, section_name from cr_items, dotlrn_ecommerce_section where section_id = :section_id and cr_items.item_id = dotlrn_ecommerce_section.course_id
+
+
+
+
+
+ select count(*) as attendees
+ from dotlrn_member_rels_approved
+ where community_id = :community_id
+ and (rel_type = 'dotlrn_member_rel' or rel_type = 'dotlrn_club_student_rel')
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/dotlrn-ecommerce/www/admin/ecommerce/checkout-one-form-2-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/admin/ecommerce/Attic/checkout-one-form-2-oracle.xql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/dotlrn-ecommerce/www/admin/ecommerce/checkout-one-form-2-oracle.xql 19 Jun 2005 06:05:07 -0000 1.3
+++ openacs-4/packages/dotlrn-ecommerce/www/admin/ecommerce/checkout-one-form-2-oracle.xql 4 Jul 2005 14:28:33 -0000 1.4
@@ -1,6 +1,26 @@
+
+
+
+
+ oracle
+ 8.1.6
+
+
+
+
+ insert into ec_problems_log
+ (problem_id, problem_date, problem_details)
+ values
+ (ec_problem_id_sequence.nextval, sysdate,:prob_details )
+
+
+ update ec_gift_certificates set user_id=:user_id, claimed_date=sysdate where gift_certificate_id=:gift_certificate_id
+
+
+
insert into ec_problems_log