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 -N -r1.20 -r1.21 --- openacs-4/packages/dotlrn-ecommerce/tcl/section-procs.tcl 9 Aug 2005 10:53:52 -0000 1.20 +++ openacs-4/packages/dotlrn-ecommerce/tcl/section-procs.tcl 11 Aug 2005 01:04:18 -0000 1.21 @@ -250,7 +250,6 @@ } ad_proc -public dotlrn_ecommerce::section::attendees { - -excluse_my_basket:boolean section_id } { Return number of attendees Index: openacs-4/packages/dotlrn-ecommerce/www/admin/section-delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/admin/section-delete.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/dotlrn-ecommerce/www/admin/section-delete.adp 31 May 2005 22:04:54 -0000 1.1 +++ openacs-4/packages/dotlrn-ecommerce/www/admin/section-delete.adp 11 Aug 2005 01:04:18 -0000 1.2 @@ -3,4 +3,12 @@ @context@ @content;noquote@ - \ No newline at end of file + +

+ + + + + + Back + \ No newline at end of file Index: openacs-4/packages/dotlrn-ecommerce/www/admin/section-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/admin/section-delete.tcl,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/dotlrn-ecommerce/www/admin/section-delete.tcl 16 Jul 2005 12:51:06 -0000 1.6 +++ openacs-4/packages/dotlrn-ecommerce/www/admin/section-delete.tcl 11 Aug 2005 01:04:18 -0000 1.7 @@ -1,6 +1,6 @@ ad_page_contract { - Delete a section + Delete a section @author Hamilton Chua @creation-date 2004-05-01 @@ -13,30 +13,37 @@ set page_title "Delete Section" set context $page_title -# create confirmation form -set content "Are you sure you want to remove this section ? " +set attendees [dotlrn_ecommerce::section::attendees $section_id] - ad_form -name delete_section \ +# Don't allow deletion of sections with attendees +if { $attendees <= 0 } { + # create confirmation form + set content "Are you sure you want to remove this section ? " + + ad_form -name delete_section \ -cancel_url $return_url \ -form { - {return_url:text(hidden) { value $return_url } } - {section_id:text(hidden) { value $section_id } } + {return_url:text(hidden) { value $return_url } } + {section_id:text(hidden) { value $section_id } } } -on_submit { - # HAM : - # for now just delete from dotlrn_ecommerce_sections and then archive - # discuss what else needs to be done for delete - - set community_id [db_string "getcomid" "select community_id from dotlrn_ecommerce_section where section_id=:section_id"] - - # delete from section table - db_dml "delete section" "delete from dotlrn_ecommerce_section where section_id=:section_id " - - # archive community - dotlrn_community::archive -community_id $community_id + # HAM : + # for now just delete from dotlrn_ecommerce_sections and then archive + # discuss what else needs to be done for delete + + set community_id [db_string "getcomid" "select community_id from dotlrn_ecommerce_section where section_id=:section_id"] + + # delete from section table + db_dml "delete section" "delete from dotlrn_ecommerce_section where section_id=:section_id " + + # archive community + dotlrn_community::archive -community_id $community_id - } -after_submit { - ad_returnredirect $return_url - } + } -after_submit { + ad_returnredirect $return_url + } +} else { + set content "This section currently has participants and cannot be removed." +} \ No newline at end of file