Added Newsletter Asset (Funded by United Knowledge)

This commit is contained in:
JT Smith 2007-06-16 19:33:12 +00:00
parent 245c7b947e
commit 9248570f79
16 changed files with 1295 additions and 149 deletions

View file

@ -0,0 +1,90 @@
#PBtmpl0000000000000029
<a name="id<tmpl_var assetId>" id="id<tmpl_var assetId>"></a>
<tmpl_if preview.title>
<p><b><tmpl_var preview.title></b></p>
</tmpl_if>
<tmpl_if preview.content>
<p><tmpl_var preview.content></p>
</tmpl_if>
<h2><tmpl_var message.header.label></h2>
<tmpl_var form.header>
<table class="defaultPostForm">
<tmpl_if isNewPost>
<tmpl_if user.isVisitor>
<tr>
<td><tmpl_var visitorName.label></td>
<td><tmpl_var visitorName.form></td>
</tr>
</tmpl_if>
</tmpl_if>
<tr>
<td><tmpl_var subject.label></td>
<td><tmpl_var title.form></td>
</tr>
<tr>
<td><tmpl_var message.label></td>
<td><tmpl_var content.form></td>
</tr>
<tmpl_unless isReply>
<tmpl_loop meta_loop>
<tr>
<td><tmpl_var name></td>
<td><tmpl_var field></td>
</tr>
</tmpl_loop>
</tmpl_unless>
<tmpl_if attachment.form>
<tr>
<td><tmpl_var attachment.label></td>
<td><tmpl_var attachment.form></td>
</tr>
</tmpl_if>
<tmpl_if isNewPost>
<tmpl_unless user.isVisitor>
<tr>
<td><tmpl_var subscribe.label></td>
<td><tmpl_var subscribe.form></td>
</tr>
</tmpl_unless>
<tmpl_if isNewThread>
<tmpl_if user.isModerator>
<tr>
<td><tmpl_var lock.label></td>
<td><tmpl_var lock.form></td>
</tr>
<tr>
<td><tmpl_var stick.label></td>
<td><tmpl_var sticky.form></td>
</tr>
</tmpl_if>
</tmpl_if>
</tmpl_if>
<tr>
<td></td>
<td><tmpl_if usePreview><tmpl_var form.preview></tmpl_if><tmpl_var form.submit></td>
</tr>
</table>
<tmpl_var form.footer>
<tmpl_if isReply>
<p><b><tmpl_var reply.title></b></p>
<tmpl_var reply.content>
</tmpl_if>
~~~
<style type="text/css">
table.defaultPostForm td
{
font-family:arial;
font-size:9pt;
}
h2
{
font-family:arial;
}
</style>

View file

@ -0,0 +1,103 @@
#PBtmpl0000000000000068
<a name="id<tmpl_var assetId>" id="id<tmpl_var assetId>"></a>
<tmpl_if preview.title><p><b><tmpl_var preview.title></b></p></tmpl_if>
<tmpl_unless isReply><tmpl_if preview.synopsis><p><i><tmpl_var preview.synopsis></i></p></tmpl_if></tmpl_unless>
<tmpl_if preview.content><p><tmpl_var preview.content></p></tmpl_if>
<tmpl_if isReply>
<h1><tmpl_var message.header.label></h1>
<tmpl_else>
<h1><tmpl_var submission.header.label></h1>
</tmpl_if>
<tmpl_var form.header>
<table class="defaultSubmissionForm">
<tmpl_if isNewPost>
<tmpl_if user.isVisitor>
<tr>
<td><tmpl_var visitorName.label></td>
<td><tmpl_var visitorName.form></td>
</tr>
</tmpl_if>
</tmpl_if>
<tr>
<td><tmpl_var title.label></td>
<td><tmpl_var title.form></td>
</tr>
<tmpl_unless isReply>
<tr>
<td><tmpl_var synopsis.label></td>
<td><tmpl_var synopsis.form></td>
</tr>
</tmpl_unless>
<tr>
<td><tmpl_var body.label></td>
<td><tmpl_var content.form></td>
</tr>
<tmpl_unless isReply>
<tmpl_loop meta_loop>
<tr>
<td><tmpl_var name></td>
<td><tmpl_var field></td>
</tr>
</tmpl_loop>
<tmpl_if attachment.form>
<tr>
<td><tmpl_var attachment.label></td>
<td><tmpl_var attachment.form></td>
</tr>
</tmpl_if>
</tmpl_unless>
<tmpl_if isNewPost>
<tmpl_unless user.isVisitor>
<tr>
<td><tmpl_var subscribe.label></td>
<td><tmpl_var subscribe.form></td>
</tr>
</tmpl_unless>
<tmpl_if isNewThread>
<tmpl_if user.isModerator>
<tr>
<td><tmpl_var lock.label></td>
<td><tmpl_var lock.form></td>
</tr>
<tr>
<td><tmpl_var stick.label></td>
<td><tmpl_var sticky.form></td>
</tr>
</tmpl_if>
</tmpl_if>
</tmpl_if>
<tr>
<td></td>
<td><tmpl_if usePreview><tmpl_var form.preview></tmpl_if><tmpl_var form.submit></td>
</tr>
</table>
<tmpl_var form.footer>
<tmpl_if isReply>
<div class="defaultSubmissionFormContent">
<b><tmpl_var reply.title></b><br /><br />
<tmpl_var reply.content>
</div>
</tmpl_if>
~~~
<style type="text/css">
table.defaultSubmissionForm td
{
font-family:arial;
font-size:9pt;
}
.defaultSubmissionFormContent
{
font-family:arial;
font-size:9pt;
}
h2
{
font-family:arial;
}
</style>

View file

@ -0,0 +1,18 @@
#newsletter000000000001
#url: newsletterdefaulttemplate
#title: Summary Newsletter (default)
#menuTitle: Summary Newsletter
#namespace:newsletter
#create
<p><tmpl_var header></p>
<tmpl_loop thread_loop>
<p>
<a href="<tmpl_var url>"><tmpl_var title></a><br />
<p><tmpl_var synopsis></p>
</p>
</tmpl_loop>
<p><tmpl_var footer></p>

View file

@ -0,0 +1,67 @@
#newslettercs0000000001
#url: newslettercstemplate
#title: Newsletter Manager (default)
#menuTitle: Newsletter Manager
#namespace:Collaboration
#create
<a name="id<tmpl_var assetId>" id="id<tmpl_var assetId>"></a>
<tmpl_if session.var.adminOn>
<p><tmpl_var controls></p>
</tmpl_if>
<tmpl_if displayTitle>
<h2><tmpl_var title></h2>
</tmpl_if>
<tmpl_if description>
<tmpl_var description>
</tmpl_if>
<p class="pagination">
<tmpl_if user.canPost>
<a href="<tmpl_var add.url>"><tmpl_var add.label></a>
|
</tmpl_if>
<tmpl_unless user.isVisitor>
<a href="<tmpl_var mySubscriptionsUrl>">^International("my subscriptions","Asset_Newsletter");</a>
|
</tmpl_unless>
<a href="<tmpl_var search.url>"><tmpl_var search.label></a>
</p>
<p />
<tmpl_loop post_loop>
<p><b><a href="<tmpl_var url>"><tmpl_var title></a></b><br />
<tmpl_var synopsis></p>
</tmpl_loop>
<tmpl_if pagination.pageCount.isMultiple>
<div class="pagination">
<tmpl_var pagination.previousPage> &bull; <tmpl_var pagination.pageList.upTo10> &bull; <tmpl_var pagination.nextPage>
</div>
</tmpl_if>
~~~
<style type="text/css">
.pagination {
-moz-box-sizing:border-box;
background:#676767;
color:#C0C0C0;
width:100%;
text-align:right;
padding:3px;
font-size:9pt;
font-family:arial;
}
.pagination a {
color:white;
font-size:8pt;
text-decoration:underline;
}
.pagination a:hover {
text-decoration:none;
}
</style>

View file

@ -0,0 +1,22 @@
#newslettersubscrip0001
#url: newslettermysubscriptionstemplate
#title: My Subscriptions (default)
#menuTitle: My Subscriptions
#namespace:newsletter/mysubscriptions
#create
<h1>^International("my subscriptions","Asset_Newsletter");</h1>
<tmpl_var formHeader>
<h2>^International("newsletter categories","Asset_Newsletter");</h2>
<tmpl_loop categoriesLoop>
<p><b><tmpl_var categoryName></b><br />
<blockquote>
<tmpl_loop optionsLoop>
<label><tmpl_var optionForm> <tmpl_var optionName></label><br />
</tmpl_loop>
</blockquote></p>
</tmpl_loop>
<tmpl_var formSubmit>
<tmpl_var formFooter>

View file

@ -28,10 +28,41 @@ addAttachmentsToEvents($session);
addMetaDataPostsToCS($session);
addUserInvitations($session);
addPrivateMessaging($session);
addNewsletter($session);
finish($session); # this line required
#-------------------------------------------------
sub addNewsletter {
my $session = shift;
print "\tAdding a newsletter management system.\n" unless ($quiet);
$session->config->addToArray("assets","WebGUI::Asset::Wobject::Collaboration::Newsletter");
my $db = $session->db;
$db->write("create table Newsletter (
assetId varchar(22) binary not null,
revisionDate bigint not null,
newsletterTemplateId varchar(22) binary not null default 'newsletter000000000001',
mySubscriptionsTemplateId varchar(22) binary not null default 'newslettersubscrip0001',
newsletterHeader mediumtext,
newsletterFooter mediumtext,
newsletterCategories text,
primary key (assetId, revisionDate)
)");
$db->write("create table Newsletter_subscriptions (
assetId varchar(22) binary not null,
userId varchar(22) binary not null,
subscriptions text,
lastTimeSent bigint not null default 0,
primary key (assetId, userId)
)");
$db->write("alter table Newsletter_subscriptions add index lastTimeSent_assetId_userId
(lastTimeSent,assetId,userId)");
my $workflow = WebGUI::Workflow->new($session, "pbworkflow000000000002");
my $activity = $workflow->addActivity("WebGUI::Workflow::Activity::SendNewsletters","newslettersendactivity");
$activity->set("title","Send Newsletters For Newsletter Assets");
}
#-------------------------------------------------
sub addRealtimeWorkflow {
my $session = shift;