diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 32005e526..a4a5beac5 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -29,8 +29,10 @@ otherwise be slow or complex pages. More details in migration.txt. - The SMTP mail backend has been replaced with a new API that's capable of sending attachments, HTML messages, and more. This will introduce many new - - Added a mail queue system. options for developers. + - Replaced the old Message Log system with a new Inbox system that's more + reliable, and scalable. + - Added a mail queue system. - The group mail screen now allows sending of HTML messages. - Added prequery statements to the SQLReport and configurable allowed statements to the database link properties. (Martin Kamerbeek / Procolix) diff --git a/docs/migration.txt b/docs/migration.txt index 20151597d..38c3d621b 100644 --- a/docs/migration.txt +++ b/docs/migration.txt @@ -886,6 +886,13 @@ messages, and to multiple recipients, unlike WebGUI::Mail. Please see the API for details. +5.25 WebGUI::MessageLog Replaced + +IN 6.99 the venerable WebGUI::MessageLog has been retired and replaced with +WebGUI::Inbox, which has an object oriented API, is more resource efficient, +is more flexible, is more reliable, and is compliant with the new mail system. + + 6. Automatic list of Assets in Help System. ------------------------------------- diff --git a/docs/upgrades/templates-6.99.0/inbox.tmpl b/docs/upgrades/templates-6.99.0/inbox.tmpl new file mode 100644 index 000000000..4a9531049 --- /dev/null +++ b/docs/upgrades/templates-6.99.0/inbox.tmpl @@ -0,0 +1,53 @@ +#PBtmpl0000000000000206 +#create +#namespace:Inbox +#url:default_inbox +#title:Default Inbox +#menuTitle:Default Inbox +
|
+ |
+
+ |
+
+ |
+
|
+ |
+ + + | ++ + | +
|
+ |
+
+ |
+
+ |
+
{message} =~ s/\n/\
/g;
+ }
+ unless ($data->{message} =~ /\{message} =~ s/(http\S*)\s/\$1\<\/a\>/g;
+ }
+ $vars->{'message'} = $data->{message};
+ }
+ $vars->{'accountOptions'} = WebGUI::Operation::Shared::accountOptions($session);
+ return $session->style->userStyle(WebGUI::Asset::Template->new($session,"PBtmpl0000000000000205")->process($vars));
+}
+
+1;
diff --git a/lib/WebGUI/Operation/MessageLog.pm b/lib/WebGUI/Operation/MessageLog.pm
deleted file mode 100644
index 629e4af1b..000000000
--- a/lib/WebGUI/Operation/MessageLog.pm
+++ /dev/null
@@ -1,129 +0,0 @@
-package WebGUI::Operation::MessageLog;
-
-#-------------------------------------------------------------------
-# WebGUI is Copyright 2001-2006 Plain Black Corporation.
-#-------------------------------------------------------------------
-# Please read the legal notices (docs/legal.txt) and the license
-# (docs/license.txt) that came with this distribution before using
-# this software.
-#-------------------------------------------------------------------
-# http://www.plainblack.com info@plainblack.com
-#-------------------------------------------------------------------
-
-use strict qw(vars subs);
-use URI;
-use WebGUI::International;
-use WebGUI::Paginator;
-use WebGUI::SQL;
-use WebGUI::Asset::Template;
-use WebGUI::User;
-use WebGUI::Utility;
-use WebGUI::Operation::Shared;
-
-=head1 NAME
-
-Package WebGUI::Operation::MessageLog
-
-=head1 DESCRIPTION
-
-Operations for viewing message logs and individual messages.
-
-=cut
-
-#-------------------------------------------------------------------
-
-=head2 _status ( )
-
-returns a hashref with internationalized values for message status.
-
-=cut
-
-sub _status {
- my $session = shift;
- my $i18n = WebGUI::International->new($session);
- return {"notice"=>$i18n->get(551),"pending"=>$i18n->get(552),"completed"=>$i18n->get(350)};
-}
-
-#-------------------------------------------------------------------
-
-=head2 www_viewMessageLog ( )
-
-Templated display all messages for the current user.
-
-=cut
-
-sub www_viewMessageLog {
- my $session = shift;
- my (@msg, $vars);
- return $session->privilege->insufficient() unless ($session->user->isInGroup(2));
- my $i18n = WebGUI::International->new($session);
- $vars->{displayTitle} = ''.$i18n->get(159).'
';
- my $p = WebGUI::Paginator->new($session,$session->url->page('op=viewMessageLog'));
- my $query = "select messageLogId,subject,url,dateOfEntry,status from messageLog where userId=".$session->db->quote($session->user->userId)." order by dateOfEntry desc";
- $p->setDataByQuery($query);
-
- $vars->{'message.subject.label'} = $i18n->get(351);
- $vars->{'message.status.label'} = $i18n->get(553);
- $vars->{'message.dateOfEntry.label'} = $i18n->get(352);
-
- my $messages = $p->getPageData;
- foreach my $message (@$messages) {
- my $hash;
- $hash->{'message.subject'} = ''.$message->{subject}.'';
- my $status = _status($session)->{$message->{status}};
- $status = ''.$status.'' if ($message->{url} ne "");
- $hash->{'message.status'} = $status;
- $hash->{'message.dateOfEntry'} =$session->datetime->epochToHuman($message->{dateOfEntry});
- push(@msg,$hash);
- }
- $vars->{'message.loop'} = \@msg;
- $vars->{'message.noresults'} = $i18n->get(353) unless (scalar(@$messages) > 0);
-
- $vars->{'message.firstPage'} = $p->getFirstPageLink;
- $vars->{'message.lastPage'} = $p->getLastPageLink;
- $vars->{'message.nextPage'} = $p->getNextPageLink;
- $vars->{'message.pageList'} = $p->getPageLinks;
- $vars->{'message.previousPage'} = $p->getPreviousPageLink;
- $vars->{'message.multiplePages'} = ($p->getNumberOfPages > 1);
- $vars->{'message.accountOptions'} = WebGUI::Operation::Shared::accountOptions($session);
-
- return $session->style->userStyle(WebGUI::Asset::Template->new($session,"PBtmpl0000000000000050")->process($vars));
-}
-
-#-------------------------------------------------------------------
-
-=head2 www_viewMessageLog ( )
-
-Templated display of a single message for the user.
-
-=cut
-
-sub www_viewMessageLogMessage {
- my $session = shift;
- my ($data, $vars);
- return $session->privilege->insufficient() unless ($session->user->isInGroup(2));
- my $i18n = WebGUI::International->new($session);
- $vars->{displayTitle} = '
/ig) {
- $data->{message} =~ s/\n/\
/g;
- }
-
- $vars->{'message.text'} = $data->{message};
- $vars->{'message.accountOptions'} = WebGUI::Operation::Shared::accountOptions($session);
- return $session->style->userStyle(WebGUI::Asset::Template->new($session,"PBtmpl0000000000000049")->process($vars));
-}
-
-1;
diff --git a/lib/WebGUI/Operation/Shared.pm b/lib/WebGUI/Operation/Shared.pm
index df3824021..f43e55cb5 100644
--- a/lib/WebGUI/Operation/Shared.pm
+++ b/lib/WebGUI/Operation/Shared.pm
@@ -59,9 +59,9 @@ is in group Admin (3). Returns the user to the List Database Links screen.
$hash{'options.display'} = ''.$i18n->get(343).'';
push(@array,\%hash);
}
- unless ($session->form->process("op") eq "viewMessageLog"){
+ unless ($session->form->process("op") eq "viewInbox"){
my %hash;
- $hash{'options.display'} = ''.$i18n->get(354).'';
+ $hash{'options.display'} = ''.$i18n->get(354).'';
push(@array,\%hash);
}
unless ($session->form->process("op") eq "redeemSubscriptionCode") {
diff --git a/lib/WebGUI/i18n/English/WebGUI.pm b/lib/WebGUI/i18n/English/WebGUI.pm
index fe32bb732..276e32966 100644
--- a/lib/WebGUI/i18n/English/WebGUI.pm
+++ b/lib/WebGUI/i18n/English/WebGUI.pm
@@ -884,11 +884,6 @@ to add or remove users from their groups.
lastUpdated => 1031514049
},
- '519' => {
- message => q|I would not like to be notified.|,
- lastUpdated => 1031514049
- },
-
'1074' => {
message => q|Style templates are a special kind of template in WebGUI. They allow you to keep your content separated from the look and feel of your site. The following are the template variables available in style templates:
@@ -1537,11 +1532,6 @@ As with any delete operation, you are prompted to be sure you wish to proceed wi
lastUpdated => 1100154599
},
- '520' => {
- message => q|I would like to be notified via email.|,
- lastUpdated => 1031514049
- },
-
'1004' => {
message => q|Cache external groups for how long?|,
lastUpdated => 1057208065
@@ -2054,11 +2044,6 @@ You can find out more about karma in