#chat.There_are_no_rooms_available# +
#chat.There_are_no_rooms_available#
+@rooms.pretty_name@ | -- [ HTML | java ] - | -
- | - @desc@ - | -
+ Index: openacs-4/packages/chat/www/room-delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/room-delete.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/chat/www/room-delete.adp 14 Mar 2006 12:16:09 -0000 1.5 +++ openacs-4/packages/chat/www/room-delete.adp 24 Jun 2006 14:23:42 -0000 1.6 @@ -12,7 +12,7 @@
Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/packages/chat/www/room-edit-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/www/room-edit.adp'. Fisheye: No comparison available. Pass `N' to diff? 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.4 -r1.5 --- openacs-4/packages/chat/www/room-edit.tcl 14 Mar 2006 12:16:09 -0000 1.4 +++ openacs-4/packages/chat/www/room-edit.tcl 24 Jun 2006 14:23:42 -0000 1.5 @@ -2,46 +2,97 @@ ad_page_contract { Display a form to edit room information. - @author David Dao (ddao@arsdigita.com) - @creation-date November 13, 2000 - @cvs-id $Id$ + @author Peter Alberer (peter@alberer.com) + @creation-date March 26, 2006 } { - room_id:integer,notnull -} -properties { - context_bar:onevalue - room_id:onevalue - title:onevalue - action:onevalue - submit_label:onevalue - pretty_name:onevalue - description:onevalue - moderated_p:onevalue - active_p:onevalue - room:onerow -} + room_id:integer,optional +} -ad_require_permission $room_id chat_room_edit +permission::require_permission -object_id [ad_conn package_id] -privilege chat_room_edit +if { ![info exists room_id] } { + set title "[_ chat.Create_a_new_room]" +} else { + set title "[_ chat.Edit_room] \"[chat_room_name $room_id]\"" +} -if {[catch {db_1row room_info { - select pretty_name, description, moderated_p, archive_p, active_p - from chat_rooms - where room_id = :room_id}} errmsg]} { - - ad_return_complaint 1 "[_ chat.Room_not_found]." +ad_form -name "edit-room" -edit_buttons [list [list [_ chat.Update_room] next]] -has_edit 1 -form { + {room_id:key} + {moderated_p:boolean(hidden) + {value "f"} + } + {pretty_name:text(text) + {label "#chat.Room_name#" } + } + {description:text(textarea),optional + {label "#chat.Description#" } + {html {rows 6 cols 65}} + } + {active_p:boolean(radio) + {label "#chat.Active#" } + {options {{"#acs-kernel.common_Yes#" t} {"#acs-kernel.common_no#" f}}} + {value "t"} + } + {archive_p:boolean(radio) + {label "#chat.Archive#" } + {options {{"#acs-kernel.common_Yes#" t} {"#acs-kernel.common_no#" f}}} + {value "t"} + } + {auto_flush_p:boolean(radio) + {label "#chat.AutoFlush#" } + {options {{"#acs-kernel.common_Yes#" t} {"#acs-kernel.common_no#" f}}} + {value "t"} + {help_text "[_ chat.AutoFlushHelp]"} + } + {auto_transcript_p:boolean(radio) + {label "#chat.AutoTranscript#" } + {options {{"#acs-kernel.common_Yes#" t} {"#acs-kernel.common_no#" f}}} + {value "f"} + {help_text "[_ chat.AutoTranscriptHelp]"} + } +} -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 \ + -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" + break + } + set comm_id "" + if {[info command dotlrn_community::get_community_id] ne ""} { + set comm_id [dotlrn_community::get_community_id] + } + if {$comm_id ne ""} { + 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 + } +} -edit_request { + if {[catch {db_1row room_info { + select pretty_name, description, moderated_p, archive_p, active_p, auto_flush_p, auto_transcript_p + from chat_rooms + where room_id = :room_id}} errmsg]} { + ad_return_complaint 1 "[_ chat.Room_not_found]." + break + } +} -edit_data { + if {[catch {chat_room_edit $room_id $pretty_name $description $moderated_p $active_p $archive_p $auto_flush_p $auto_transcript_p} errmsg]} { + ad_return_complaint 1 "[_ chat.Could_not_update_room]: $errmsg" + break + } + util_memoize_flush [list chat_room_get_not_cached $room_id] +} -after_submit { + ad_returnredirect "room?room_id=$room_id" + ad_script_abort } -ns_log notice "send: moderated_p:$moderated_p archive_p:$archive_p active_p:$active_p" - -set context_bar [list "Edit room '$pretty_name'"] -set title "Edit room '$pretty_name'" -set action "room-edit-2" -set submit_label "[_ chat.Update_room]" - -ad_return_template "room-entry" - - - - - - Index: openacs-4/packages/chat/www/room-enter.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/room-enter.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/chat/www/room-enter.tcl 14 Mar 2006 12:16:09 -0000 1.3 +++ openacs-4/packages/chat/www/room-enter.tcl 24 Jun 2006 14:23:42 -0000 1.4 @@ -10,24 +10,32 @@ room_id:integer,notnull client:trim } -chat_start_server + set user_id [ad_conn user_id] -set read_p [ad_permission_p $room_id "chat_read"] -set write_p [ad_permission_p $room_id "chat_write"] -set ban_p [ad_permission_p $room_id "chat_ban"] +set read_p [permission::permission_p -object_id $room_id -privilege "chat_read"] +set write_p [permission::permission_p -object_id $room_id -privilege "chat_write"] +set ban_p [permission::permission_p -object_id $room_id -privilege "chat_ban"] +ns_log notice "--query ban $ban_p: permission::permission_p -object_id $room_id -privilege chat_ban -party_id [ad_conn user_id]" set active [room_active_status $room_id] - -if { ($read_p == "0" && $write_p == "0") || ($ban_p == "1") || ($active == "f") } { +if { ($read_p == "0" && $write_p == "0") || ($ban_p == "1") || ($active eq "f") } { #Display unauthorize privilege page. ad_returnredirect unauthorized ad_script_abort } -if {$client == "html"} { +set default_client [parameter::get -parameter "DefaultClient" -default "ajax"] - chat_message_post $room_id $user_id "[_ chat.has_entered_the_room]." "1" +if {$default_client eq "java"} { + chat_start_server } +switch $client { + "html" - "ajax" - "html-chat-script" { + ns_log Notice "YY room-enter: has_entered_the room" + chat_message_post $room_id $user_id "[_ chat.has_entered_the_room]." "1" + } +} + ad_returnredirect "chat?room_id=$room_id&client=$client" Fisheye: Tag 1.6 refers to a dead (removed) revision in file `openacs-4/packages/chat/www/room-entry.adp'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/chat/www/room-exit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/room-exit.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/chat/www/room-exit.tcl 14 Mar 2006 12:16:09 -0000 1.3 +++ openacs-4/packages/chat/www/room-exit.tcl 24 Jun 2006 14:23:42 -0000 1.4 @@ -10,12 +10,10 @@ } set user_id [ad_conn user_id] +set read_p [permission::permission_p -object_id $room_id -privilege "chat_read"] +set write_p [permission::permission_p -object_id $room_id -privilege "chat_write"] +set ban_p [permission::permission_p -object_id $room_id -privilege "chat_ban"] - -set read_p [ad_permission_p $room_id "chat_read"] -set write_p [ad_permission_p $room_id "chat_write"] -set ban_p [ad_permission_p $room_id "chat_ban"] - if { ($read_p == "0" && $write_p == "0") || ($ban_p == "1") } { #Display unauthorize privilege page. ad_returnredirect unauthorized @@ -24,5 +22,10 @@ chat_message_post $room_id $user_id "[_ chat.has_left_the_room]." "1" -#ad_returnredirect index -ad_returnredirect [dotlrn::get_url] +# send to AJAX +set session_id [ad_conn session_id] +::chat::Chat c1 -volatile -chat_id $room_id -session_id $session_id +c1 logout + +ad_returnredirect index +#ad_returnredirect [dotlrn::get_url] Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/chat/www/room-new-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/chat/www/room-new.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/chat/www/room-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/room-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/chat/www/room-oracle.xql 14 Mar 2006 12:16:09 -0000 1.1 +++ openacs-4/packages/chat/www/room-oracle.xql 24 Jun 2006 14:23:42 -0000 1.2 @@ -24,22 +24,14 @@@description@- -
#chat.Room_name# | +@pretty_name@ | +
#chat.Description# | +@description@ | +
#chat.Active# | +@active_p@ | +
#chat.Archive# | +@archive_p@ | +
#chat.AutoFlush# | +@auto_flush_p@ | +
#chat.AutoTranscript# | +@auto_transcript_p@ | +
#chat.message_count# | +@message_count@ | +
(#chat.Edit#) +
#chat.No_information_available#.
#chat.Users_allow# -
(#chat.Ban_user#) -
#chat.Transcripts# -
#chat.Extreme_Actions# -
-+ Index: openacs-4/packages/chat/www/transcript-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/transcript-delete.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/chat/www/transcript-delete.tcl 14 Mar 2006 12:16:09 -0000 1.3 +++ openacs-4/packages/chat/www/transcript-delete.tcl 24 Jun 2006 14:23:42 -0000 1.4 @@ -14,7 +14,7 @@ transcript_id:onevalue } -ad_require_permission $transcript_id chat_transcript_delete +permission::require_permission -object_id $transcript_id -privilege chat_transcript_delete set context_bar [list "[_ chat.Delete_transcript]"] ad_return_template Index: openacs-4/packages/chat/www/transcript-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/transcript-edit-2.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/chat/www/transcript-edit-2.tcl 14 Mar 2006 12:16:09 -0000 1.3 +++ openacs-4/packages/chat/www/transcript-edit-2.tcl 24 Jun 2006 14:23:42 -0000 1.4 @@ -13,9 +13,8 @@ {description:trim ""} } -ad_require_permission $transcript_id chat_transcript_edit +permission::require_permission -object_id $transcript_id -privilege chat_transcript_edit - if { [catch {chat_transcript_edit $transcript_id $transcript_name $description $contents} errmsg] } { ad_return_complaint 1 "[_ chat.Could_not_update_transcript]: $errmsg" } Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/www/transcript-edit.adp'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/chat/www/transcript-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/transcript-edit.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/chat/www/transcript-edit.tcl 14 Mar 2006 12:16:09 -0000 1.3 +++ openacs-4/packages/chat/www/transcript-edit.tcl 24 Jun 2006 14:23:42 -0000 1.4 @@ -8,32 +8,44 @@ } { transcript_id:integer,notnull room_id:integer,notnull -} -properties { - context_bar:onevalue - title:onevalue - room_id:onevalue - transcript_id:onevalue - transcript_name:onevalue - description:onevalue - contents:onevalue - action:onevalue - submit_label:onevalue -} +} -ad_require_permission $transcript_id chat_transcript_edit +permission::require_permission -object_id $transcript_id -privilege chat_transcript_edit set context_bar [list "[_ chat.Edit_transcript]"] -set title "[_ chat.Edit_transcript]" -set action "transcript-edit-2" set submit_label "[_ chat.Edit]" +set active_p [room_active_status $room_id] db_1row get_transcript_info { - select pretty_name as transcript_name, - description, - contents + select pretty_name, description, contents from chat_transcripts where transcript_id = :transcript_id } -ad_return_template "transcript-entry" - +ad_form -name "edit-transcription" -edit_buttons [list [list [_ chat.Edit] next]] -has_edit 1 -form { + {room_id:integer(hidden) + {value $room_id} + } + {transcript_id:integer(hidden) + {value $transcript_id} + } + {pretty_name:text(text) + {label "#chat.Transcript_name#" } + {value $pretty_name} + } + {description:text(textarea),optional + {label "#chat.Description#" } + {html {rows 6 cols 65}} + {value $description} + } + {contents:text(textarea) + {label "#chat.Transcript#" } + {html {rows 6 cols 65}} + {value $contents} + } +} -on_submit { + if { [catch {chat_transcript_edit $transcript_id $pretty_name $description $contents} errmsg] } { + ad_return_complaint 1 "[_ chat.Could_not_update_transcript]: $errmsg" + } + ad_returnredirect "chat-transcript?transcript_id=$transcript_id&room_id=$room_id" +} Index: openacs-4/packages/chat/www/transcript-entry.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/transcript-entry.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/chat/www/transcript-entry.adp 14 Mar 2006 12:16:09 -0000 1.5 +++ openacs-4/packages/chat/www/transcript-entry.adp 24 Jun 2006 14:23:42 -0000 1.6 @@ -12,22 +12,42 @@