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.3 -r1.4
--- openacs-4/packages/chat/tcl/chat-procs-postgresql.xql 26 Oct 2006 11:11:20 -0000 1.3
+++ openacs-4/packages/chat/tcl/chat-procs-postgresql.xql 7 Jun 2007 09:14:24 -0000 1.4
@@ -16,16 +16,152 @@
boolean :active_p,
boolean :archive_p,
integer :context_id,
+ integer :comm_id,
+ integer :creation_user,
+ varchar :creation_ip,
+ varchar 'chat_room',
+ varchar :frequency1,
+ varchar :frequency2
+ )
+
+
+
+
+
+ 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,
integer :comm_id,
integer :creation_user,
varchar :creation_ip,
- varchar 'chat_room'
+ 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).
@@ -119,7 +255,7 @@
- begin
+ begin
perform chat_room__edit (
:pretty_name,
:alias,
@@ -131,16 +267,33 @@
:Mail_service,
:moderated_p,
:active_p,
- :archive_p,
- :user_id,
- :room_id
+ :archive_p,
+ :user_id,
+ :room_id,
+ :frequency1,
+ :frequency_mail
);
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);
@@ -229,6 +382,17 @@
+
+
+
+ select chat_room__store_transcripts_keywords (
+ :word,
+ :transcript_id
+ )
+
+
+
+
select chat_room_registered__user (
@@ -238,12 +402,144 @@
boolean :RSS_service,
boolean :mail_service,
integer :context_id,
- varchar :creation_ip
+ 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
+
+
+