Index: openacs-4/packages/dotlrn/www/admin/department-delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/department-delete.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/admin/department-delete.adp 14 Aug 2002 19:14:58 -0000 1.1 @@ -0,0 +1,29 @@ +<% + + # + # Copyright (C) 2001, 2002 OpenForce, Inc. + # + # 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. + # + +%> + + +@context_bar@ + +@title@ + +Are you sure you want to delete the empty department @pretty_name@? +
+ + Index: openacs-4/packages/dotlrn/www/admin/department-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/department-delete.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/admin/department-delete.tcl 14 Aug 2002 19:14:58 -0000 1.1 @@ -0,0 +1,83 @@ +# +# Copyright (C) 2001, 2002 OpenForce, Inc. +# +# 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_page_contract { + delete an empty department + + @author arjun (arjun@openforce.net) + @version $Id: department-delete.tcl,v 1.1 2002/08/14 19:14:58 arjun Exp $ +} -query { + {referer "departments"} + {department_key:notnull} + {pretty_name:notnull} +} -properties { + title:onevalue + context_bar:onevalue +} + +set title "Delete Empty [parameter::get -parameter departments_pretty_name]" +set context_bar [list [list departments [parameter::get -parameter departments_pretty_plural]] Delete] + +form create delete_department + +# this is lame, but the button hack is not ready yet +set yes_label "Yes, delete $pretty_name" +set no_label "No, don't delete it" + +element create delete_department no_button \ + -label $no_label \ + -datatype text \ + -widget submit \ + -value "1" + +element create delete_department yes_button \ + -label $yes_label \ + -datatype text \ + -widget submit + +element create delete_department department_key \ + -datatype text \ + -widget hidden \ + -value $department_key + +element create delete_department pretty_name \ + -datatype text \ + -widget hidden \ + -value $pretty_name + +element create delete_department referer \ + -label "Referer" \ + -datatype text \ + -widget hidden \ + -value $referer + +if {[form is_valid delete_department]} { + form get_values delete_department department_key pretty_name referer no_button yes_button + + if {[string equal $yes_button $yes_label]} { + + db_transaction { + set subcomm_id [dotlrn_department::delete \ + -department_key $department_key + ] + } + } + + ad_returnredirect "$referer" + ad_script_abort +} + +ad_return_template