Skip to content

Commit d4d661b

Browse files
authored
Merge pull request #1250 from DNNCommunity/dev
Syncing branches
2 parents cdc9c5d + b298c7b commit d4d661b

File tree

16 files changed

+608
-242
lines changed

16 files changed

+608
-242
lines changed

Dnn.CommunityForums/08.02.02.txt

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
DesktopModules/ActiveForums/themes/community-default/templates/AdminWatchEmail.ascx
2+
DesktopModules/ActiveForums/themes/community-default/templates/ModAlert.ascx
3+
DesktopModules/ActiveForums/themes/community-default/templates/PostApproved.ascx
4+
DesktopModules/ActiveForums/themes/community-default/templates/PostDeleted.ascx
5+
DesktopModules/ActiveForums/themes/community-default/templates/PostMoved.ascx
6+
DesktopModules/ActiveForums/themes/community-default/templates/PostPending.ascx
7+
DesktopModules/ActiveForums/themes/community-default/templates/PostRejected.ascx
8+
DesktopModules/ActiveForums/themes/community-default/templates/ReplyEditor.ascx
9+
DesktopModules/ActiveForums/themes/community-default/templates/SubscribedEmail.ascx
10+
DesktopModules/ActiveForums/themes/community-default/templates/Toolbar.ascx
11+
DesktopModules/ActiveForums/themes/community-bootstrap/templates/AdminWatchEmail.ascx
12+
DesktopModules/ActiveForums/themes/community-bootstrap/templates/ModAlert.ascx
13+
DesktopModules/ActiveForums/themes/community-bootstrap/templates/PostApproved.ascx
14+
DesktopModules/ActiveForums/themes/community-bootstrap/templates/PostDeleted.ascx
15+
DesktopModules/ActiveForums/themes/community-bootstrap/templates/PostMoved.ascx
16+
DesktopModules/ActiveForums/themes/community-bootstrap/templates/PostPending.ascx
17+
DesktopModules/ActiveForums/themes/community-bootstrap/templates/PostRejected.ascx
18+
DesktopModules/ActiveForums/themes/community-bootstrap/templates/ReplyEditor.ascx
19+
DesktopModules/ActiveForums/themes/community-bootstrap/templates/SubscribedEmail.ascx
20+
DesktopModules/ActiveForums/themes/community-bootstrap/templates/Toolbar.ascx

Dnn.CommunityForums/Controllers/TopicController.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public static int Save(DotNetNuke.Modules.ActiveForums.Entities.TopicInfo ti)
272272
{
273273
// TODO: put this in a better place and make it consistent with reply counter
274274
DotNetNuke.Modules.ActiveForums.Controllers.ForumUserController.UpdateUserTopicCount(ti.Forum.PortalId, ti.Author.AuthorId);
275-
}
275+
}
276276

277277
DotNetNuke.Modules.ActiveForums.Controllers.ForumUserController.ClearCache(ti.Forum.PortalId, ti.Content.AuthorId);
278278
Utilities.UpdateModuleLastContentModifiedOnDate(ti.ModuleId);
@@ -293,7 +293,7 @@ public static int Save(DotNetNuke.Modules.ActiveForums.Entities.TopicInfo ti)
293293

294294
public void DeleteById(int topicId)
295295
{
296-
DotNetNuke.Modules.ActiveForums.Entities.TopicInfo ti = base.GetById(topicId);
296+
DotNetNuke.Modules.ActiveForums.Entities.TopicInfo ti = this.GetById(topicId);
297297
if (ti != null)
298298
{
299299
new Social().DeleteJournalItemForPost(ti.PortalId, ti.ForumId, topicId, 0);

Dnn.CommunityForums/CustomControls/UserControls/TopicView.cs

+49-28
Original file line numberDiff line numberDiff line change
@@ -288,30 +288,53 @@ private void LoadData(int pageId)
288288
this.isTrusted = Utilities.IsTrusted((int)this.ForumInfo.FeatureSettings.DefaultTrustValue, this.ForumUser.TrustLevel, DotNetNuke.Modules.ActiveForums.Controllers.PermissionController.HasPerm(this.ForumInfo.Security.Trust, this.ForumUser.UserRoles));
289289

290290
// TODO: Eventually this will use DAL2 to load from stored procedure into object model, but for now populate topic object model from stored procedure results
291-
this.topic = new DotNetNuke.Modules.ActiveForums.Entities.TopicInfo();
292-
this.topic.Content = new DotNetNuke.Modules.ActiveForums.Entities.ContentInfo();
293-
this.topic.TopicId = this.TopicId;
294-
this.topic.ModuleId = this.ForumModuleId;
295-
this.topic.PortalId = this.PortalId;
296-
this.topic.IsPinned = Utilities.SafeConvertBool(this.drForum["IsPinned"]);
297-
this.topic.IsLocked = Utilities.SafeConvertBool(this.drForum["IsLocked"]);
298-
this.topic.ViewCount = Utilities.SafeConvertInt(this.drForum["ViewCount"]);
299-
this.topic.ReplyCount = Utilities.SafeConvertInt(this.drForum["ReplyCount"]);
300-
this.topic.TopicType = Utilities.SafeConvertInt(this.drForum["TopicType"]) < 1
291+
this.topic = new DotNetNuke.Modules.ActiveForums.Entities.TopicInfo
292+
{
293+
ModuleId = this.ForumModuleId,
294+
PortalId = this.PortalId,
295+
TopicId = this.TopicId,
296+
IsPinned = Utilities.SafeConvertBool(this.drForum["IsPinned"]),
297+
IsLocked = Utilities.SafeConvertBool(this.drForum["IsLocked"]),
298+
IsApproved = Utilities.SafeConvertBool(this.drForum["IsApproved"]),
299+
IsDeleted = Utilities.SafeConvertBool(this.drForum["IsDeleted"]),
300+
IsRejected = Utilities.SafeConvertBool(this.drForum["IsRejected"]),
301+
IsArchived = Utilities.SafeConvertBool(this.drForum["IsArchived"]),
302+
IsAnnounce = Utilities.SafeConvertBool(this.drForum["IsAnnounce"]),
303+
AnnounceStart = Utilities.SafeConvertDateTime(this.drForum["AnnounceStart"]),
304+
AnnounceEnd = Utilities.SafeConvertDateTime(this.drForum["AnnounceEnd"]),
305+
ViewCount = Utilities.SafeConvertInt(this.drForum["ViewCount"]),
306+
ReplyCount = Utilities.SafeConvertInt(this.drForum["ReplyCount"]),
307+
TopicType = Utilities.SafeConvertInt(this.drForum["TopicType"]) < 1
301308
? TopicTypes.Topic
302-
: TopicTypes.Poll;
303-
this.topic.StatusId = Utilities.SafeConvertInt(this.drForum["StatusId"]);
304-
this.topic.Rating = Utilities.SafeConvertInt(this.drForum["TopicRating"]);
305-
this.topic.TopicUrl = this.drForum["URL"].ToString();
306-
this.topic.TopicData = this.drForum["TopicData"].ToString();
307-
this.topic.NextTopic = Utilities.SafeConvertInt(this.drForum["NextTopic"]);
308-
this.topic.PrevTopic = Utilities.SafeConvertInt(this.drForum["PrevTopic"]);
309-
this.topic.Content = new DotNetNuke.Modules.ActiveForums.Entities.ContentInfo();
310-
this.topic.Content.Subject = System.Net.WebUtility.HtmlDecode(this.drForum["Subject"].ToString());
311-
this.topic.Content.Body = System.Net.WebUtility.HtmlDecode(this.drForum["Body"].ToString());
312-
this.topic.Content.AuthorId = Utilities.SafeConvertInt(this.drForum["AuthorId"]);
313-
this.topic.Content.AuthorName = this.drForum["TopicAuthor"].ToString();
314-
this.topic.Content.DateCreated = Utilities.SafeConvertDateTime(this.drForum["DateCreated"]);
309+
: TopicTypes.Poll,
310+
StatusId = Utilities.SafeConvertInt(this.drForum["StatusId"]),
311+
Rating = Utilities.SafeConvertInt(this.drForum["TopicRating"]),
312+
TopicIcon = this.drForum["TopicIcon"].ToString(),
313+
Priority = Convert.ToInt32(this.drForum["Priority"]),
314+
TopicUrl = this.drForum["URL"].ToString(),
315+
TopicData = this.drForum["TopicData"].ToString(),
316+
NextTopic = Utilities.SafeConvertInt(this.drForum["NextTopic"]),
317+
PrevTopic = Utilities.SafeConvertInt(this.drForum["PrevTopic"]),
318+
Content = new DotNetNuke.Modules.ActiveForums.Entities.ContentInfo
319+
{
320+
ModuleId = this.ForumModuleId,
321+
Subject = System.Net.WebUtility.HtmlDecode(this.drForum["Subject"].ToString()),
322+
Summary = System.Net.WebUtility.HtmlDecode(this.drForum["Summary"].ToString()),
323+
Body = System.Net.WebUtility.HtmlDecode(this.drForum["Body"].ToString()),
324+
AuthorId = Utilities.SafeConvertInt(this.drForum["AuthorId"]),
325+
AuthorName = this.drForum["TopicAuthor"].ToString(),
326+
DateCreated = Utilities.SafeConvertDateTime(this.drForum["DateCreated"]),
327+
},
328+
LastReply = new DotNetNuke.Modules.ActiveForums.Entities.ReplyInfo
329+
{
330+
TopicId = this.TopicId,
331+
Content = new DotNetNuke.Modules.ActiveForums.Entities.ContentInfo
332+
{
333+
DateCreated = Utilities.SafeConvertDateTime(this.drForum["LastPostDate"]),
334+
AuthorId = Utilities.SafeConvertInt(this.drForum["LastPostAuthorId"]),
335+
},
336+
},
337+
};
315338

316339
this.topic.Author = new DotNetNuke.Modules.ActiveForums.Entities.AuthorInfo(this.PortalId, this.ForumModuleId, this.topic.Content.AuthorId);
317340
this.topic.Author.ForumUser.UserInfo.DisplayName = this.drForum["DisplayName"].ToString();
@@ -323,11 +346,6 @@ private void LoadData(int pageId)
323346

324347
this.topic.Forum = this.ForumInfo;
325348

326-
this.topic.LastReply = new DotNetNuke.Modules.ActiveForums.Entities.ReplyInfo();
327-
this.topic.LastReply.TopicId = this.TopicId;
328-
this.topic.LastReply.Content = new DotNetNuke.Modules.ActiveForums.Entities.ContentInfo();
329-
this.topic.LastReply.Content.DateCreated = Utilities.SafeConvertDateTime(this.drForum["LastPostDate"]);
330-
this.topic.LastReply.Content.AuthorId = Utilities.SafeConvertInt(this.drForum["LastPostAuthorId"]);
331349

332350
this.topic.LastReply.Author = new DotNetNuke.Modules.ActiveForums.Entities.AuthorInfo(this.PortalId, this.ForumModuleId, this.topic.LastReply.Content.AuthorId);
333351
this.topic.LastReply.Author.ForumUser.UserInfo.DisplayName = this.drForum["LastPostDisplayName"].ToString();
@@ -1017,13 +1035,16 @@ private string ParseContent(DataRow dr, string template, int rowcount)
10171035

10181036
var reply = new DotNetNuke.Modules.ActiveForums.Entities.ReplyInfo
10191037
{
1038+
ModuleId = this.ForumModuleId,
1039+
PortalId = this.PortalId,
10201040
ReplyId = dr.GetInt("ReplyId"),
10211041
TopicId = dr.GetInt("TopicId"),
10221042
StatusId = dr.GetInt("StatusId"),
10231043
Topic = this.topic,
10241044
ContentId = dr.GetInt("ContentId"),
10251045
Content = new DotNetNuke.Modules.ActiveForums.Entities.ContentInfo
10261046
{
1047+
ModuleId = this.ForumModuleId,
10271048
ContentId = dr.GetInt("ContentId"),
10281049
Body = System.Net.WebUtility.HtmlDecode(dr.GetString("Body")),
10291050
Subject = System.Net.WebUtility.HtmlDecode(dr.GetString("Subject")),

Dnn.CommunityForums/CustomControls/UserControls/TopicsView.cs

+35-6
Original file line numberDiff line numberDiff line change
@@ -481,12 +481,14 @@ private string ParseTopics(string Template, DataTable Topics, string Section)
481481
{
482482
ModuleId = this.ForumModuleId,
483483
PortalId = this.PortalId,
484+
ContentId = Convert.ToInt32(drTopic["ContentId"]),
484485
ForumId = Convert.ToInt32(drTopic["ForumId"]),
485486
Forum = new DotNetNuke.Modules.ActiveForums.Controllers.ForumController().GetById(Convert.ToInt32(drTopic["ForumId"]), this.ForumModuleId),
486487
TopicId = Convert.ToInt32(drTopic["TopicId"]),
487488
TopicType = (TopicTypes)Enum.Parse(typeof(TopicTypes), Convert.ToInt32(drTopic["TopicType"]).ToString()),
488489
Content = new DotNetNuke.Modules.ActiveForums.Entities.ContentInfo
489490
{
491+
ContentId = Convert.ToInt32(drTopic["ContentId"]),
490492
ModuleId = this.ForumModuleId,
491493
Subject = System.Net.WebUtility.HtmlDecode(Convert.ToString(drTopic["Subject"])),
492494
Summary = System.Net.WebUtility.HtmlDecode(Convert.ToString(drTopic["Summary"])),
@@ -500,19 +502,30 @@ private string ParseTopics(string Template, DataTable Topics, string Section)
500502
ViewCount = Convert.ToInt32(drTopic["ViewCount"]),
501503
StatusId = Convert.ToInt32(drTopic["StatusId"]),
502504
IsLocked = Convert.ToBoolean(drTopic["IsLocked"]),
505+
IsApproved = Convert.ToBoolean(drTopic["IsApproved"]),
506+
IsDeleted = Convert.ToBoolean(drTopic["IsDeleted"]),
507+
IsRejected = Convert.ToBoolean(drTopic["IsRejected"]),
508+
IsArchived = Convert.ToBoolean(drTopic["IsArchived"]),
503509
IsPinned = Convert.ToBoolean(drTopic["IsPinned"]),
510+
IsAnnounce = Convert.ToBoolean(drTopic["IsAnnounce"]),
511+
AnnounceStart = Convert.ToDateTime(drTopic["AnnounceStart"]),
512+
AnnounceEnd = Convert.ToDateTime(drTopic["AnnounceEnd"]),
513+
TopicIcon = drTopic["TopicIcon"].ToString(),
504514
Rating = Convert.ToInt32(drTopic["TopicRating"]),
515+
Priority = Convert.ToInt32(drTopic["Priority"]),
505516
TopicUrl = drTopic["TopicURL"].ToString(),
506517
TopicData = drTopic["TopicData"].ToString(),
507518
LastReply = new DotNetNuke.Modules.ActiveForums.Entities.ReplyInfo
508519
{
520+
ReplyId = Convert.ToInt32(drTopic["LastReplyId"]),
509521
ModuleId = this.ForumModuleId,
510522
PortalId = this.PortalId,
511523
Author = new DotNetNuke.Modules.ActiveForums.Entities.AuthorInfo(this.PortalId, this.ForumModuleId, Convert.ToInt32(drTopic["LastReplyAuthorId"])),
512-
ReplyId = Convert.ToInt32(drTopic["LastReplyId"]),
524+
ContentId = Convert.ToInt32(drTopic["LastReplyContentId"]),
513525
TopicId = Convert.ToInt32(drTopic["TopicId"]),
514526
Content = new DotNetNuke.Modules.ActiveForums.Entities.ContentInfo
515527
{
528+
ContentId = Convert.ToInt32(drTopic["LastReplyContentId"]),
516529
ModuleId = this.ForumModuleId,
517530
Subject = System.Net.WebUtility.HtmlDecode(Convert.ToString(drTopic["LastReplySubject"])),
518531
Summary = System.Net.WebUtility.HtmlDecode(Convert.ToString(drTopic["LastReplySummary"])),
@@ -522,6 +535,7 @@ private string ParseTopics(string Template, DataTable Topics, string Section)
522535
},
523536
},
524537
};
538+
525539
if (!(string.IsNullOrEmpty(topicInfo.Content.Summary)) && (!(Utilities.HasHTML(topicInfo.Content.Summary))))
526540
{
527541
topicInfo.Content.Summary = topicInfo.Content.Summary.Replace(System.Environment.NewLine, "<br />");
@@ -532,11 +546,26 @@ private string ParseTopics(string Template, DataTable Topics, string Section)
532546
topicInfo.Author.FirstName = topicInfo.Author?.FirstName?.Replace("&amp;#", "&#");
533547
topicInfo.Author.LastName = topicInfo.Author.LastName?.Replace("&amp;#", "&#");
534548
topicInfo.Author.DisplayName = topicInfo.Author.DisplayName?.Replace("&amp;#", "&#");
535-
topicInfo.LastReplyAuthor.ForumUser.ModuleId = this.ForumModuleId;
536-
topicInfo.LastReplyAuthor.ForumUser.PortalId = this.PortalId;
537-
topicInfo.LastReplyAuthor.FirstName = topicInfo.Author.FirstName?.Replace("&amp;#", "&#");
538-
topicInfo.LastReplyAuthor.LastName = topicInfo.Author.LastName?.Replace("&amp;#", "&#");
539-
topicInfo.LastReplyAuthor.DisplayName = topicInfo.Author.DisplayName?.Replace("&amp;#", "&#");
549+
if (topicInfo.LastReplyAuthor?.LastName != null)
550+
{
551+
topicInfo.LastReplyAuthor.LastName = topicInfo.LastReplyAuthor.LastName.Replace("&amp;#", "&#");
552+
}
553+
554+
if (topicInfo.LastReplyAuthor?.FirstName != null)
555+
{
556+
topicInfo.LastReplyAuthor.FirstName = topicInfo.LastReplyAuthor.FirstName.Replace("&amp;#", "&#");
557+
}
558+
559+
if (topicInfo.LastReplyAuthor?.DisplayName != null)
560+
{
561+
topicInfo.LastReplyAuthor.DisplayName = topicInfo.LastReplyAuthor.DisplayName.Replace("&amp;#", "&#");
562+
}
563+
564+
if (topicInfo.LastReplyAuthor?.ForumUser != null)
565+
{
566+
topicInfo.LastReplyAuthor.ForumUser.ModuleId = this.ForumModuleId;
567+
topicInfo.LastReplyAuthor.ForumUser.PortalId = this.PortalId;
568+
}
540569

541570
int UserLastTopicRead = Convert.ToInt32(drTopic["UserLastTopicRead"]);
542571
int UserLastReplyRead = Convert.ToInt32(drTopic["UserLastReplyRead"]);

Dnn.CommunityForums/DnnCommunityForums.csproj

+2-1
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@
198198
<ItemGroup>
199199
<Content Include="06.04.00.txt" />
200200
<Content Include="08.02.00.txt" />
201+
<Content Include="08.02.02.txt" />
201202
<Content Include="08.01.00.txt" />
202203
<Content Include="08.00.00.txt" />
203204
<Content Include="07.00.11.txt" />
@@ -771,7 +772,6 @@
771772
<Content Include="themes\community-bootstrap\templates\ForumView.ascx" />
772773
<Content Include="themes\community-bootstrap\templates\ProfileInfo.ascx" />
773774
<Content Include="themes\community-bootstrap\templates\QuickReply.ascx" />
774-
<Content Include="themes\community-bootstrap\templates\ReplyEditor.ascx" />
775775
<Content Include="themes\community-bootstrap\templates\TopicEditor.ascx" />
776776
<Content Include="themes\community-bootstrap\templates\TopicsView.ascx" />
777777
<Content Include="themes\community-bootstrap\templates\TopicView.ascx" />
@@ -1254,6 +1254,7 @@
12541254
<None Include="sql\07.00.09.SqlDataProvider" />
12551255
<None Include="sql\07.00.09.SqlDataProvider" />
12561256
<None Include="sql\07.00.10.SqlDataProvider" />
1257+
<None Include="sql\08.02.02.SqlDataProvider" />
12571258
<None Include="sql\08.02.00.SqlDataProvider" />
12581259
<None Include="sql\Enterprise.sql" />
12591260
<Content Include="config\templates\StatsTemplate.ascx" />

0 commit comments

Comments
 (0)