Index: openacs-4/packages/chat/tcl/chat-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/tcl/chat-procs-postgresql.xql,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/chat/tcl/chat-procs-postgresql.xql 24 Jun 2007 15:21:19 -0000 1.5
+++ openacs-4/packages/chat/tcl/chat-procs-postgresql.xql 19 Nov 2007 01:14:16 -0000 1.6
@@ -3,165 +3,26 @@
postgresql7.1
- select chat_room__new (
+ select chat_room__new (
+ NULL,
:pretty_name,
- :alias,
:description,
- :key_words,
- :maxP,
- timestamp :end_date,
- boolean :Rss_service,
- boolean :Mail_service,
- boolean :moderated_p,
- boolean :active_p,
- boolean :archive_p,
- integer :context_id,
- varchar :comm_name,
- integer :creation_user,
- varchar :creation_ip,
- varchar 'chat_room',
- varchar :frequency1,
- varchar :frequency2
+ :moderated_p,
+ :active_p,
+ :archive_p,
+ :auto_flush_p,
+ :auto_transcript_p,
+ :context_id,
+ now(),
+ :creation_user,
+ :creation_ip,
+ 'chat_room'
)
-
-
- select chat_room__insert_keywords (
- :word,
- :room_id
- )
-
-
-
-
- select chat_room__insert_keywords (
- :word,
- :room_id
- )
-
-
-
-
- select chat_room__private_new (
- varchar :pretty_name,
- varchar :alias,
- varchar :description,
- varchar :key_words,
- integer :maxP,
- timestamp :end_date,
- boolean :Rss_service,
- boolean :Mail_service,
- boolean :moderated_p,
- boolean :active_p,
- boolean :archive_p,
- integer :context_id,
- varchar :comm_name,
- integer :creation_user,
- varchar :creation_ip,
- varchar 'chat_room',
- boolean :private
- )
-
-
-
-
-
- select '$from' as from_addr,
- '$sender_first_names' as sender_first_names,
- '$sender_last_name' as sender_last_name,
- parties.email as email
- from dotlrn_member_rels_full,parties
- where dotlrn_member_rels_full.community_id = '2267'
- and parties.party_id = dotlrn_member_rels_full.user_id
-
-
-
-
-
- select '$from' as from_addr,
- '$sender_first_names' as sender_first_names,
- '$sender_last_name' as sender_last_name,
- parties.email as email
- from dotlrn_member_rels_full,parties
- where dotlrn_member_rels_full.community_id = '$community_id'
- and parties.party_id = dotlrn_member_rels_full.user_id
- and parties.party_id = '$user_id'
-
-
-
-
-
-
-
- select '$from' as from_addr,
- '$sender_first_names' as sender_first_names,
- '$sender_last_name' as sender_last_name,
- parties.email,
- CASE
- WHEN
- acs_objects.object_type = 'user'
- THEN
- (select first_names
- from persons
- where person_id = parties.party_id)
- WHEN
- acs_objects.object_type = 'group'
- THEN
- (select group_name
- from groups
- where group_id = parties.party_id)
- WHEN
- acs_objects.object_type = 'rel_segment'
- THEN
- (select segment_name
- from rel_segments
- where segment_id = parties.party_id)
- ELSE
- ''
- END as first_names,
- CASE
- WHEN
- acs_objects.object_type = 'user'
- THEN
- (select last_name
- from persons
- where person_id = parties.party_id)
- ELSE
- ''
- END as last_name,
- '$safe_community_name' as community_name,
- '$community_url' as community_url
- from acs_rels,
- parties,
- acs_objects
- where (acs_rels.object_id_one = $community_id
- and acs_rels.object_id_two = parties.party_id
- and parties.party_id = acs_objects.object_id
- and parties.party_id in (select acs_rels.object_id_two
- from acs_rels, membership_rels
- where acs_rels.object_id_one = acs__magic_object_id('registered_users')
- and acs_rels.rel_id = membership_rels.rel_id
- and membership_rels.member_state = 'approved' ))
- $who_will_receive_this_clause
-
-
-
-
-
- select parties.email as sender_email,
- persons.first_names as sender_first_names,
- persons.last_name as sender_last_name
- from parties,
- persons
- where parties.party_id = :sender_id
- and persons.person_id = :sender_id
-
-
-
-- Automatic grant room privilege to creator of the room (must not be null).
@@ -251,61 +112,39 @@
return 0;
end;
-
+
+
- begin
+ begin
perform chat_room__edit (
+ :room_id,
:pretty_name,
- :alias,
:description,
- :key_words,
- :maxP,
- :end_date,
- :Rss_service,
- :Mail_service,
:moderated_p,
:active_p,
- :archive_p,
- :user_id,
- :room_id,
- :frequency1,
- :frequency_mail
+ :archive_p,
+ :auto_flush_p,
+ :auto_transcript_p
);
return 0;
end;
-
-
- select chat_room__edit_admin (
- :alias,
- :Rss_service,
- :Mail_service,
- :context_id,
- :user_id,
- :creation_ip,
- :room_id,
- :frequency_mail
- )
-
-
-
select chat_room__message_count(:room_id);
-
-
+
- begin
- perform chat_room__delete_registered_users(:room_id,:user_id);
+ begin
+ perform chat_room__delete_all_msgs(:room_id);
return 0;
end;
@@ -382,164 +221,5 @@
-
-
-
- select chat_room__store_transcripts_keywords (
- :word,
- :transcript_id
- )
-
-
-
-
-
-
- select chat_room_registered__user (
- varchar :alias,
- integer :user_id,
- integer :room_id,
- boolean :RSS_service,
- boolean :mail_service,
- integer :context_id,
- varchar :creation_ip,
- varchar :frequency_mail
- )
-
-
-
-
-
-
- select chat_room__send_files (
- integer :chat_id,
- varchar :file,
- varchar :title,
- varchar :description,
- date :date,
- integer :context_id,
- integer :creation_user,
- varchar :creation_ip,
- integer :send_file_id
- )
-
-
-
-
-
- begin
- perform chat_room__send_files_message (:chat_id);
- return 0;
- end;
-
-
-
-
-
-
- select max(o.last_modified) as last_updated
- from acs_objects o, chat_rooms cr
- where cr.context_id=:package_id
- and o.object_id=cr.room_id
-
-
-
-
-
- select cr.room_id as item_id,
- cr.pretty_name as title,
- to_char(o.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified
- from chat_rooms cr,
- acs_objects o
- where cr.context_id=:package_id
- and o.object_id = cr.room_id
- and cr.room_id=:summary_context_id
- order by o.last_modified desc
- limit $limit
-
-
-
-
-
-
-
- select chat_rss__store_db (
- varchar :room_name,
- varchar :room_description,
- date :end_date,
- varchar :r_creator,
- varchar :comm_name,
- varchar :registered_users,
- timestamp :entry_timestamp
- );
-
-
-
-
-
-
- select chat_rss__store_partitipants_rss (
- :rss_id,
- :partitipant
- );
-
-
-
-
-
- select chat_transcript__store_partitipants_transcript (
- :transcript_id,
- :partitipant
- );
-
-
-
-
-
- select chat_rss__store_sent_files_rss (
- :rss_id,
- :send_file_id
- );
-
-
-
-
-
- select chat_transcript__store_sent_files_tanscript (
- :transcript_id,
- :f_id
- );
-
-
-
-
-
- select chat_rss__store_keywords_rss (
- :rss_id,
- :key
- );
-
-
-
-
-
-
- select chat_rss__store_transcripts_rss (
- :rss_id,
- :transcription_id
- );
-
-
-
-
-
-
- select fs.send_file_id as f_id
- from chat_files_sent fs
- where room_id = :room_id
- and date >= :time
-
-
-