Index: openacs-4/packages/chat/www/html-chat-script-form.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/html-chat-script-form.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/chat/www/html-chat-script-form.adp 26 Oct 2006 13:03:59 -0000 1.1 @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + +
+ + #chat.Chat#: + + + + + +
+ + + + +
+ + + +
+ + + Index: openacs-4/packages/chat/www/html-chat-script-form.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/html-chat-script-form.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/chat/www/html-chat-script-form.tcl 26 Oct 2006 13:03:59 -0000 1.1 @@ -0,0 +1,34 @@ +ad_page_contract { + + mostra mensagens do chat + + @author TEKNE (tekne@teknedigital.com.br) + @creation-date 2005-03-09 + +} { +room_id:integer +} + +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 active [room_active_status $room_id] + + +if { ($read_p == "0" && $write_p == "0") || ($ban_p == "1") || ($active == "f") } { + #Display unauthorize privilege page. + ad_returnredirect unauthorized + ad_script_abort +} + + + +if { [catch {set room_name [chat_room_name $room_id]} errmsg] } { + ad_return_complaint 1 "[_ chat.Room_not_found]" +} + +set context_bar "[list $room_name]" + +ad_return_template \ No newline at end of file Index: openacs-4/packages/chat/www/html-chat-script-msg.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/html-chat-script-msg.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/chat/www/html-chat-script-msg.adp 26 Oct 2006 13:03:59 -0000 1.1 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + Index: openacs-4/packages/chat/www/html-chat-script-msg.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/html-chat-script-msg.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/chat/www/html-chat-script-msg.tcl 26 Oct 2006 13:03:59 -0000 1.1 @@ -0,0 +1,29 @@ +ad_page_contract { +mostra mensagens do chat +} { + +room_id:integer + +} + + +# ns_log notice $room_id:onevalue +template::list::create -name chat_msg \ + -multirow chat_msg_query \ + -no_data "Sem dados no momento " \ + -page_flush_p 1 \ + -elements { + creation_date { label "[_ chat.date]" } + msg { label "[_ chat.msg]" } + + } + + +db_multirow -extend {} chat_msg_query select_msg_itens { + select to_char(creation_date, 'DD-MM-YYYY hh:mm:ss') as creation_date, + msg + from chat_msgs + where room_id = :room_id + order by msg_id desc + limit 15 } +ad_return_template \ No newline at end of file Index: openacs-4/packages/chat/www/html-chat-script.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/html-chat-script.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/chat/www/html-chat-script.adp 26 Oct 2006 13:03:59 -0000 1.1 @@ -0,0 +1,16 @@ + + + @room_name@ + + + + + + + + + + <html> + <body bgcolor=yellow> + Este chat usa frames e requer uma vers�o atualizada do seu navegador. + \ No newline at end of file Index: openacs-4/packages/chat/www/html-chat-script.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/html-chat-script.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/chat/www/html-chat-script.tcl 26 Oct 2006 13:03:59 -0000 1.1 @@ -0,0 +1,31 @@ +ad_page_contract { +mostra mensagens do chat +} { + page:optional +} -properties { +room_id:onevalue + +} + + + +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 active [room_active_status $room_id] + + +if { ($read_p == "0" && $write_p == "0") || ($ban_p == "1") || ($active == "f") } { + #Display unauthorize privilege page. + ad_returnredirect unauthorized + ad_script_abort +} + + +if { [catch {set room_name [chat_room_name $room_id]} errmsg] } { + ad_return_complaint 1 "[_ chat.Room_not_found]" +} + + # ns_log notice "$room_id:onevalue" Index: openacs-4/packages/chat/www/options.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/options.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/chat/www/options.adp 26 Oct 2006 13:03:59 -0000 1.1 @@ -0,0 +1,9 @@ +<!-- + Options screen + @author Pablo Mu�oz (pablomp@tid.es) + @creation-date October 10, 2006 +--> +<master> +<property name="title">Options</property> + +<formtemplate id="options"></formtemplate> \ No newline at end of file Index: openacs-4/packages/chat/www/room-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/room-edit-2.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/chat/www/room-edit-2.tcl 26 Oct 2006 13:03:59 -0000 1.6 @@ -0,0 +1,33 @@ +#/www/chat/room-edit-2.tcl +ad_page_contract { + Update room information. + + @author David Dao (ddao@arsdigita.com) + @creation-date November 15, 2000 + @cvs-id $Id: room-edit-2.tcl,v 1.6 2006/10/26 13:03:59 pablom Exp $ +} { + room_id:notnull,integer + pretty_name:notnull,trim + {description:trim ""} + {moderated_p "f"} + {archive_p "f"} + {active_p "f"} +} + +ad_require_permission $room_id chat_room_edit + +ns_log notice "receive: moderated_p:$moderated_p archive_p:$archive_p active_p:$active_p" + + +if {[catch {chat_room_edit $room_id $pretty_name $description $moderated_p $active_p $archive_p} errmsg]} { + + ad_return_complaint 1 "[_ chat.Could_not_update_room]: $errmsg" +} + + +ad_returnredirect "room?room_id=$room_id" + + + + + Index: openacs-4/packages/chat/www/room-edit.postgresql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/room-edit.postgresql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/chat/www/room-edit.postgresql 26 Oct 2006 13:03:59 -0000 1.1 @@ -0,0 +1,31 @@ +<?xml version="1.0"?> + +<queryset> +<rdbms><type>postgresql</type><version>7.1</version></rdbms> + +<fullquery name="edit-room"> + <querytext> + select rm.room_id, + rm.pretty_name as Epretty_name, + rm.description as Edescription, + rm.moderated_p as Emoderated_p, + rm.active_p as Eactive_p, + rm.archive_p as Earchive_p, + rm.rss_service as Erss_service, + rm.mail_service as Email_service, + rm.end_date as Eend_�date, + rm.maximal_participants as Emaximal_participants, + rm.minimal_participants as Eminimal_participants, + rm.key_words as Ekey_words, + (select ru.alias + from chat_registered_users ru + where rm.room_id = ru.room_id + and ru.user_id = :user_id) as Ealias + from chat_rooms rm, + where rm.room_id = :room_id + order by rm.pretty_name + </querytext> +</fullquery> + +</queryset> + Index: openacs-4/packages/chat/www/room-entry.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/room-entry.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/chat/www/room-entry.adp 26 Oct 2006 13:03:59 -0000 1.7 @@ -0,0 +1,29 @@ +<!-- + Create/edit form for room information. + + @author David Dao (ddao@arsdigita.com) + @creation-date November 17, 2000 + @cvs-id $Id: room-entry.adp,v 1.7 2006/10/26 13:03:59 pablom Exp $ +--> +<master> +<property name="context">@context_bar;noquote@</property> +<property name="title">@title;noquote@</property> + + +<formtemplate id="room-entry"></formtemplate> + + + + + + + + + + + + + + + + Index: openacs-4/packages/chat/www/room-new-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/room-new-2.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/chat/www/room-new-2.tcl 26 Oct 2006 13:03:59 -0000 1.5 @@ -0,0 +1,58 @@ +#/chat/www/room-new-2.tcl +ad_page_contract { + Add a new room to the database. + + @author David Dao (ddao@arsdigita.com) + @creation-date November 15, 2000 + @cvs-id $Id: room-new-2.tcl,v 1.5 2006/10/26 13:03:59 pablom Exp $ +} { + pretty_name:notnull,trim + {description:trim ""} + {moderated_p:boolean} + {archive_p:boolean} + {active_p:boolean} +} + +set package_id [ad_conn package_id] +set user_id [ad_conn user_id] +set creation_ip [ad_conn peeraddr] + +ad_require_permission $package_id chat_room_create + + + +if {[catch {set room_id [chat_room_new -moderated_p $moderated_p \ + -description $description \ + -active_p $active_p \ + -archive_p $archive_p \ + -context_id $package_id \ + -creation_user $user_id \ + -creation_ip $creation_ip $pretty_name]} errmsg]} { + ad_return_complaint 1 "[_ chat.Create_new_room_failed]: $errmsg" +} + +set comm_id [dotlrn_community::get_community_id] +if {$comm_id ne ""} { + chat_user_grant $room_id [dotlrn_community::get_community_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 -1 +} + +ad_returnredirect "room?room_id=$room_id" + + + + + + + + + + + + Index: openacs-4/packages/chat/www/room-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/room-new.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/chat/www/room-new.tcl 26 Oct 2006 13:03:59 -0000 1.5 @@ -0,0 +1,153 @@ +#/chat/www/room-new.tcl +ad_page_contract { + Display a form to create a new room. + + @author David Dao (ddao@arsdigita.com) + @creation-date November 13, 2000 + @cvs-id $Id: room-new.tcl,v 1.5 2006/10/26 13:03:59 pablom Exp $ +} { +} -properties { + context_bar:onevalue + room_id:onevalue + title:onevalue + action:onevalue + submit_label:onevalue + pretty_name:onevalue + moderated_p:onevalue +} + +ad_require_permission [ad_conn package_id] chat_room_create + +set context_bar [list "[_ chat.Create_a_room]"] +set title "[_ chat.Create_a_room]" +set action "room-new-2" +set submit_label "[_ chat.Create_room]" +set pretty_name "" +set description "" +set archive_p "t" +set active_p "t" +set moderated_p "f" +set room_id "" +set maxP "" +set minP "" +set end_date "" +set key_words "" +set alias "" +set Rss_service "" +set frequency [list daily monthly weekly] + +ad_form -name "room-entry" -edit_buttons [list [list [_ chat.Create_room] next]] -has_edit 1 -form { + {pretty_name:text(text) + {label "#chat.Room_name#" } + {title "Name of the room"} + } + {alias:text(text) + {label "Alias" } + {help_text "Alias in this room"} + } + {description:text(textarea),optional + {label "#chat.Description#" } + {html {rows 6 cols 65}} + } + {key_words:text(textarea),optional + {label "Key words" } + {html {rows 3 cols 25}} + {help_text "Main words of the room, in order to describe it"} + } + {maxP:text(text) + {label "Maximal participants" } + {help_text "Maximal number of participants in this room"} + } + {end_date:date(date) + {label "End date (dd/mm/yyyy)" } + {help_text "From this date the room will be closed"} + } + {Rss_service:boolean(radio) + {label "Rss_service" } + {options {{"#acs-kernel.common_Yes#" t} {"#acs-kernel.common_no#" f}}} + {help_text "Sindicate into RSS"} + } + {frequency1:boolean(select),optional + {label "Frequency Rss" } + {options {{"daily"} {"monthly" } {"weekly" }}} + {help_text "Frecuency of RSS service"} + } + {Mail_service:boolean(radio) + {label "Mail_service" } + {options {{"#acs-kernel.common_Yes#" t} {"#acs-kernel.common_no#" f}}} + {help_text "Receive brief mails"} + } + {frequency2:boolean(select),optional + {label "Frequency Mail" } + {options {{"daily"} {"monthly" } {"weekly" }}} + {help_text "Frecuency of mail service"} + } + {moderated_p:boolean(radio) + {label "Moderated" } + {options {{"#acs-kernel.common_Yes#" t} {"#acs-kernel.common_no#" f}}} + } + {active_p:boolean(radio) + {label "#chat.Active#" } + {options {{"#acs-kernel.common_Yes#" t} {"#acs-kernel.common_no#" f}}} + } + {archive_p:boolean(radio) + {label "#chat.Archive#" } + {options {{"#acs-kernel.common_Yes#" t} {"#acs-kernel.common_no#" f}}} + } + # {auto_flush_p:boolean(radio) + # {label "#chat.AutoFlush#" } + # {options {{"#acs-kernel.common_Yes#" t} {"#acs-kernel.common_no#" f}}} + # {help_text "[_ chat.AutoFlushHelp]"} + # } + # {auto_transcript_p:boolean(radio) + # {label "#chat.AutoTranscript#" } + # {options {{"#acs-kernel.common_Yes#" t} {"#acs-kernel.common_no#" f}}} + # {help_text "[_ chat.AutoTranscriptHelp]"} + # } +} -after_submit { + set date [lrange $end_date 0 2] + set comm_id [dotlrn_community::get_community_id] + if { $comm_id eq "" } { + set comm_id 0 + } else { + set comm_id [dotlrn_community::get_community_id] + } + if {[catch {set room_id [chat_room_new \ + -alias $alias \ + -key_words $key_words \ + -maxP $maxP \ + -end_date $date \ + -Rss_service $Rss_service \ + -Mail_service $Mail_service \ + -moderated_p $moderated_p \ + -active_p $active_p \ + -archive_p $archive_p \ + -auto_flush_p t \ + -auto_transcript_p t \ + -context_id [ad_conn package_id] \ + -comm_id $comm_id \ + -creation_user [ad_conn user_id] \ + -creation_ip [ad_conn peeraddr] \ + $description $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 + } + ad_returnredirect "room?room_id=$room_id" + ad_script_abort +} +ad_return_template "room-entry" + Index: openacs-4/packages/chat/www/user-grant-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/user-grant-2.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/chat/www/user-grant-2.tcl 26 Oct 2006 13:03:59 -0000 1.3 @@ -0,0 +1,18 @@ +#/chat/www/user-grant-2.tcl +ad_page_contract { + + Grant chat user privilege. + + @author David Dao (ddao@arsdigita.com) + @creation-date November 22, 2000 + @cvs-id $Id: user-grant-2.tcl,v 1.3 2006/10/26 13:03:59 pablom Exp $ +} { + room_id:integer,notnull + party_id:integer,notnull +} + +ad_require_permission $room_id chat_user_grant + +chat_user_grant $room_id $party_id + +ad_returnredirect "room?room_id=$room_id" \ No newline at end of file Index: openacs-4/packages/chat/www/user-grant-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/user-grant-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/chat/www/user-grant-postgresql.xql 26 Oct 2006 13:03:59 -0000 1.3 @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<queryset> +<rdbms><type>postgresql</type><version>7.1</version></rdbms> + +<fullquery name="list_parties"> + <querytext> + select party_id, acs_object__name(party_id) as name + from parties + </querytext> +</fullquery> + +</queryset> Index: openacs-4/packages/chat/www/user-grant.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/user-grant.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/chat/www/user-grant.tcl 26 Oct 2006 13:03:59 -0000 1.5 @@ -0,0 +1,32 @@ +#/chat/www/user-grant.tcl +ad_page_contract { + + Allow user to the chat room. + + @author David Dao (ddao@arsdigita.com) + @creation-date November 22, 2000 + @cvs-id $Id: user-grant.tcl,v 1.5 2006/10/26 13:03:59 pablom Exp $ +} { + room_id:integer,notnull +} -properties { + context_bar:onevalue + title:onevalue + action:onevalue + submit_label:onevalue + room_id:onevalue + description:onevalue + parties:multirow +} + +ad_require_permission $room_id chat_user_grant + +set context_bar [list "[_ chat.Grant_user]"] +set submit_label "[_ chat.Grant]" +set title "[_ chat.Grant_user]" +set action "user-grant-2" +set description "[_ chat.Grant_chat_read_rite_privilege_for] <b>[chat_room_name $room_id]</b> [_ chat.to]" +db_multirow parties list_parties { } + +ad_return_template grant-entry + + Index: openacs-4/packages/chat/www/user-revoke-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/user-revoke-2.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/chat/www/user-revoke-2.tcl 26 Oct 2006 13:03:59 -0000 1.4 @@ -0,0 +1,19 @@ +#/chat/www/user-revoke-2.tcl +ad_page_contract { + + Revoke chat user privilege. + + @author David Dao (ddao@arsdigita.com) + @creation-date November 22, 2000 + @cvs-id $Id: user-revoke-2.tcl,v 1.4 2006/10/26 13:03:59 pablom Exp $ +} { + room_id:integer,notnull + party_id:integer,notnull +} + +ad_require_permission $room_id chat_user_revoke + +chat_user_revoke $room_id $party_id +# ns_log Notice "chat_user_revoke $room_id $party_id" + +ad_returnredirect "room?room_id=$room_id" Index: openacs-4/packages/chat/www/user-revoke-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/user-revoke-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/chat/www/user-revoke-postgresql.xql 26 Oct 2006 13:03:59 -0000 1.3 @@ -0,0 +1,11 @@ +<?xml version="1.0"?> +<queryset> +<rdbms><type>postgresql</type><version>7.1</version></rdbms> + +<fullquery name="get_party_name"> + <querytext> + select acs_object__name(:party_id) from dual + </querytext> +</fullquery> + +</queryset> Index: openacs-4/packages/chat/www/user-revoke.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/user-revoke.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/chat/www/user-revoke.adp 26 Oct 2006 13:03:59 -0000 1.7 @@ -0,0 +1,18 @@ +<!-- + Display confirmation. + + @author David Dao (ddao@arsdigita.com) + @creation-date November 22, 2000 + @cvs-id $Id: user-revoke.adp,v 1.7 2006/10/26 13:03:59 pablom Exp $ +--> +<master> +<property name="context">@context_bar;noquote@</property> +<property name="title">#chat.Confirm_revoke_user#</property> + +<form method=post action=user-revoke-2> +<input type=hidden name=room_id value="@room_id@"> +<input type=hidden name=party_id value="@party_id@"> +#chat.Are_you_sure_you_want_to_revoke# <b>@party_pretty_name@</b> #chat.from# @pretty_name@? +<p><input type=submit value="#chat.Revoke#"> +</form> + Index: openacs-4/packages/chat/www/user-revoke.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/user-revoke.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/chat/www/user-revoke.tcl 26 Oct 2006 13:03:59 -0000 1.5 @@ -0,0 +1,22 @@ +#/chat/www/user-revoke.tcl +ad_page_contract { + + Display confirmation before remove chat user. + + @author David Dao (ddao@arsdigita.com) + @creation-date November 22, 2000 + @cvs-id $Id: user-revoke.tcl,v 1.5 2006/10/26 13:03:59 pablom Exp $ +} { + room_id:integer,notnull + party_id:integer,notnull +} + +ad_require_permission $room_id chat_user_revoke + +set context_bar [list [list "room?room_id=$room_id" "[_ chat.Room_Information]"] "[_ chat.Revoke_user]"] + +set party_pretty_name [db_string get_party_name {} ] + +set pretty_name [chat_room_name $room_id] + +ad_return_template