Index: openacs-4/packages/contacts/sql/postgresql/contacts-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/sql/postgresql/contacts-create.sql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/contacts/sql/postgresql/contacts-create.sql 7 Jul 2005 18:51:57 -0000 1.7 +++ openacs-4/packages/contacts/sql/postgresql/contacts-create.sql 28 Jul 2005 13:41:50 -0000 1.8 @@ -95,16 +95,6 @@ unique(party_id,title,signature) ); -create table contact_mailings ( - mailing_id integer - constraint contact_mailings_id_pk primary key, - title varchar(255) - constraint contact_mailings_title_nn not null, - mailing varchar(1000) - constraint contact_mailings_mailing_nn not null - unique(party_id,title,mailing) -); - -- this view greatly simplifies getting available roles for various contact types create view contact_rel_types as ( select rel_type, Index: openacs-4/packages/contacts/sql/postgresql/contacts-messages-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/sql/postgresql/contacts-messages-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/contacts/sql/postgresql/contacts-messages-create.sql 1 Jul 2005 00:31:01 -0000 1.2 +++ openacs-4/packages/contacts/sql/postgresql/contacts-messages-create.sql 28 Jul 2005 13:41:50 -0000 1.3 @@ -14,6 +14,8 @@ ); insert into contact_message_types (message_type,pretty_name) values ('email','#contacts.Email#'); insert into contact_message_types (message_type,pretty_name) values ('letter','#contacts.Letter#'); +insert into contact_message_types (message_type,pretty_name) values ('header','#contacts.Header#'); +insert into contact_message_types (message_type,pretty_name) values ('footer','#contacts.Footer#'); create table contact_message_items ( @@ -25,13 +27,16 @@ constraint contact_message_items_owner_id_nn not null, message_type varchar(20) constraint contact_message_items_message_type_fk references contact_message_types(message_type) - constraint contact_message_items_message_type_nn not null + constraint contact_message_items_message_type_nn not null, + locale varchar(30) + constraint contact_message_items_locale_fk references ad_locales(locale) ); create view contact_messages as select cmi.item_id, cmi.owner_id, cmi.message_type, + cmi.locale, cr.title, cr.description, cr.content, Index: openacs-4/packages/contacts/sql/postgresql/upgrade/upgrade-1.0d4-1.0d5.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/sql/postgresql/upgrade/upgrade-1.0d4-1.0d5.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/contacts/sql/postgresql/upgrade/upgrade-1.0d4-1.0d5.sql 28 Jul 2005 13:41:50 -0000 1.1 @@ -0,0 +1,28 @@ +-- +-- packages/contacts/sql/postgresql/upgrade/upgrade-1.0d4-1.0d5.sql +-- +-- @author Malte Sussdorff (sussdorff@sussdorff.de) +-- @creation-date 2005-07-28 +-- @arch-tag: c6a87521-0c9d-45b8-8f3f-852d262c8af0 +-- @cvs-id $Id: upgrade-1.0d4-1.0d5.sql,v 1.1 2005/07/28 13:41:50 maltes Exp $ +-- + +alter table contact_message_items add column locale varchar(30); +insert into contact_message_types (message_type,pretty_name) values ('header','#contacts.Header#'); +insert into contact_message_types (message_type,pretty_name) values ('footer','#contacts.Footer#'); + +drop view contact_messages; +create or replace view contact_messages as + select cmi.item_id, + cmi.owner_id, + cmi.message_type, + cmi.locale, + cr.title, + cr.description, + cr.content, + cr.mime_type as content_format + from contact_message_items cmi, cr_items ci, cr_revisions cr + where cmi.item_id = cr.item_id + and ci.publish_status not in ( 'expired' ) + and ci.live_revision = cr.revision_id +; \ No newline at end of file Index: openacs-4/packages/contacts/www/message-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/message-ae.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts/www/message-ae.tcl 1 Jul 2005 00:38:43 -0000 1.1 +++ openacs-4/packages/contacts/www/message-ae.tcl 28 Jul 2005 13:41:50 -0000 1.2 @@ -54,6 +54,7 @@ {message_type:text(hidden)} {return_url:text(hidden)} {title:text(text) {label "[_ contacts.Title]"} {html {size 45 maxlength 1000}} {help_text "[_ contacts.lt_Title_is_not_shown_in_the_message]"}} + {locale:text(select) {label "[_ acs-lang.Locale]"} {options [lang::util::get_locale_options]}} } switch $message_type { @@ -68,6 +69,17 @@ {content:richtext(richtext) {label "[_ contacts.Message]"} {html {cols 70 rows 24}}} } } + header { + append form_elements { + {content:richtext(richtext) {label "[_ contacts.Header]"} {html {cols 70 rows 24}}} + } + } + footer { + append form_elements { + {content:richtext(richtext) {label "[_ contacts.Header]"} {html {cols 70 rows 24}}} + } + } + } ad_form -name "rel_type" \ @@ -77,16 +89,17 @@ -on_request { } -new_request { set owner_id [ad_conn user_id] + set locale [lang::system::locale] } -edit_request { db_1row get_data { select * from contact_messages where item_id = :item_id } - if { $message_type == "letter" } { + if { $message_type != "email" } { set content [list $content $content_format] } - + } -on_submit { - if { $message_type == "letter" } { + if { $message_type != "email" } { set content_format [template::util::richtext::get_property format $content] set content [template::util::richtext::get_property content $content] set description "" @@ -101,7 +114,8 @@ -title $title \ -description $description \ -content $content \ - -content_format $content_format + -content_format $content_format \ + -locale $locale } -after_submit { ad_returnredirect $return_url Index: openacs-4/packages/contacts/www/messages.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/messages.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts/www/messages.tcl 30 Jun 2005 00:07:49 -0000 1.1 +++ openacs-4/packages/contacts/www/messages.tcl 28 Jul 2005 13:41:50 -0000 1.2 @@ -37,20 +37,23 @@ -key item_id \ -elements { type_pretty { - label {#contacts.Type#} + label {#acs-kernel.common_Type#} display_col type_pretty } - title { - label {#contacts.Title#} + title { + label {#acs-kernel.common_Title#} display_col title - link_url_eval $message_url + link_url_eval $message_url } + locale { + label {#acs-lang.Locale#} + } action { label "" display_template { - #contacts.Copy# + #acs-kernel.common_Copy# - #contacts.Delete# + #acs-kernel.common_Delete# #contacts.Make_Public# Index: openacs-4/packages/contacts/www/messages.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/messages.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts/www/messages.xql 30 Jun 2005 00:07:49 -0000 1.1 +++ openacs-4/packages/contacts/www/messages.xql 28 Jul 2005 13:41:50 -0000 1.2 @@ -23,7 +23,8 @@ title, description, content, - content_format + content_format, + locale from contact_messages where owner_id = :owner_id order by message_type, upper(title)