Index: openacs-4/packages/chat/www/room-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/room-edit.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/chat/www/room-edit.tcl 25 Jun 2018 14:46:38 -0000 1.15 +++ openacs-4/packages/chat/www/room-edit.tcl 18 Jan 2019 17:14:36 -0000 1.16 @@ -70,72 +70,72 @@ {messages_time_window:integer {label "#chat.MessagesTimeWindow#" } {help_text "[_ chat.MessagesTimeWindowHelp]"} - {value "$four_hours"} + {value "$four_hours"} } } -new_data { if {[catch { - set room_id [chat_room_new \ - -moderated_p $moderated_p \ - -description $description \ - -active_p $active_p \ - -archive_p $archive_p \ - -auto_flush_p $auto_flush_p \ - -auto_transcript_p $auto_transcript_p \ - -login_messages_p $login_messages_p \ - -logout_messages_p $logout_messages_p \ - -messages_time_window $messages_time_window \ - -context_id [ad_conn package_id] \ - -creation_user [ad_conn user_id] \ - -creation_ip [ad_conn peeraddr] $pretty_name] + set room_id [chat_room_new \ + -moderated_p $moderated_p \ + -description $description \ + -active_p $active_p \ + -archive_p $archive_p \ + -auto_flush_p $auto_flush_p \ + -auto_transcript_p $auto_transcript_p \ + -login_messages_p $login_messages_p \ + -logout_messages_p $logout_messages_p \ + -messages_time_window $messages_time_window \ + -context_id [ad_conn package_id] \ + -creation_user [ad_conn user_id] \ + -creation_ip [ad_conn peeraddr] $pretty_name] } errmsg]} { ad_return_complaint 1 "[_ chat.Create_new_room_failed]: $errmsg" ad_script_abort } set comm_id "" if {[info commands dotlrn_community::get_community_id] ne ""} { - set comm_id [dotlrn_community::get_community_id] + set comm_id [dotlrn_community::get_community_id] } if {$comm_id ne ""} { - chat_user_grant $room_id $comm_id + chat_user_grant $room_id $comm_id } else { - #-2 Registered Users - #chat_user_grant $room_id -2 - #0 Unregistered Visitor - #chat_user_grant $room_id 0 - #-1 The Public - chat_user_grant $room_id -2 + #-2 Registered Users + #chat_user_grant $room_id -2 + #0 Unregistered Visitor + #chat_user_grant $room_id 0 + #-1 The Public + chat_user_grant $room_id -2 } } -edit_request { if {[catch { - chat_room_get -room_id $room_id -array r - set pretty_name $r(pretty_name) - set description $r(description) - set moderated_p $r(moderated_p) - set archive_p $r(archive_p) - set auto_flush_p $r(auto_flush_p) - set auto_transcript_p $r(auto_transcript_p) - set login_messages_p $r(login_messages_p) - set logout_messages_p $r(logout_messages_p) - set messages_time_window $r(messages_time_window) + chat_room_get -room_id $room_id -array r + set pretty_name $r(pretty_name) + set description $r(description) + set moderated_p $r(moderated_p) + set archive_p $r(archive_p) + set auto_flush_p $r(auto_flush_p) + set auto_transcript_p $r(auto_transcript_p) + set login_messages_p $r(login_messages_p) + set logout_messages_p $r(logout_messages_p) + set messages_time_window $r(messages_time_window) } errmsg]} { - ad_return_complaint 1 "[_ chat.Room_not_found]." + ad_return_complaint 1 "[_ chat.Room_not_found]." ad_script_abort } } -edit_data { if {[catch { - chat_room_edit \ - $room_id \ - $pretty_name \ - $description \ - $moderated_p \ - $active_p \ - $archive_p \ - $auto_flush_p \ - $auto_transcript_p \ - $login_messages_p \ - $logout_messages_p \ - $messages_time_window + chat_room_edit \ + $room_id \ + $pretty_name \ + $description \ + $moderated_p \ + $active_p \ + $archive_p \ + $auto_flush_p \ + $auto_transcript_p \ + $login_messages_p \ + $logout_messages_p \ + $messages_time_window } errmsg]} { ad_return_complaint 1 "[_ chat.Could_not_update_room]: $errmsg" ad_script_abort @@ -144,3 +144,9 @@ ad_returnredirect "room?room_id=$room_id" ad_script_abort } + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: