-
Notifications
You must be signed in to change notification settings - Fork 0
/
LandingPage.ascx.vb
executable file
·330 lines (232 loc) · 18.2 KB
/
LandingPage.ascx.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
'
' Feedback Center for DotNetNuke - http://www.dotnetnuke.com
' Copyright (c) 2002-2005
' by Scott McCulloch ( smcculloch@iinet.net.au ) ( http://www.smcculloch.net )
'
Imports System.IO
Imports System.Web
Imports System.Web.UI.HtmlControls
Imports System.Web.UI.WebControls
Imports DotNetNuke
Imports DotNetNuke.Common
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Entities.Modules
Imports DotNetNuke.Services.Localization
Imports Ventrian.FeedbackCenter.Entities
Imports DotNetNuke.Security
Imports Ventrian.FeedbackCenter.Entities.Layout
Namespace Ventrian.FeedbackCenter
Public MustInherit Class LandingPage
Inherits FeedbackCenterBase
#Region " Controls "
Protected WithEvents lblVotes As System.Web.UI.WebControls.Label
Protected WithEvents rptLatest As System.Web.UI.WebControls.Repeater
Protected WithEvents lblMakeSuggestion As System.Web.UI.WebControls.Label
Protected WithEvents lblMakeSuggestionDetail As System.Web.UI.WebControls.Label
Protected WithEvents lblMakeSuggestionClick As System.Web.UI.WebControls.Label
Protected WithEvents rptHighestRated As System.Web.UI.WebControls.Repeater
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents rptRecentlyImplemented As System.Web.UI.WebControls.Repeater
Protected WithEvents Label2 As System.Web.UI.WebControls.Label
Protected WithEvents rptRecentlyCommented As System.Web.UI.WebControls.Repeater
Protected WithEvents lblMyFeedback1 As System.Web.UI.WebControls.Label
Protected WithEvents rptMyFeedback As System.Web.UI.WebControls.Repeater
Protected WithEvents lblMyFeedback2 As System.Web.UI.WebControls.Label
Protected WithEvents lblTrackingFeedback1 As System.Web.UI.WebControls.Label
Protected WithEvents rptTrackingFeeedback As System.Web.UI.WebControls.Repeater
Protected WithEvents lblTrackingFeedback2 As System.Web.UI.WebControls.Label
Protected WithEvents trAuthFeedback As System.Web.UI.HtmlControls.HtmlTableRow
Protected WithEvents lblNoMyFeedback As System.Web.UI.WebControls.Label
Protected WithEvents lblNoTrackingFeedback As System.Web.UI.WebControls.Label
Protected WithEvents lblProductList As System.Web.UI.WebControls.Label
Protected WithEvents dlProducts As System.Web.UI.WebControls.DataList
Protected WithEvents lblSearchAllFeedback As System.Web.UI.WebControls.Label
Protected WithEvents lblStatistics As System.Web.UI.WebControls.Label
Protected WithEvents lblPeriod30 As System.Web.UI.WebControls.Label
Protected WithEvents lblFeedbackCreated30 As System.Web.UI.WebControls.Label
Protected WithEvents Label3 As System.Web.UI.WebControls.Label
Protected WithEvents Label4 As System.Web.UI.WebControls.Label
Protected WithEvents lblFeedbackResolved30 As System.Web.UI.WebControls.Label
Protected WithEvents Label5 As System.Web.UI.WebControls.Label
Protected WithEvents lblFeedbackTime30 As System.Web.UI.WebControls.Label
Protected WithEvents lblPeriodAll As System.Web.UI.WebControls.Label
Protected WithEvents Label6 As System.Web.UI.WebControls.Label
Protected WithEvents lblFeedbackCreatedAll As System.Web.UI.WebControls.Label
Protected WithEvents Label7 As System.Web.UI.WebControls.Label
Protected WithEvents lblFeedbackResolvedAll As System.Web.UI.WebControls.Label
Protected WithEvents Label8 As System.Web.UI.WebControls.Label
Protected WithEvents lblFeedbackTimeAll As System.Web.UI.WebControls.Label
Protected WithEvents lblMoreFeedback1 As System.Web.UI.WebControls.Label
Protected WithEvents lblMoreFeedback2 As System.Web.UI.WebControls.Label
Protected WithEvents lblMoreFeedback3 As System.Web.UI.WebControls.Label
Protected WithEvents lblMoreFeedback4 As System.Web.UI.WebControls.Label
Protected WithEvents lblHighestRated As System.Web.UI.WebControls.Label
Protected WithEvents trStatistics As System.Web.UI.HtmlControls.HtmlTableRow
Protected WithEvents phTemplate As System.Web.UI.WebControls.PlaceHolder
#End Region
#Region " Private Methods "
Private Sub BindTemplate()
Dim objLayoutController As New LayoutController()
Dim objLanding As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_Html, ModuleId, Settings)
ProcessLayout(phTemplate.Controls, objLanding.Tokens)
End Sub
Private Sub ProcessLayout(ByRef controls As ControlCollection, ByVal layoutArray As String())
Dim objProductController As New ProductController
Dim objProducts As ArrayList = objProductController.List(Me.ModuleId, True, Null.NullInteger)
Dim objProductsToSelect As New ArrayList
For Each objProduct As ProductInfo In objProducts
If (objProduct.InheritSecurity) Then
objProductsToSelect.Add(objProduct)
Else
If (Settings.Contains(objProduct.ProductID.ToString() & "-" & Constants.PERMISSION_CATEGORY_VIEW_SETTING)) Then
If (PortalSecurity.IsInRoles(Settings(objProduct.ProductID.ToString() & "-" & Constants.PERMISSION_CATEGORY_VIEW_SETTING).ToString())) Then
objProductsToSelect.Add(objProduct)
End If
End If
End If
Next
Dim products As New List(Of Integer)
Dim objProductsToSecure As ArrayList = objProductController.ListAll(ModuleId)
For Each objProduct As ProductInfo In objProductsToSecure
If (objProduct.InheritSecurity) Then
products.Add(objProduct.ProductID)
Else
If (Settings.Contains(objProduct.ProductID.ToString() & "-" & Constants.PERMISSION_CATEGORY_VIEW_SETTING)) Then
If (PortalSecurity.IsInRoles(Settings(objProduct.ProductID.ToString() & "-" & Constants.PERMISSION_CATEGORY_VIEW_SETTING).ToString())) Then
products.Add(objProduct.ProductID)
End If
End If
End If
Next
If (products.Count = objProductsToSecure.Count) Then
products = Nothing
Else
If (products.Count = 0) Then
products.Add(-1)
End If
End If
For iPtr As Integer = 0 To layoutArray.Length - 1 Step 2
controls.Add(New LiteralControl(layoutArray(iPtr).ToString()))
If iPtr < layoutArray.Length - 1 Then
Select Case layoutArray(iPtr + 1)
Case "FEEDBACKTRACKING"
If (Request.IsAuthenticated) Then
Dim objFeedbackController As New FeedbackController()
Dim trackingFeedback As ArrayList = objFeedbackController.List(Me.ModuleId, Null.NullInteger, False, Null.NullString, SortType.CreateDate, SortDirection.Descending, 5, Null.NullInteger, Me.UserId, True, products)
Dim objLayoutController As New LayoutController()
Dim objProductListHeader As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_FeedbackTracking_Header_Html, ModuleId, Settings)
Dim objProductListItem As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_FeedbackTracking_Item_Html, ModuleId, Settings)
Dim objProductListFooter As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_FeedbackTracking_Footer_Html, ModuleId, Settings)
ProcessLayoutProductListHeaderFooter(controls, objProductListHeader.Tokens)
For Each objFeedback As FeedbackInfo In trackingFeedback
ProcessFeedbackItem(controls, objProductListItem.Tokens, objFeedback)
Next
ProcessLayoutProductListHeaderFooter(controls, objProductListFooter.Tokens)
End If
Case "HIGHESTRATED"
Dim objFeedbackController As New FeedbackController()
Dim highestRatedFeedback As ArrayList = objFeedbackController.List(Me.ModuleId, Null.NullInteger, False, Null.NullString, SortType.Popularity, SortDirection.Descending, 5, Null.NullInteger, Null.NullInteger, True, products)
Dim objLayoutController As New LayoutController()
Dim objProductListHeader As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_HighestRated_Header_Html, ModuleId, Settings)
Dim objProductListItem As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_HighestRated_Item_Html, ModuleId, Settings)
Dim objProductListFooter As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_HighestRated_Footer_Html, ModuleId, Settings)
ProcessLayoutProductListHeaderFooter(controls, objProductListHeader.Tokens)
For Each objFeedback As FeedbackInfo In highestRatedFeedback
ProcessFeedbackItem(controls, objProductListItem.Tokens, objFeedback)
Next
ProcessLayoutProductListHeaderFooter(controls, objProductListFooter.Tokens)
Case "MAKESUGGESTION"
Dim objLayoutController As New LayoutController()
Dim objMakeSuggestion As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_Make_Suggestion_Html, ModuleId, Settings)
ProcessLayoutMakeSuggestion(controls, objMakeSuggestion.Tokens)
Case "MYFEEDBACK"
If (Request.IsAuthenticated) Then
Dim objFeedbackController As New FeedbackController()
Dim myFeedback As ArrayList = objFeedbackController.List(Me.ModuleId, Null.NullInteger, False, Null.NullString, SortType.CreateDate, SortDirection.Descending, 5, Me.UserId, Null.NullInteger, True, products)
Dim objLayoutController As New LayoutController()
Dim objProductListHeader As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_MyFeedback_Header_Html, ModuleId, Settings)
Dim objProductListItem As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_MyFeedback_Item_Html, ModuleId, Settings)
Dim objProductListFooter As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_MyFeedback_Footer_Html, ModuleId, Settings)
ProcessLayoutProductListHeaderFooter(controls, objProductListHeader.Tokens)
For Each objFeedback As FeedbackInfo In myFeedback
ProcessFeedbackItem(controls, objProductListItem.Tokens, objFeedback)
Next
ProcessLayoutProductListHeaderFooter(controls, objProductListFooter.Tokens)
End If
Case "PRODUCTLIST"
Dim objLayoutController As New LayoutController()
Dim objProductListHeader As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_ProductList_Header_Html, ModuleId, Settings)
Dim objProductListItem As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_ProductList_Item_Html, ModuleId, Settings)
Dim objProductListFooter As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_ProductList_Footer_Html, ModuleId, Settings)
ProcessLayoutProductListHeaderFooter(controls, objProductListHeader.Tokens)
For Each objProduct As ProductInfo In objProductsToSelect
ProcessProductItem(controls, objProductListItem.Tokens, objProduct)
Next
ProcessLayoutProductListHeaderFooter(controls, objProductListFooter.Tokens)
Case "RECENTLYCOMMENTED"
Dim objFeedbackController As New FeedbackController()
Dim recentlyCommented As ArrayList = objFeedbackController.List(Me.ModuleId, Null.NullInteger, False, Null.NullString, SortType.LastCommentDate, SortDirection.Descending, 5, Null.NullInteger, Null.NullInteger, True, products)
Dim objLayoutController As New LayoutController()
Dim objProductListHeader As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_RecentlyCommented_Header_Html, ModuleId, Settings)
Dim objProductListItem As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_RecentlyCommented_Item_Html, ModuleId, Settings)
Dim objProductListFooter As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_RecentlyCommented_Footer_Html, ModuleId, Settings)
ProcessLayoutProductListHeaderFooter(controls, objProductListHeader.Tokens)
For Each objFeedback As FeedbackInfo In recentlyCommented
ProcessFeedbackItem(controls, objProductListItem.Tokens, objFeedback)
Next
ProcessLayoutProductListHeaderFooter(controls, objProductListFooter.Tokens)
Case "RECENTLYIMPLEMENTED"
Dim objFeedbackController As New FeedbackController()
Dim recentlyImplemented As ArrayList = objFeedbackController.List(Me.ModuleId, Null.NullInteger, True, Null.NullString, SortType.ClosedDate, SortDirection.Descending, 5, Null.NullInteger, Null.NullInteger, True, products)
Dim objLayoutController As New LayoutController()
Dim objProductListHeader As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_RecentlyImplemented_Header_Html, ModuleId, Settings)
Dim objProductListItem As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_RecentlyImplemented_Item_Html, ModuleId, Settings)
Dim objProductListFooter As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_RecentlyImplemented_Footer_Html, ModuleId, Settings)
ProcessLayoutProductListHeaderFooter(controls, objProductListHeader.Tokens)
For Each objFeedback As FeedbackInfo In recentlyImplemented
ProcessFeedbackItem(controls, objProductListItem.Tokens, objFeedback)
Next
ProcessLayoutProductListHeaderFooter(controls, objProductListFooter.Tokens)
Case "STATISTICS"
Dim objLayoutController As New LayoutController()
Dim objStatistics As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_Statistics_Html, ModuleId, Settings)
ProcessLayoutStatistics(controls, objStatistics.Tokens)
Case "WHATSNEW"
Dim objFeedbackController As New FeedbackController()
Dim whatsNewFeedback As ArrayList = objFeedbackController.List(Me.ModuleId, Null.NullInteger, False, Null.NullString, SortType.CreateDate, SortDirection.Descending, 5, Null.NullInteger, Null.NullInteger, True, products)
Dim objLayoutController As New LayoutController()
Dim objProductListHeader As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_WhatsNew_Header_Html, ModuleId, Settings)
Dim objProductListItem As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_WhatsNew_Item_Html, ModuleId, Settings)
Dim objProductListFooter As LayoutInfo = objLayoutController.GetLayout(LayoutType.Landing_WhatsNew_Footer_Html, ModuleId, Settings)
ProcessLayoutProductListHeaderFooter(controls, objProductListHeader.Tokens)
For Each objFeedback As FeedbackInfo In whatsNewFeedback
ProcessFeedbackItem(controls, objProductListItem.Tokens, objFeedback)
Next
ProcessLayoutProductListHeaderFooter(controls, objProductListFooter.Tokens)
Case Else
Dim objLiteralOther As New Literal
objLiteralOther.Text = "[" & layoutArray(iPtr + 1) & "]"
objLiteralOther.EnableViewState = False
controls.Add(objLiteralOther)
End Select
End If
Next
End Sub
#End Region
#Region " Event Handlers "
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
BindTemplate()
End Sub
#End Region
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
End Class
End Namespace