Index: openacs-4/packages/new-portal/tcl/portal-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/portal-procs.tcl,v diff -u -r1.179.2.1 -r1.179.2.2 --- openacs-4/packages/new-portal/tcl/portal-procs.tcl 30 Jan 2007 19:48:13 -0000 1.179.2.1 +++ openacs-4/packages/new-portal/tcl/portal-procs.tcl 31 Jan 2007 17:51:27 -0000 1.179.2.2 @@ -618,7 +618,6 @@ " - # # Revert page chunk # @@ -636,6 +635,22 @@ " } + if { [db_string sub_portals {}] } { + # Portal has other portals using it as a template + append template "

+
+
+ + +

[_ new-portal.lt_Revert_all_portals_us]

+
+ +
+ [_ new-portal.lt_Note_Please_be_patien] +
+
" + } + # # Templating system hacks # @@ -671,7 +686,20 @@ set edit_p 1 } - if { ![empty_string_p [ns_set get $form "op_revert"]] } { + + if { ![empty_string_p [ns_set get $form "op_revert_all"]] } { + set template_id [ns_set get $form "portal_id"] + ns_log notice "REVERTING ALL template_id='${template_id}'" + set revert_all_set_id [ns_set create] + + ns_set put $revert_all_set_id op_revert "op_revert" + set portal_id_list [db_list get_all_portals "select portal_id from portals where template_id=:template_id"] + ns_log notice "PORTAL_ID_LIST $portal_id_list" + foreach portal_id $portal_id_list { + portal::configure_dispatch -portal_id $portal_id -form $revert_all_set_id + } + + } elseif { ![empty_string_p [ns_set get $form "op_revert"]] } { #Transaction here was causeing uncaught deadlocks so it was removed. - CM 9-11-02 #It doesn't seem necessary to have a transaction here. Its not a big deal if this fails in the the middle. The user can just revert again. @@ -1574,7 +1602,7 @@ } { global errorInfo - ns_log error "*** portal::evaluate_element callback Error! ***\n\n $errmsg\n\n$errorInfo\n\n" + ns_log error "*** portal::evaluate_element callback Error! ***\n\n $errmsg\n\n$errorInfo\n\n url = '[ad_conn url]' \n config='[array get config]'\n" # ad_return_complaint 1 "*** portal::render_element show callback Error! ***

$errmsg\n\n" set element(content) "You have found a bug in our code.

Please notify the webmaster and include the following text. Thank You.

*** portal::evaluate_element callback Error! ***\n\n $errmsg
\n\n" @@ -2365,6 +2393,7 @@ relative or in proper "/resources/package-key" form. (the existing code for the theme resource_dir only supports the relative form) } { + set header_stuff "" db_1row get_resource_dir {} if { [string first /resources/ $resource_dir] == 0 } { set l [split $resource_dir /] Index: openacs-4/packages/new-portal/tcl/portal-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/portal-procs.xql,v diff -u -r1.45.2.1 -r1.45.2.2 --- openacs-4/packages/new-portal/tcl/portal-procs.xql 30 Jan 2007 19:48:13 -0000 1.45.2.1 +++ openacs-4/packages/new-portal/tcl/portal-procs.xql 31 Jan 2007 17:51:27 -0000 1.45.2.2 @@ -107,6 +107,14 @@ + + + select count(*) + from portals + where template_id = :portal_id + + + update portal_element_map