Index: openacs-4/packages/chat/chat.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/chat.info,v diff -u -r1.7 -r1.8 --- openacs-4/packages/chat/chat.info 14 Mar 2006 12:16:08 -0000 1.7 +++ openacs-4/packages/chat/chat.info 24 Jun 2006 14:23:40 -0000 1.8 @@ -7,23 +7,28 @@ f f - - David Dao - Server based chat with an html and java client. - 2004-10-10 + + Peter Alberer + Server based chat with an html and ajax client. + 2006-04-11 OpenACS - Modified by Agustin.Lopez@uv.es (University of Valencia, Spain). + Adapted by Peter Alberer 2006/03/25 to allow java and ajax to coexist. +Adapted by Tekne 2006/03/01 to replace JAVA server with AJAX; make use of generalized chat class from xotcl-core. + 0 - + + - + + + Index: openacs-4/packages/chat/catalog/chat.ca_ES.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/catalog/chat.ca_ES.ISO-8859-1.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/chat/catalog/chat.ca_ES.ISO-8859-1.xml 14 Mar 2006 12:16:08 -0000 1.1 +++ openacs-4/packages/chat/catalog/chat.ca_ES.ISO-8859-1.xml 24 Jun 2006 14:23:40 -0000 1.2 @@ -1,5 +1,5 @@ - + Activa Afegeix moderador @@ -79,12 +79,10 @@ Deixa de bandejar l'usuari Sense t�tol Actualitza la sala - Permet l'usuari Bandeja l'usuari Veure Veure transcripci� per nom o correu electr�nic o nom d'usuari limitat a - S� No teniu perm�s per entrar en aquesta sala de xat el vostre nom �s Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/catalog/chat.de_DE.ISO-8859-1.xml'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/chat/catalog/chat.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/catalog/chat.en_US.ISO-8859-1.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/chat/catalog/chat.en_US.ISO-8859-1.xml 14 Mar 2006 12:16:08 -0000 1.1 +++ openacs-4/packages/chat/catalog/chat.en_US.ISO-8859-1.xml 24 Jun 2006 14:23:40 -0000 1.2 @@ -1,17 +1,27 @@ - + + Actions Active + active users Add moderator Add user to room + Ajax + Ajax client Archive Are you sure you want to delete Are you sure you want to revoke chat user privilege of Are you sure you want to revoke moderator privilege of Are you sure you want to unban + Automatically flush messages at midnight + Automatically flush the messages in the database at midnight. This is only used if the rooms is archived. + Automatically created transcript + Auto Transcript + Automatically create a transcript of the messages after flushing. Ban Ban chat read/write privilege for Ban user + Banned users Chat Chat main page Confirm chat transcript delete @@ -28,16 +38,23 @@ Create new room failed Create room Create transcript + Creation date + Current conversation + date + Deactive the room after creating transcript Delete all messages in the room Delete messages + Delete messages after creating the transcript Delete messages failed Delete room Delete room failed Delete transcript Delete transcript failed Description Edit + Edit Room Edit transcript + exit chat room Extreme Actions from Grant @@ -47,44 +64,61 @@ Grant user has entered the room has left the room + HTML HTML + HTML client + Java Java + Javascript key + last activity Log off + Message + Message count messages in Moderated + Message Name No information available + No active + Refresh remove Revoke revoke Revoke moderator Revoke user Admin + Deactive Room Room Information Room moderators Room name Room no active Room not found, Invalid room id + rooms Send/Refresh + Sending message... There are no rooms available to + Transcript Transcript name + Transcript of + Transcript of the messages in room Transcript preview + transcription of all chat messages Transcripts + Available transcripts in room Unauthorized Unauthorized privilege Unban unban Unban user Untitled Update room - Users allow Users ban View View transcript for name or email or username limited to - Yes + <b>Warning</b> The package parameter "DefaultClient" is set to "Ajax" but the package xotcl-core is not installed. Ajax will not work without xotcl-core! You don't have permission to enter this chat room your name is Index: openacs-4/packages/chat/catalog/chat.es_ES.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/catalog/chat.es_ES.ISO-8859-1.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/chat/catalog/chat.es_ES.ISO-8859-1.xml 14 Mar 2006 12:16:08 -0000 1.1 +++ openacs-4/packages/chat/catalog/chat.es_ES.ISO-8859-1.xml 24 Jun 2006 14:23:40 -0000 1.2 @@ -1,17 +1,27 @@ - + + Acciones Activo + Usuarios activos A�adir moderador A�adir un usuario a la sala - Archivo + Ajax + Cliente Ajax + Archivar Seguro que quieres borrar Seguro que quieres revocar el permiso de usuario de chat de Seguro que quieres revocar el permiso de moderador de chat de Seguro que quieres no expulsar + �Vaciar autom�ticamente la sala de mensajes a medianoche? + Vacia autom�ticamente la sala a medianoche. S�lo se usar� si ha elegido la opci�n "Archivar". + Transcripci�n creada autom�ticamente + �Crear transcripci�n autom�ticamente antes de vaciar la sala? + Crea, de forma autom�tica, una transcripci�n antes de vaciar la sala. Expulsar Permiso de Expulsar para Expulsar usuario + Usuarios expulsados Chat P�gina principal de chat Confirmar el borrado de la transcripci�n del chat @@ -28,16 +38,23 @@ Error creando una sala nueva Crear sala Crear transcripci�n + Fecha de creaci�n + Conversaci�n en curso + fecha + Desactivar la sala una vez creada la transcripci�n Borrar todos los mensajes de la sala Borrar mensajes + Borrar mensajes despu�s de crear la transcripci�n Error borrando mensajes Borrar sala Error borrando sala Borrar transcripci�n Error borrando transcripci�n Descripci�n Editar + Editar sala Editar transcripci�n + Salir de la sala Acciones extremas de Asignar @@ -47,44 +64,60 @@ Asignar usuario ha entrado en la sala ha abandonado la sala + HTML HTML + Cliente HTML + Java Java + Javascript clave + �ltima actividad Salir + Mensaje + N�mero de mensajes mensajes en Moderada + Mensaje Nombre No hay informaci�n disponible + No activa + Refrescar quitar Revocar revocar Revocar moderador Revocar usuario Admin + Desactivar la sala Informaci�n de sala Moderadores de sala Nombre de la sala Sala no activa Sala no encontrada. Id de sala incorrecto Enviar/Actualizar + Enviando mensaje... No hay salas disponibles a + Transcripci�n Nombre de la transcripci�n + Transcripci�n del + Transcripci�n de los mensajes de la sala Previsualizaci�n de la transcripci�n + Transcripci�n de todos los mensajes Transcripciones + Transcripciones de la sala No autorizado Privilegio no autorizado No expulsar no expulsar No expulsar usuario Sin t�tulo Actualizar sala - Usuarios autorizados Usuarios expulsados Ver Ver transcrici�n por nombre o email o usuario limitado a - Si + <b>Atenci�n</b> El par�metro "DefaultClient" contiene "Ajax" pero el paquete xotcl-core no est� instalado. El chat Ajax no podr� funcionar sin xotcl-core. No tienes permiso para entrar en esta sala tu nombre es Index: openacs-4/packages/chat/java/adClientSession.java =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/java/Attic/adClientSession.java,v diff -u -r1.2 -r1.3 --- openacs-4/packages/chat/java/adClientSession.java 14 Mar 2006 12:16:08 -0000 1.2 +++ openacs-4/packages/chat/java/adClientSession.java 24 Jun 2006 14:23:40 -0000 1.3 @@ -105,7 +105,8 @@ datasource.addSession(this, room_id); datasource.broadcastAppletOnly(adChatSystemMessage.buildUserEnterMsg(user_id, user_name), room_id); - datasource.broadcast(adChatMessage.buildBroadcastMsg(user_id, user_name, room_id, " has entered the room."), room_id); + datasource.broadcastAppletOnly(adChatMessage.buildBroadcastMsg(user_id, user_name, room_id, " has entered the room!"), room_id); + datasource.broadcastAolOnly(adChatMessage.buildBroadcastMsg(user_id, user_name, room_id, "/enter"), room_id); authenticate_p = true; } } @@ -130,7 +131,14 @@ adChatMessage msg = new adChatMessage(str); str = adChatMessage.buildModerateMsg(msg.getFromUser(), msg.getRoomId(), msg.getBody()); } - datasource.broadcast(str, room_id); + + if (from_HTML_client) { + //System.out.println("BroadCasting to applets only!"); + datasource.broadcastAppletOnly(str, room_id); + } else { + //System.out.println("BroadCasting to all stations!"); + datasource.broadcast(str, room_id); + } } socket.close(); @@ -139,7 +147,8 @@ } // Remove user from room. And broadcast message to everyone in the room. datasource.removeSession(this, room_id); - datasource.broadcast(adChatMessage.buildBroadcastMsg(user_id, user_name, room_id, " has leave the room."), room_id); + datasource.broadcastAppletOnly(adChatMessage.buildBroadcastMsg(user_id, user_name, room_id, " has left the room!"), room_id); + datasource.broadcastAolOnly(adChatMessage.buildBroadcastMsg(user_id, user_name, room_id, "/leave"), room_id); } public void postMessage(String msg) { Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/lib/current-messages.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/lib/current-messages.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/lib/transcript-view.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/lib/transcript-view.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/lib/transcripts.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/lib/transcripts.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/lib/transcripts.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/chat/sql/oracle/chat-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/sql/oracle/chat-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/chat/sql/oracle/chat-create.sql 30 Sep 2003 12:10:05 -0000 1.2 +++ openacs-4/packages/chat/sql/oracle/chat-create.sql 24 Jun 2006 14:23:41 -0000 1.3 @@ -142,7 +142,13 @@ -- if set then log all chat messages in this room. archive_p char(1) default 'f' constraint chat_rooms_archive_p_ck - check (archive_p in ('t', 'f')) + check (archive_p in ('t', 'f')), + auto_flush_p char(1) default 't' + constraint chat_rooms_auto_flush_ck + check (auto_flush_p in ('t', 'f')), + auto_transcript_p char(1) default 'f' + constraint chat_rooms_auto_transcript_ck + check (auto_transcript_p in ('t', 'f')) ); declare @@ -237,6 +243,8 @@ moderated_p in chat_rooms.moderated_p%TYPE default 'f', active_p in chat_rooms.active_p%TYPE default 't', archive_p in chat_rooms.archive_p%TYPE default 'f', + auto_flush_p in chat_rooms.auto_flush_p%TYPE default 't', + auto_transcript_p in chat_rooms.auto_transcript_p%TYPE default 'f', context_id in acs_objects.context_id%TYPE default null, creation_date in acs_objects.creation_date%TYPE default sysdate, creation_user in acs_objects.creation_user%TYPE default null, @@ -254,7 +262,9 @@ description in chat_rooms.description%TYPE, moderated_p in chat_rooms.moderated_p%TYPE, active_p in chat_rooms.active_p%TYPE, - archive_p in chat_rooms.archive_p%TYPE + archive_p in chat_rooms.archive_p%TYPE, + auto_flush_p in chat_rooms.auto_flush_p%TYPE, + auto_transcript_p in chat_rooms.auto_transcript_p%TYPE ); function name ( @@ -329,6 +339,8 @@ moderated_p in chat_rooms.moderated_p%TYPE default 'f', active_p in chat_rooms.active_p%TYPE default 't', archive_p in chat_rooms.archive_p%TYPE default 'f', + auto_flush_p in chat_rooms.auto_flush_p%TYPE default 't', + auto_transcript_p in chat_rooms.auto_transcript_p%TYPE default 'f', context_id in acs_objects.context_id%TYPE default null, creation_date in acs_objects.creation_date%TYPE default sysdate, creation_user in acs_objects.creation_user%TYPE default null, @@ -339,27 +351,31 @@ v_room_id chat_rooms.room_id%TYPE; begin v_room_id := acs_object.new ( - object_type => object_type, - creation_date => creation_date, - creation_user => creation_user, - creation_ip => creation_ip, - context_id => context_id - ); + object_type => chat_room.new.object_type, + creation_date => chat_room.new.creation_date, + creation_user => chat_room.new.creation_user, + creation_ip => chat_room.new.creation_ip, + context_id => chat_room.new.context_id + ); insert into chat_rooms ( room_id, pretty_name, description, moderated_p, active_p, - archive_p) - values ( + archive_p, + auto_flush_p, + auto_transcript_p) + values ( v_room_id, - pretty_name, - description, - moderated_p, - active_p, - archive_p); + chat_room.new.pretty_name, + chat_room.new.description, + chat_room.new.moderated_p, + chat_room.new.active_p, + chat_room.new.archive_p, + chat_room.new.auto_flush_p, + chat_room.new.auto_transcript_p); return v_room_id; end new; @@ -387,7 +403,9 @@ description in chat_rooms.description%TYPE, moderated_p in chat_rooms.moderated_p%TYPE, active_p in chat_rooms.active_p%TYPE, - archive_p in chat_rooms.archive_p%TYPE + archive_p in chat_rooms.archive_p%TYPE, + auto_flush_p in chat_rooms.auto_flush_p%TYPE, + auto_transcript_p in chat_rooms.auto_transcript_p%TYPE ) is begin @@ -396,7 +414,9 @@ description = chat_room.edit.description, moderated_p = chat_room.edit.moderated_p, active_p = chat_room.edit.active_p, - archive_p = chat_room.edit.archive_p + archive_p = chat_room.edit.archive_p, + auto_flush_p = chat_room.edit.auto_flush_p, + auto_transcript_p = chat_room.edit.auto_transcript_p where room_id = chat_room.edit.room_id; end edit; @@ -490,7 +510,6 @@ / show errors - create or replace package body chat_transcript as function new ( Index: openacs-4/packages/chat/sql/oracle/chat-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/sql/oracle/chat-drop.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/chat/sql/oracle/chat-drop.sql 20 Apr 2001 20:51:08 -0000 1.1 +++ openacs-4/packages/chat/sql/oracle/chat-drop.sql 24 Jun 2006 14:23:41 -0000 1.2 @@ -54,6 +54,7 @@ acs_privilege.remove_child('chat_room_admin', 'chat_moderator_revoke'); acs_privilege.remove_child('chat_room_admin', 'chat_moderator'); + acs_privilege.remove_child('admin', 'chat_room_admin'); acs_privilege.drop_privilege('chat_room_create'); acs_privilege.drop_privilege('chat_room_view'); Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/sql/oracle/upgrade/upgrade-5.0d4-5.0d5.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/chat/sql/postgresql/chat-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/sql/postgresql/chat-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/chat/sql/postgresql/chat-create.sql 14 Mar 2006 12:16:09 -0000 1.1 +++ openacs-4/packages/chat/sql/postgresql/chat-create.sql 24 Jun 2006 14:23:41 -0000 1.2 @@ -201,13 +201,13 @@ check (active_p in ('t','f')), -- if set then log all chat messages in this room. archive_p boolean - default 'f' + default 't' constraint chat_rooms_archive_p_ck - check (archive_p in ('t', 'f')) - - - - + check (archive_p in ('t', 'f')), + -- flush the rooms messages every night at 00:05 + auto_flush_p boolean default 't', + -- automatically create a transcript after flushing the room + auto_transcript_p boolean default 'f' ); @@ -334,16 +334,15 @@ references parties(party_id) constraint chat_msgs_creation_user_nn not null, creation_ip varchar(50) , - creation_date date - constraint chat_msgs_creation_date_nn not null, + creation_date timestamptz, room_id integer constraint chat_msgs_room_id_fk references chat_rooms ); --------------------------------- -create function chat_room__new (integer, varchar, varchar, boolean, boolean, boolean, integer, timestamptz, integer, varchar, varchar) +create or replace function chat_room__new (integer, varchar, varchar, boolean, boolean, boolean, boolean, boolean, integer, timestamptz, integer, varchar, varchar) returns integer as ' declare p_room_id alias for $1; @@ -352,11 +351,13 @@ p_moderated_p alias for $4; p_active_p alias for $5; p_archive_p alias for $6; - p_context_id alias for $7; - p_creation_date alias for $8; - p_creation_user alias for $9; - p_creation_ip alias for $10; - p_object_type alias for $11; + p_auto_flush_p alias for $7; + p_auto_transcript_p alias for $8; + p_context_id alias for $9; + p_creation_date alias for $10; + p_creation_user alias for $11; + p_creation_ip alias for $12; + p_object_type alias for $13; v_room_id chat_rooms.room_id%TYPE; begin v_room_id := acs_object__new ( @@ -369,9 +370,9 @@ ); insert into chat_rooms - (room_id, pretty_name, description, moderated_p, active_p, archive_p) + (room_id, pretty_name, description, moderated_p, active_p, archive_p, auto_flush_p, auto_transcript_p) values - (v_room_id, p_pretty_name, p_description, p_moderated_p, p_active_p, p_archive_p); + (v_room_id, p_pretty_name, p_description, p_moderated_p, p_active_p, p_archive_p, p_auto_flush_p, p_auto_transcript_p); return v_room_id; @@ -507,7 +508,8 @@ end;' language 'plpgsql'; ---------------------------- -create function chat_room__edit (integer, varchar, varchar, boolean, boolean, boolean) + +create or replace function chat_room__edit (integer, varchar, varchar, boolean, boolean, boolean, boolean, boolean) returns integer as ' declare p_room_id alias for $1; @@ -516,14 +518,18 @@ p_moderated_p alias for $4; p_active_p alias for $5; p_archive_p alias for $6; + p_auto_flush_p alias for $7; + p_auto_transcript_p alias for $8; begin update chat_rooms set pretty_name = p_pretty_name, description = p_description, moderated_p = p_moderated_p, active_p = p_active_p, - archive_p = p_archive_p + archive_p = p_archive_p, + auto_flush_p = p_auto_flush_p, + auto_transcript_p = p_auto_transcript_p where room_id = p_room_id; return 0; Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/sql/postgresql/upgrade/upgrade-5.0d4-5.0d5.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/tcl/chat-ajax-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/chat/tcl/chat-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/tcl/chat-init.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/chat/tcl/chat-init.tcl 20 Apr 2001 20:51:08 -0000 1.1 +++ openacs-4/packages/chat/tcl/chat-init.tcl 24 Jun 2006 14:23:41 -0000 1.2 @@ -11,71 +11,5 @@ nsv_set chat server_started 0 +ad_schedule_proc -thread t -schedule_proc ns_schedule_daily [list 0 5] chat_flush_rooms - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Index: openacs-4/packages/chat/tcl/chat-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/tcl/Attic/chat-procs-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/chat/tcl/chat-procs-oracle.xql 14 Mar 2006 12:16:09 -0000 1.1 +++ openacs-4/packages/chat/tcl/chat-procs-oracle.xql 24 Jun 2006 14:23:41 -0000 1.2 @@ -121,7 +121,9 @@ description => :description, moderated_p => :moderated_p, active_p => :active_p, - archive_p => :archive_p + archive_p => :archive_p, + auto_flush_p => :auto_flush_p, + auto_transcript_p => :auto_transcript_p ); end; @@ -218,14 +220,10 @@ chat_transcript.edit( transcript_id => :transcript_id, pretty_name => :pretty_name, - contents => :empty_clob(), + contents => empty_clob(), description => :description); end; - - - - \ No newline at end of file Index: openacs-4/packages/chat/tcl/chat-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/tcl/Attic/chat-procs-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/chat/tcl/chat-procs-postgresql.xql 14 Mar 2006 12:16:09 -0000 1.1 +++ openacs-4/packages/chat/tcl/chat-procs-postgresql.xql 24 Jun 2006 14:23:41 -0000 1.2 @@ -10,6 +10,8 @@ :moderated_p, :active_p, :archive_p, + :auto_flush_p, + :auto_transcript_p, :context_id, now(), :creation_user, @@ -119,10 +121,12 @@ perform chat_room__edit ( :room_id, :pretty_name, - :description, + :description, :moderated_p, :active_p, - :archive_p + :archive_p, + :auto_flush_p, + :auto_transcript_p ); return 0; end; @@ -217,7 +221,5 @@ - - Index: openacs-4/packages/chat/tcl/chat-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/tcl/chat-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/chat/tcl/chat-procs.tcl 14 Mar 2006 12:16:09 -0000 1.5 +++ openacs-4/packages/chat/tcl/chat-procs.tcl 24 Jun 2006 14:23:41 -0000 1.6 @@ -9,7 +9,7 @@ ad_proc -private chat_start_server {} { Start Java chat server. } { - if [nsv_get chat server_started] { + if {[nsv_get chat server_started]} { return } ns_log notice "chat_start_server: Starting chat server" @@ -62,7 +62,7 @@ while { 1 } { # Wait until there is new message in queue. ns_mutex lock [nsv_get chat new_message] - if [nsv_exists chat html_message] { + if {[nsv_exists chat html_message]} { # Get message from queue. puts $w [nsv_get chat html_message] flush $w @@ -98,15 +98,33 @@ regexp "(.*)" $line match screen_name regexp "(.*)" $line match msg regexp "(.*)" $line match user_id - if ![nsv_exists chat_room $room_id] { + if {![nsv_exists chat_room $room_id]} { nsv_set chat_room $room_id {} } - - if [catch {chat_post_message_to_db -creation_user $user_id $room_id $msg} errmsg] { - ns_log error "chat_post_message_to_db: error: $errmsg" + ns_log Notice "YY Nachricht: $msg" + ::chat::Chat c1 -volatile -chat_id $room_id -user_id $user_id -session_id 0 + switch $msg { + "/enter" { + c1 login + set msg [_ xotcl-core.has_entered_the_room] + } + "/leave" { + c1 logout + set msg [_ xotcl-core.has_left_the_room] + } + default { + c1 add_msg -uid $user_id $msg + } } + chat_room_get -room_id $room_id -array room_info + if { $room_info(archive_p) eq "t" } { + if {[catch {chat_post_message_to_db -creation_user $user_id $room_id $msg} errmsg]} { + ns_log error "chat_post_message_to_db: error: $errmsg" + } + } + nsv_lappend chat_room $room_id $line } else { @@ -124,7 +142,7 @@ } { Log chat message to the database. } { - ns_log Notice $msg + # ns_log Notice $msg db_exec_plsql post_message {} } @@ -133,6 +151,8 @@ {-moderated_p f} {-active_p t} {-archive_p f} + {-auto_flush_p t} + {-auto_transcript_p f} {-context_id ""} {-creation_user ""} {-creation_ip ""} @@ -158,6 +178,8 @@ moderated_p active_p archive_p + auto_flush_p + auto_transcript_p } { Edit information on chat room. All information require. } { @@ -259,6 +281,8 @@ } { Explicit ban user from this chat room. } { + util_memoize_flush \ + "permission::permission_p_not_cached -party_id $party_id -object_id $room_id -privilege chat_ban" db_exec_plsql ban_user {} } @@ -269,6 +293,8 @@ } { unban user from this chat room. } { + util_memoize_flush \ + "permission::permission_p_not_cached -party_id $party_id -object_id $room_id -privilege chat_ban" db_exec_plsql ban_user {} } @@ -308,9 +334,10 @@ } { Return display name of this user to use in chat. } { + acs_user::get -user_id $user_id -array user + set name [expr {$user(screen_name) ne "" ? $user(screen_name) : $user(name)}] + return $name - return [db_exec_plsql get_chat_user_name {}] - } ad_proc -public chat_message_post { @@ -319,20 +346,32 @@ message moderator_p } { - Post message to the chat room and broadcast to all applet clients. Only use by HTML client. + Post message to the chat room and broadcast to all applet clients. Used by ajax + html. } { if {$moderator_p == "1" } { set status "approved" } else { set status "pending" } - set chat_msg "[chat_user_name $user_id]$user_id$room_id$message$status" - # Add message to queue. Notify thread responsible for broadcast message to applets. + set default_client [parameter::get -parameter "DefaultClient" -default "ajax"] - nsv_set chat html_message $chat_msg - ns_mutex unlock [nsv_get chat new_message] - + if {$default_client eq "java"} { + set chat_msg "[chat_user_name $user_id]$user_id$room_id$message$status" + # Add message to queue. Notify thread responsible for + # broadcast message to applets. + nsv_set chat html_message $chat_msg + ns_mutex unlock [nsv_get chat new_message] + } + + # do not write messages to the database if the room should not be archived + chat_room_get -room_id $room_id -array room_info + if { $room_info(archive_p) eq "f" } { return } + + # write message to the database + if {[catch {chat_post_message_to_db -creation_user $user_id $room_id $message} errmsg]} { + ns_log error "chat_post_message_to_db: error: $errmsg" + } } @@ -362,13 +401,13 @@ # The first time html client enter chat room, chat_room variable is not initialize correctly. # Therefore I just hard code the variable. - if ![nsv_exists chat_room $room_id] { + if {![nsv_exists chat_room $room_id]} { nsv_set chat_room $room_id [list "[chat_user_name $user_id]$room_id[_ chat.has_entered_the_room]approved"] } set user_name [chat_user_name $user_id] - upvar "$msgs:rowcount" counter + upvar "$msgs:rowcount" counter set chat_messages [nsv_get chat_room $room_id] @@ -378,14 +417,14 @@ set counter 0 #foreach msg $chat_messages - for { set i [expr $cnt - 1] } { $i >= 0 } { set i [expr $i - 1] } { + for { set i [expr {$cnt - 1}] } { $i >= 0 } { set i [expr {$i - 1}] } { set msg [lindex $chat_messages $i] regexp "(.*)" $msg match screen_name regexp "(.*)" $msg match chat_msg regexp "(.*)" $msg match status - if {$status == "pending" || $status == "rejected"} { + if {$status eq "pending" || $status eq "rejected"} { continue; } @@ -396,7 +435,7 @@ incr counter set array_val(rownum) $counter - if {$screen_name == $user_name && $chat_msg == "has entered the room."} { + if {$screen_name == $user_name && $chat_msg eq "has entered the room."} { return } } @@ -418,16 +457,10 @@ db_transaction { set transcript_id [db_exec_plsql create_transcript {}] - db_exec_plsql grant_permission {} -# -# db_dml transcript_content { -# update chat_transcripts -# set contents = empty_clob() -# where transcript_id = :transcript_id -# returning contents into :1 -# } -clobs [list $contents] -# } on_error { -# ad_return_complaint 1 "Insert fail: $errmsg" + if { $transcript_id ne 0 } { + db_dml update_contents {} + db_exec_plsql grant_permission {} + } } return $transcript_id @@ -450,26 +483,54 @@ } { Edit chat transcript. } { - db_transaction { - db_exec_plsql edit_transcript { + db_exec_plsql edit_transcript {} + db_dml update_contents {} +} - } - #db_dml transcript_content { - # update chat_transcripts - # set contents = empty_clob() - # where transcript_id = :transcript_id - # returning contents into :1 - #} -clobs [list $contents] - } - +ad_proc -public chat_room_get { + {-room_id {}} + {-array:required} +} { + Get all the information about a chat room into an array +} { + upvar $array row + array set row [util_memoize [list chat_room_get_not_cached $room_id]] } +ad_proc -private chat_room_get_not_cached { + room_id +} { + db_1row select_user_info {select * from chat_rooms where room_id = :room_id} -column_array row + return [array get row] +} +ad_proc -private chat_flush_rooms {} {Flush the messages in all of the chat rooms} { + # ns_log Notice "YY Starting chat_flush_rooms operation" + set room_ids [db_list get_rooms *SQL*] + foreach room_id $room_ids { + chat_room_flush $room_id + } +} +ad_proc -private chat_room_flush { room_id } {Flush the messages a single chat room} { + # ns_log Notice "YY flushing room $room_id" + db_transaction { + array set room_info [chat_room_get_not_cached $room_id] + set contents "" + # do we have to create a transcript for the room + if { $room_info(auto_transcript_p) eq "t" } { + # build a list of all messages + db_foreach get_archives_messages {} { + append contents "\[$creation_date\] [chat_user_name $creation_user]: $msg
\n" + } + if { $contents ne "" } { + chat_transcript_new \ + -description "#chat.automatically_created_transcript#" \ + "#chat.transcript_of_date# [clock format [clock seconds] -format "%d.%m.%Y"]" $contents $room_id + } + } + # clear all the messages in the room + chat_room_message_delete $room_id + } +} - - - - - - Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/tcl/chat-procs.xql'. 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/ajax-chat-script.adp'. 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/ajax-chat-script.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/chat-oracle.xql'. 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/chat-postgresql.xql'. 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/chat-transcript.adp'. 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/chat-transcript.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/chat-transcripts.adp'. 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/chat-transcripts.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/chat/www/chat.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/chat.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/chat/www/chat.tcl 14 Mar 2006 12:16:09 -0000 1.5 +++ openacs-4/packages/chat/www/chat.tcl 24 Jun 2006 14:23:42 -0000 1.6 @@ -1,14 +1,14 @@ #/chat/www/chat.tcl ad_page_contract { - Decide which template to use HTML or Java. + Decide which template to use HTML or AJAX. @author David Dao (ddao@arsdigita.com) @creation-date November 22, 2000 @cvs-id $Id$ } { room_id - client + {client "ajax"} {message:html ""} } -properties { context_bar:onevalue @@ -29,18 +29,16 @@ ad_return_complaint 1 "[_ chat.Room_not_found]" } -set context_bar [list $room_name] - +set context_bar $room_name +auth::require_login 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"] set moderate_room_p [chat_room_moderate_p $room_id] -if { $moderate_room_p == "t" } { - set moderator_p [ad_permission_p $room_id "chat_moderator"] +if { $moderate_room_p eq "t" } { + set moderator_p [permission::permission_p -object_id $room_id -privilege "chat_moderator"] } else { # This is an unmoderate room, therefore everyone is a moderator. set moderator_p "1" @@ -54,42 +52,37 @@ # Get chat screen name. set user_name [chat_user_name $user_id] -# Determine which template to use for html or java client -if {$client == "java"} { - set template_use "java-chat" - # Get config paramater for applet. - set width [ad_parameter AppletWidth "" 500] - set height [ad_parameter AppletHeight "" 400] - - set host [ad_parameter ServerHost "" [ns_config "ns/server/[ns_info server]/module/nssock" Hostname]] - set port [ad_parameter ServerPort "" 8200] -} else { - set template_use "html-chat" +# send message to the database +if { $message ne "" } { + chat_message_post $room_id $user_id $message $moderator_p +} - chat_message_retrieve msgs $room_id $user_id - - if { ![empty_string_p $message] } { - chat_message_post $room_id $user_id $message $moderator_p +# Determine which template to use for html or ajax client +switch $client { + "html" { + set template_use "html-chat" + # forward to ajax if necessary + if { $message ne "" } { + set session_id [ad_conn session_id] + ::chat::Chat c1 -volatile -chat_id $room_id -session_id $session_id + c1 add_msg $message + } } + "ajax" { + set template_use "ajax-chat-script" + } + "java" { + set template_use "java-chat" - - + # Get config paramater for applet. + set width [ad_parameter AppletWidth "" 500] + set height [ad_parameter AppletHeight "" 400] + + set host [ad_parameter ServerHost "" [ns_config "ns/server/[ns_info server]/module/nssock" Hostname]] + set port [ad_parameter ServerPort "" 8200] + } } ad_return_template $template_use - - - - - - - - - - - - - - Index: openacs-4/packages/chat/www/html-chat.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/html-chat.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/chat/www/html-chat.adp 14 Mar 2006 12:16:09 -0000 1.5 +++ openacs-4/packages/chat/www/html-chat.adp 24 Jun 2006 14:23:42 -0000 1.6 @@ -2,24 +2,39 @@ @context_bar;noquote@ @room_name;noquote@ -[#chat.Log_off#] -
-#chat.Chat#: + +

+#chat.Log_off# +#chat.Transcript# +@richclient.title@ +

+ +
+@html_chat;noquote@ + +
+ +
+ @html_users;noquote@
+
+ +

+ + +#chat.message#: +
-
    - - - -@user_name@: @message@
    -
    -
    - -@msgs.screen_name@: @msgs.chat_msg@
    -
    - -
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/www/html-chat.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/chat/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/index-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/chat/www/index-postgresql.xql 14 Mar 2006 12:16:09 -0000 1.1 +++ openacs-4/packages/chat/www/index-postgresql.xql 24 Jun 2006 14:23:42 -0000 1.2 @@ -19,8 +19,10 @@ from chat_rooms rm, acs_objects obj where rm.room_id = obj.object_id + and obj.context_id = :package_id order by rm.pretty_name + Index: openacs-4/packages/chat/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/index.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/chat/www/index.adp 14 Mar 2006 12:16:09 -0000 1.5 +++ openacs-4/packages/chat/www/index.adp 24 Jun 2006 14:23:42 -0000 1.6 @@ -6,46 +6,20 @@ @cvs-id $Id$ --> -@context_bar;noquote@ +#chat.Chat_main_page# #chat.Chat_main_page# - - - -[#chat.Create_a_new_room#] + +
+ @warning;noquote@ +
-

#chat.There_are_no_rooms_available# +

#chat.There_are_no_rooms_available#

+

#chat.Create_a_new_room#

- - - <% - set can_see 0 - if {($rooms(active_p) eq "t" && $rooms(user_p) eq "t") || ($rooms(admin_p) eq "t")} { - set can_see 1 - } - %> - - - - - - - - -
@rooms.pretty_name@ - [ HTML | java ] - - - [#chat.room_admin#] - - - (NO #chat.Active#) - - <% set desc [string range $rooms(description) 0 50] %> - - @desc@ -
+
+ Index: openacs-4/packages/chat/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/index.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/chat/www/index.tcl 14 Mar 2006 12:16:09 -0000 1.3 +++ openacs-4/packages/chat/www/index.tcl 24 Jun 2006 14:23:42 -0000 1.4 @@ -15,23 +15,80 @@ } set package_id [ad_conn package_id] - -set context_bar [list] - set user_id [ad_conn user_id] +set actions [list] +set room_create_p [permission::permission_p -object_id $package_id -privilege chat_room_create] +set default_client [parameter::get -parameter "DefaultClient" -default "ajax"] +set warning "" -set room_create_p [ad_permission_p $package_id chat_room_create] +if { $default_client eq "ajax" && ![apm_package_installed_p xotcl-core] } { + set warning "[_ chat.xotcl_missing]" +} +if { $room_create_p } { + lappend actions "#chat.Create_a_new_room#" room-edit "#chat.Create_a_new_room#" +} -db_multirow rooms rooms_list {} +db_multirow -extend { active_users last_activity } rooms rooms_list {} { + set room [::chat::Chat create new -volatile -chat_id $room_id] + set active_users [$room nr_active_users] + set last_activity [$room last_activity] +} +list::create \ + -name "rooms" \ + -multirow "rooms" \ + -key room_id \ + -pass_properties {room_create_p} \ + -actions $actions \ + -row_pretty_plural [_ chat.rooms] \ + -elements { + active { + label "#chat.Active#" + html { align "center" } + display_template { + +
+ +
+
+ +
+ +
+
+ } + } + pretty_name { + label "#chat.Room_name#" + html { width 400px } + display_template { + + @rooms.pretty_name@ \[#chat.HTML_chat#\] + + + @rooms.pretty_name@ + +
@rooms.description@
+ } + } + active_users { + label "#chat.active_users#" + html { style "text-align:center;" } + } + last_activity { + label "#chat.last_activity#" + html { style "text-align:center;" } + } + actions { + label "#chat.actions#" + display_template { + #chat.Transcripts# + + #chat.room_admin# + + } + } + } ad_return_template - - - - - - - - Index: openacs-4/packages/chat/www/message-delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/message-delete-2.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/chat/www/message-delete-2.tcl 14 Mar 2006 12:16:09 -0000 1.3 +++ openacs-4/packages/chat/www/message-delete-2.tcl 24 Jun 2006 14:23:42 -0000 1.4 @@ -9,11 +9,12 @@ room_id:integer,notnull } -ad_require_permission $room_id chat_room_delete +permission::require_permission -object_id $room_id -privilege chat_room_delete - if { [catch {chat_room_message_delete $room_id} errmsg] } { ad_return_complaint 1 "[_ chat.Delete_messages_failed]: $errmsg" } +::chat::Chat flush_messages -chat_id $room_id + ad_returnredirect . \ No newline at end of file Index: openacs-4/packages/chat/www/message-delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/message-delete.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/chat/www/message-delete.adp 14 Mar 2006 12:16:09 -0000 1.5 +++ openacs-4/packages/chat/www/message-delete.adp 24 Jun 2006 14:23:42 -0000 1.6 @@ -12,5 +12,5 @@
#chat.Are_you_sure_you_want_to_delete# @message_count@ #chat.messages_in# @pretty_name@? -

-

\ No newline at end of file +

+ 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 @@

#chat.Are_you_sure_you_want_to_delete# @pretty_name@? -

+

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 @@ - select party_id, acs_object.name(party_id) as name - from acs_object_party_privilege_map - where object_id = :room_id - and privilege = 'chat_ban' + select m.party_id, p.last_name || ', ' || p.first_names as name, pa.email + from acs_object_party_privilege_map m, persons p, parties pa + where m.party_id = p.person_id and m.object_id = :room_id + and m.privilege = 'chat_ban' and p.person_id = pa.party_id + order by p.last_name, p.first_names - - - - select transcript_id, pretty_name - from chat_transcripts - where room_id = :room_id - - - Index: openacs-4/packages/chat/www/room-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/room-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/chat/www/room-postgresql.xql 14 Mar 2006 12:16:09 -0000 1.1 +++ openacs-4/packages/chat/www/room-postgresql.xql 24 Jun 2006 14:23:42 -0000 1.2 @@ -20,25 +20,16 @@ - - select party_id, acs_object__name(party_id) as name - from acs_object_party_privilege_map - where object_id = :room_id - and privilege = 'chat_ban' + select m.party_id, p.last_name || ', ' || p.first_names as name, pa.email + from acs_object_party_privilege_map m, persons p, parties pa + where m.party_id = p.person_id and m.object_id = :room_id + and m.privilege = 'chat_ban' and p.person_id = pa.party_id + order by p.last_name, p.first_names - - - - select transcript_id, pretty_name - from chat_transcripts - where room_id = :room_id - - - Index: openacs-4/packages/chat/www/room.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/room.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/chat/www/room.adp 14 Mar 2006 12:16:09 -0000 1.5 +++ openacs-4/packages/chat/www/room.adp 24 Jun 2006 14:23:42 -0000 1.6 @@ -11,82 +11,59 @@

#chat.Room_Information#

-
    -
  • #chat.Room_name#: @pretty_name@ -
  • #chat.Description#:
    @description@
    - -
  • #chat.Active#: @active_p@ -
  • #chat.Archive#: @archive_p@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #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.Edit# +#acs-kernel.common_Permissions# -

+ +#chat.Delete_all_messages_in_the_room# +#chat.Delete_room# +

#chat.No_information_available#. -

#chat.Users_allow# -

-#chat.Users_ban# - - - - - - +

#chat.Transcripts# -

- -

#chat.Extreme_Actions# -

-
- Index: openacs-4/packages/chat/www/room.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/room.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/chat/www/room.tcl 14 Mar 2006 12:16:09 -0000 1.3 +++ openacs-4/packages/chat/www/room.tcl 24 Jun 2006 14:23:42 -0000 1.4 @@ -1,7 +1,6 @@ #/www/chat/room.tcl ad_page_contract { Display information about chat room. - @author David Dao (ddao@arsdigita.com) @creation-date November 15, 2000 @cvs-id $Id$ @@ -24,7 +23,6 @@ moderator_grant_p:onevalue moderator_revoke_p:onevalue transcript_create_p:onevalue - transcript_delete_p:onevalue transcript_edit_p:onevalue transcript_view_p:onevalue moderators:multirow @@ -35,68 +33,60 @@ set context_bar [list "[_ chat.Room_Information]"] - ### # Get all available permission of this user on this room. ### -set room_view_p [ad_permission_p $room_id chat_room_view] -set room_edit_p [ad_permission_p $room_id chat_room_edit] -set room_delete_p [ad_permission_p $room_id chat_room_delete] -set user_ban_p [ad_permission_p $room_id chat_user_ban] -set user_unban_p [ad_permission_p $room_id chat_user_unban] -set user_grant_p [ad_permission_p $room_id chat_user_grant] -set user_revoke_p [ad_permission_p $room_id chat_user_revoke] -set moderator_grant_p [ad_permission_p $room_id chat_moderator_grant] -set moderator_revoke_p [ad_permission_p $room_id chat_moderator_revoke] -set transcript_create_p [ad_permission_p $room_id chat_transcript_create] -set transcript_delete_p [ad_permission_p $room_id chat_transcript_delete] -set transcript_edit_p [ad_permission_p $room_id chat_transcript_edit] -set transcript_view_p [ad_permission_p $room_id chat_transcript_view] +set room_view_p [permission::permission_p -object_id $room_id -privilege chat_room_view] +set room_edit_p [permission::permission_p -object_id $room_id -privilege chat_room_edit] +set room_delete_p [permission::permission_p -object_id $room_id -privilege chat_room_delete] +set user_ban_p [permission::permission_p -object_id $room_id -privilege chat_user_ban] +set user_unban_p [permission::permission_p -object_id $room_id -privilege chat_user_unban] +set user_grant_p [permission::permission_p -object_id $room_id -privilege chat_user_grant] +set user_revoke_p [permission::permission_p -object_id $room_id -privilege chat_user_revoke] +set moderator_grant_p [permission::permission_p -object_id $room_id -privilege chat_moderator_grant] +set moderator_revoke_p [permission::permission_p -object_id $room_id -privilege chat_moderator_revoke] +set transcript_create_p [permission::permission_p -object_id $room_id -privilege chat_transcript_create] ### -# End geting all available permissions. -### - -### # Get room basic information. ### - - -#db_1row room_info { -# select pretty_name, description, decode(moderated_p, 't', 'Yes', 'No') as moderated_p, -# decode(archive_p, 't', 'Yes', 'No') as archive_p, -# decode(active_p, 't', 'Yes', 'No') as active_p -# from chat_rooms -# where room_id = :room_id -#} - db_1row room_info { - select pretty_name, description, moderated_p, active_p, archive_p + select pretty_name, description, moderated_p, active_p, archive_p, auto_flush_p, auto_transcript_p from chat_rooms where room_id = :room_id } -# List available room moderators. -db_multirow moderators list_moderators {} +# get db-message count +set message_count [db_string message_count "select count(*) from chat_msgs where room_id = :room_id" -default 0] -# List authorized chat users. -db_multirow users_allow list_user_allow {} - # List user ban from chat -db_multirow users_ban list_user_ban {} +db_multirow banned_users list_user_ban {} +list::create \ + -name "banned_users" \ + -multirow "banned_users" \ + -key party_id \ + -pass_properties { user_unban_p room_id } \ + -row_pretty_plural [_ chat.banned_users] \ + -elements { + name { + label "#chat.Name#" + } + email { + label "#acs-kernel.Email_Address#" + } + actions { + label "#chat.actions#" + html { align "center" } + display_template { + + + + + + } + } + } -# List available chat transcript -db_multirow chat_transcripts list_transcripts {} - ad_return_template - - - - - - - - - Index: openacs-4/packages/chat/www/search-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/search-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/chat/www/search-2.tcl 14 Mar 2006 12:16:09 -0000 1.1 +++ openacs-4/packages/chat/www/search-2.tcl 24 Jun 2006 14:23:42 -0000 1.2 @@ -23,31 +23,31 @@ # Check input. set exception_count 0 set exception_text "" -set SQL_LIMIT 10 +set SQL_LIMIT 20 set context [list [list "./" "Users"] "Search"] -if [info exists keyword] { +if {[info exists keyword]} { # this is an administrator - if { [empty_string_p $keyword] } { + if { $keyword eq "" } { incr exception_count append exception_text "
  • You forgot to type a search string!\n" } } else { # from one of the user pages - if { (![info exists email] || [empty_string_p $email]) && \ - (![info exists last_name] || [empty_string_p $last_name]) } { + if { (![info exists email] || $email eq "") && \ + (![info exists last_name] || $last_name eq "") } { incr exception_count append exception_text "
  • You must specify either an email address or last name to search for.\n" } if { [info exists email] && [info exists last_name] && \ - ![empty_string_p $email] && ![empty_string_p $last_name] } { + $email ne "" && $last_name ne "" } { incr exception_count append exception_text "
  • You can only specify either email or last name, not both.\n" } - if { ![info exists target] || [empty_string_p $target] } { + if { ![info exists target] || $target eq "" } { incr exception_count append exception_text "
  • Target was not specified. This shouldn't have happened, please contact the administrator @@ -68,7 +68,7 @@ set search_type "keyword" set sql_keyword "%[string tolower $keyword]%" lappend where_clause "(username like :sql_keyword or email like :sql_keyword or lower(first_names || ' ' || last_name) like :sql_keyword)" -} elseif { [info exists email] && ![empty_string_p $email] } { +} elseif { [info exists email] && $email ne "" } { set search_type "email" set sql_email "%[string tolower $email]%" lappend where_clause "email like :sql_email" @@ -97,7 +97,8 @@ } else { set query "select username, user_id, email_verified_p, first_names, last_name, email, member_state from cc_users -where [join $where_clause "\nand "]" +where [join $where_clause "\nand "] +limit $SQL_LIMIT" } set i 0 @@ -123,7 +124,7 @@ set user_search:[set rowcount](member_state) $member_state - if { $member_state != "approved" } { + if { $member_state ne "approved" } { set user_search:[set rowcount](user_finite_state_links) [join [ad_registration_finite_state_machine_admin_links $member_state $email_verified_p $user_id_from_search "search?[export_url_vars email last_name keyword target passthrough limit_users_in_group_id only_authorized_p]"] " | "] } else { set user_search:[set rowcount](user_finite_state_links) "" Index: openacs-4/packages/chat/www/search-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/search-3.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/chat/www/search-3.tcl 14 Mar 2006 12:16:09 -0000 1.1 +++ openacs-4/packages/chat/www/search-3.tcl 24 Jun 2006 14:23:42 -0000 1.2 @@ -6,7 +6,7 @@ party_id:integer,notnull } -if {[string equal $type "user"] == 1} { +if {$type eq "user"} { ad_require_permission $room_id chat_user_grant chat_user_grant $room_id $party_id } else { Index: openacs-4/packages/chat/www/search.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/search.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/chat/www/search.adp 14 Mar 2006 12:16:09 -0000 1.1 +++ openacs-4/packages/chat/www/search.adp 24 Jun 2006 14:23:42 -0000 1.2 @@ -7,6 +7,6 @@ - + Index: openacs-4/packages/chat/www/transcript-delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/transcript-delete.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/chat/www/transcript-delete.adp 14 Mar 2006 12:16:09 -0000 1.5 +++ openacs-4/packages/chat/www/transcript-delete.adp 24 Jun 2006 14:23:42 -0000 1.6 @@ -10,8 +10,8 @@ #chat.Confirm_chat_transcript_delete#
    - - + + #chat.Are_you_sure_you_want_to_delete# Replace with transcript name? -

    -

    \ No newline at end of file +

    + 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 @@

    - - - -
    #chat.Transcript_name#: + + + + - - + + + + + + + + + + + + - - - + - - - +
    #chat.Transcript_name# +
    #chat.Description# :
    #chat.Delete_messages# +
    + [i] + #chat.delete_messages_after_transcript# +
    +
    #chat.Room_deactivate# +
    + [i] + #chat.deactivate_room_after_transcript# +
    +
    #chat.Description#
    #chat.Contents#: +
    #chat.Contents# +
    @contents;noquote@
    +
    Index: openacs-4/packages/chat/www/transcript-new-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/transcript-new-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/chat/www/transcript-new-2.tcl 20 Apr 2001 20:51:08 -0000 1.1 +++ openacs-4/packages/chat/www/transcript-new-2.tcl 24 Jun 2006 14:23:42 -0000 1.2 @@ -5,27 +5,34 @@ room_id:integer,notnull transcript_name:trim,notnull {description:trim ""} + {delete_messages:optional "off"} + {deactivate_room:optional "off"} contents:trim,notnull,html } -ad_require_permission $room_id chat_transcript_create +permission::require_permission -object_id $room_id -privilege chat_transcript_create set package_id [ad_conn package_id] set user_id [ad_conn user_id] set creation_ip [ad_conn peeraddr] +set transcript_id [chat_transcript_new \ + -description $description \ + -context_id $package_id \ + -creation_user $user_id \ + -creation_ip $creation_ip \ + $transcript_name $contents $room_id +] -set transcript_id [chat_transcript_new -description $description \ - -context_id $package_id \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - $transcript_name $contents $room_id] +if { $delete_messages eq "on" } { + chat_room_message_delete $room_id + # forward the information to AJAX + ::chat::Chat flush_messages -chat_id $room_id +} +if { $deactivate_room eq "on" } { + db_dml "update_chat" "update chat_rooms set active_p = 'f' where room_id = $room_id" +} -ad_returnredirect "transcript-view?room_id=$room_id&transcript_id=$transcript_id" +ad_returnredirect "chat-transcript?room_id=$room_id&transcript_id=$transcript_id" - - - - - Index: openacs-4/packages/chat/www/transcript-new-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/transcript-new-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/chat/www/transcript-new-oracle.xql 14 Mar 2006 12:16:09 -0000 1.1 +++ openacs-4/packages/chat/www/transcript-new-oracle.xql 24 Jun 2006 14:23:42 -0000 1.2 @@ -5,13 +5,12 @@ - select msg, person.name(creation_user) as name + select msg, creation_user, to_char(creation_date, 'DD.MM.YYYY hh24:mi:ss') as creation_date from chat_msgs where room_id = :room_id and msg is not null - order by msg_id + order by creation_date - Index: openacs-4/packages/chat/www/transcript-new-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/transcript-new-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/chat/www/transcript-new-postgresql.xql 14 Mar 2006 12:16:09 -0000 1.1 +++ openacs-4/packages/chat/www/transcript-new-postgresql.xql 24 Jun 2006 14:23:42 -0000 1.2 @@ -4,11 +4,11 @@ - select msg, person__name(creation_user) as name + select msg, creation_user, to_char(creation_date, 'DD.MM.YYYY hh24:mi:ss') as creation_date from chat_msgs where room_id = :room_id and msg is not null - order by msg_id + order by creation_date Index: openacs-4/packages/chat/www/transcript-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/transcript-new.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/chat/www/transcript-new.tcl 14 Mar 2006 12:16:09 -0000 1.3 +++ openacs-4/packages/chat/www/transcript-new.tcl 24 Jun 2006 14:23:42 -0000 1.4 @@ -14,29 +14,23 @@ contents:onevalue } -ad_require_permission $room_id chat_transcript_create +permission::require_permission -object_id $room_id -privilege chat_transcript_create set context_bar [list [list "room?room_id=$room_id" "[_ chat.Room_Information]"] "[_ chat.Create_transcript]"] set transcript_id "" -set transcript_name "[_ chat.Untitled]" +set transcript_name "[_ chat.transcript_of_date] [clock format [clock seconds] -format "%d.%m.%y %H:%M:%S"]" set description "" set contents "" set action "transcript-new-2" set title "[_ chat.Create_transcript]" set submit_label "[_ chat.Create_transcript]" +set active_p [room_active_status $room_id] #Build a list of all message. db_foreach get_archives_messages {} { - append contents "$name: $msg
    \n" + append contents "\[$creation_date\] [chat_user_name $creation_user]: $msg
    \n" } ad_return_template "transcript-entry" - - - - - - - Index: openacs-4/packages/chat/www/transcript-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/transcript-view.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/chat/www/transcript-view.adp 14 Mar 2006 12:16:09 -0000 1.5 +++ openacs-4/packages/chat/www/transcript-view.adp 24 Jun 2006 14:23:42 -0000 1.6 @@ -11,9 +11,13 @@ [#chat.Edit#]
      -
    • #chat.Name#: @transcript_name@
    • -
    • #chat.Description#: @description@
    • -
    • #chat.Contents#:

      @contents@

    • +
    • #chat.Name#: @transcript_name@ +
    • #chat.Description#: @description@ + + +
        +

        @contents;noquote@

      +
    Index: openacs-4/packages/chat/www/user-ban-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/user-ban-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/chat/www/user-ban-2.tcl 20 Apr 2001 20:51:08 -0000 1.1 +++ openacs-4/packages/chat/www/user-ban-2.tcl 24 Jun 2006 14:23:42 -0000 1.2 @@ -11,7 +11,7 @@ party_id:integer,notnull } -ad_require_permission $room_id chat_user_ban +permission::require_permission -object_id $room_id -privilege chat_user_ban chat_user_ban $room_id $party_id Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/chat/www/user-grant-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/chat/www/user-grant-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/chat/www/user-grant-postgresql.xql'. 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/user-grant.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/chat/www/user-revoke-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/chat/www/user-revoke-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/chat/www/user-revoke-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.6 refers to a dead (removed) revision in file `openacs-4/packages/chat/www/user-revoke.adp'. 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/user-revoke.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/ajax/chat.js'. 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/ajax/chat.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/chat/www/resources/active.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/resources/active.png,v diff -u -r1.1 -r1.2 Binary files differ Index: openacs-4/packages/chat/www/resources/admin.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/resources/admin.gif,v diff -u -r1.1 -r1.2 Binary files differ Index: openacs-4/packages/chat/www/resources/inactive.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/resources/inactive.png,v diff -u -r1.1 -r1.2 Binary files differ