diff --git a/docs/upgrades/upgrade_6.8.8-6.99.0.pl b/docs/upgrades/upgrade_6.8.8-6.99.0.pl index db1f4bc45..b3e2a68c0 100644 --- a/docs/upgrades/upgrade_6.8.8-6.99.0.pl +++ b/docs/upgrades/upgrade_6.8.8-6.99.0.pl @@ -183,6 +183,14 @@ sub updateCs { $session->db->write("alter table Post_read drop column postId"); $session->db->write("alter table Post_read drop column readDate"); $session->db->write("alter table Post_read rename Thread_read"); + print "\t\tAdding email to discussion support.\n"; + $session->db->write("alter table Collaboration add column mailServer varchar(255)"); + $session->db->write("alter table Collaboration add column mailAccount varchar(255)"); + $session->db->write("alter table Collaboration add column mailPassword varchar(255)"); + $session->db->write("alter table Collaboration add column mailAddress varchar(255)"); + $session->db->write("alter table Collaboration add column mailPrefix varchar(255)"); + $session->db->write("alter table Collaboration add column getMail int not null 0"); + $session->db->write("alter table Collaboration add column getMailInterval int not null default 300"); } #------------------------------------------------- diff --git a/lib/WebGUI/Asset/Post.pm b/lib/WebGUI/Asset/Post.pm index db2967209..ba7db2263 100644 --- a/lib/WebGUI/Asset/Post.pm +++ b/lib/WebGUI/Asset/Post.pm @@ -633,13 +633,15 @@ sub notifySubscribers { groupId=>$self->getThread->getParent->get("subscriptionGroupId"), status=>"completed", subject=>$self->getThread->getParent->get("mailPrefix").$self->get("subject"), - message=>$message + message=>$message, + messageId=>"cs-".$self->getId }); $inbox->addMessage({ groupId=>$self->getThread->get("subscriptionGroupId"), status=>"completed", subject=>$self->getThread->getParent->get("mailPrefix").$self->get("subject"), - message=>$message + message=>$message, + messageId=>"cs-".$self->getId }); } diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm index 2b1ac6f57..3ae573a6a 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm @@ -261,6 +261,30 @@ sub definition { fieldType=>"workflow", defaultValue=>"pbworkflow000000000003" }, + mailServer=>{ + fieldType=>"text", + defaultValue=>undef + }, + mailAccount=>{ + fieldType=>"text", + defaultValue=>undef + }, + mailPassword=>{ + fieldType=>"password", + defaultValue=>undef + }, + mailAddress=>{ + fieldType=>"email", + defaultValue=>undef + }, + getMail=>{ + fieldType=>"yesNo", + defaultValue=>0 + }, + getMailInterval=>{ + fieldType=>"interval", + defaultValue=>300 + }, displayLastReply =>{ fieldType=>"yesNo", defaultValue=>0 @@ -419,6 +443,43 @@ sub getEditForm { my $self = shift; my $tabform = $self->SUPER::getEditForm; my $i18n = WebGUI::International->new($self->session,"Asset_Collaboration"); + $tabform->addTab("mail",$i18n->get("mail"), 9); + $tabform->getTab("mail")->yesNo( + name=>"getMail", + value=>$self->getValue("getMail"), + label=>$i18n->get("get mail"), + hoverHelp=>$i18n->get("get mail help"), + ); + $tabform->getTab("mail")->text( + name=>"mailServer", + value=>$self->getValue("mailServer"), + label=>$i18n->get("mail server"), + hoverHelp=>$i18n->get("mail server help"), + ); + $tabform->getTab("mail")->text( + name=>"mailAccount", + value=>$self->getValue("mailAccount"), + label=>$i18n->get("mail account"), + hoverHelp=>$i18n->get("mail account help"), + ); + $tabform->getTab("mail")->password( + name=>"mailPassword", + value=>$self->getValue("mailPassword"), + label=>$i18n->get("mail password"), + hoverHelp=>$i18n->get("mail password help"), + ); + $tabform->getTab("mail")->email( + name=>"mailAddress", + value=>$self->getValue("mailAddress"), + label=>$i18n->get("mail address"), + hoverHelp=>$i18n->get("mail address help"), + ); + $tabform->getTab("mail")->interval( + name=>"getMailInterval", + value=>$self->getValue("getMailInterval"), + label=>$i18n->get("get mail interval"), + hoverHelp=>$i18n->get("get mail interval help"), + ); $tabform->getTab("display")->interval( -name=>"visitorCacheTimeout", -label=>$i18n->get('visitor cache timeout'), diff --git a/lib/WebGUI/Workflow/Activity/GetCsMail.pm b/lib/WebGUI/Workflow/Activity/GetCsMail.pm index 8a834ec5c..1d2e2472d 100644 --- a/lib/WebGUI/Workflow/Activity/GetCsMail.pm +++ b/lib/WebGUI/Workflow/Activity/GetCsMail.pm @@ -163,7 +163,7 @@ sub execute { } my $post = undef; if ($message->{inReplyTo}) { - $message->{inReplyTo} =~ m/WebGUI\-([\w_-]{22})/; + $message->{inReplyTo} =~ m/cs\-([\w_-]{22})/; my $id = $1; $post = WebGUI::Asset->newByDynamicClass($self->session, $id); } diff --git a/lib/WebGUI/i18n/English/Asset_Collaboration.pm b/lib/WebGUI/i18n/English/Asset_Collaboration.pm index b95317d4b..825add1fb 100644 --- a/lib/WebGUI/i18n/English/Asset_Collaboration.pm +++ b/lib/WebGUI/i18n/English/Asset_Collaboration.pm @@ -2,6 +2,84 @@ package WebGUI::i18n::English::Asset_Collaboration; our $I18N = { + 'get mail interval' => { + message => q|Check Mail Every|, + lastUpdated => 0, + context => q|field label for mail setting| + }, + + 'get mail interval help' => { + message => q|How often should we check for mail on the server?|, + lastUpdated => 0, + context => q|help for mail setting field label| + }, + + 'mail password' => { + message => q|Password|, + lastUpdated => 0, + context => q|field label for mail setting| + }, + + 'mail password help' => { + message => q|The password of the account to log in to the server with.|, + lastUpdated => 0, + context => q|help for mail setting field label| + }, + + 'mail address' => { + message => q|Address|, + lastUpdated => 0, + context => q|field label for mail setting| + }, + + 'mail address help' => { + message => q|The email address that users can send messages to in order to post messages.|, + lastUpdated => 0, + context => q|help for mail setting field label| + }, + + 'mail account' => { + message => q|Account|, + lastUpdated => 0, + context => q|field label for mail setting| + }, + + 'mail account help' => { + message => q|The account name (username / email address) to use to log in to the mail server.|, + lastUpdated => 0, + context => q|help for mail setting field label| + }, + + 'mail server' => { + message => q|Server|, + lastUpdated => 0, + context => q|field label for mail setting| + }, + + 'mail server help' => { + message => q|The hostname or IP address of the mail server to fetch mail from.|, + lastUpdated => 0, + context => q|help for mail setting field label| + }, + + 'get mail' => { + message => q|Get mail?|, + lastUpdated => 0, + context => q|field label for mail setting| + }, + + 'get mail help' => { + message => q|Do you want to have this Collaboration System fetch posts from an email account?|, + lastUpdated => 0, + context => q|help for mail setting field label| + }, + + 'mail' => { + message => q|Mail|, + lastUpdated => 0, + context => q|the name of the email settings tab| + }, + 'rejected' => { message => q|Rejected|, lastUpdated => 0,