replaced MessageLog with Inbox

This commit is contained in:
JT Smith 2006-03-21 22:44:31 +00:00
parent d63ea20c9e
commit b6ad963119
18 changed files with 345 additions and 440 deletions

View file

@ -0,0 +1,53 @@
#PBtmpl0000000000000206
#create
#namespace:Inbox
#url:default_inbox
#title:Default Inbox
#menuTitle:Default Inbox
<h1><tmpl_var title></h1>
<table width="100%" cellspacing="1" cellpadding="2" border="0">
<tr>
<td class="tableHeader">
<tmpl_var subject.label>
</td>
<td class="tableHeader">
<tmpl_var status.label>
</td>
<td class="tableHeader">
<tmpl_var dateStamp.label>
</td>
</tr>
<tmpl_if message.noresults>
<tr>
<td class="tableData">
<tmpl_var noresults>
</td>
<td class="tableData">
&nbsp;
</td>
<td class="tableData">
&nbsp;
</td>
</tr>
<tmpl_else>
<tmpl_loop messages>
<tr>
<td class="tableData">
<tmpl_var subject>
</td>
<td class="tableData">
<tmpl_var status>
</td>
<td class="tableData">
<tmpl_var dateStamp>
</td>
</tr>
</tmpl_loop>
</tmpl_if>
</table>
<ul class="accountOptions">
<tmpl_loop accountOptions>
<li><tmpl_var options.display>
</tmpl_loop>
</ul>

View file

@ -0,0 +1,20 @@
#PBtmpl0000000000000205
#create
#namespace:Inbox/Message
#url:default_inbox_message
#title:Default Inbox Message
#menuTitle:Default Inbox Message
<h1><tmpl_var title></h1>
<b><tmpl_var subject></b><br />
<tmpl_var dateStamp><br />
<tmpl_var status><br /><br />
<p> <tmpl_var message></p>
<div class="accountOptions">
<ul>
<tmpl_loop accountOptions>
<li><tmpl_var options.display></li>
</tmpl_loop>
</ul>
</div>

View file

@ -25,6 +25,7 @@ my $quiet; # this line required
my $session = start(); # this line required
addWorkflow();
convertMessageLogToInbox();
templateParsers();
removeFiles();
addSearchEngine();
@ -41,6 +42,48 @@ updateHelpTemplate();
finish($session); # this line required
#-------------------------------------------------
sub convertMessageLogToInbox {
print "\tConverting message log to inbox.\n";
$session->db->write("create table inbox (
messageId varchar(22) binary not null primary key,
status varchar(15) not null default 'pending',
dateStamp bigint not null,
completedOn bigint,
completedBy varchar(22) binary,
userId varchar(22) binary,
groupId varchar(22) binary,
subject varchar(256) not null default 'No Subject',
message mediumtext
)");
$session->db->write("alter table Matrix_listing add column approvalMessageId varchar(22) binary");
my $prepared = $session->db->prepare("insert into inbox (messageId, status, dateStamp, completedOn, completedBy, userId, subject, message)
values ( ?,?,?,?,?,?,?,? )");
my $rs = $session->db->read("select * from messageLog");
while (my $data = $rs->hashRef) {
$prepared->execute([
$session->id->generate,
'completed',
$data->{dateOfEntry},
time(),
'3',
$data->{userId},
$data->{subject},
$data->{message}
]);
}
$session->db->write("delete from userProfileField where fieldname='INBOXNotifications'");
$session->db->write("delete from userProfileData where fieldname='INBOXNotifications'");
$session->db->write("drop table MessageLog");
$rs = $session->db->read("select distinct assetId from template where namespace='Operation/MessageLog/View' or namespace='Operation/MessageLog/Message'");
while (my ($id) = $rs->array) {
my $asset = WebGUI::Asset->new($session, $id, "WebGUI::Asset::Template");
if (defined $asset) {
$asset->trash;
}
}
}
#-------------------------------------------------
sub addCsPopularityContest {
print "\tAdding collaboration system popularity system based upon karma.\n";
@ -669,6 +712,8 @@ sub templateParsers {
#-------------------------------------------------
sub removeFiles {
print "\tRemoving old unneeded files.\n" unless ($quiet);
unlink '../../lib/WebGUI/MessageLog.pm';
unlink '../../lib/WebGUI/Operation/MessageLog.pm';
unlink '../../lib/WebGUI/ErrorHandler.pm';
unlink '../../lib/WebGUI/HTTP.pm';
unlink '../../lib/WebGUI/Privilege.pm';