-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tracking.ascx.vb
executable file
·201 lines (143 loc) · 7.86 KB
/
Tracking.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
'
' 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 Tracking
Inherits FeedbackCenterBase
#Region " Controls "
Protected WithEvents rptBreadCrumbs As System.Web.UI.WebControls.Repeater
Protected WithEvents lblStatus As System.Web.UI.WebControls.Label
Protected WithEvents lstStatus As System.Web.UI.WebControls.RadioButtonList
Protected WithEvents lblSubmitComplete As System.Web.UI.WebControls.Label
Protected WithEvents phControls As System.Web.UI.WebControls.PlaceHolder
#End Region
#Region " Private Methods "
Private Sub BindCrumbs()
Dim crumbs As New ArrayList
Dim crumbAllAlbums As New CrumbInfo
crumbAllAlbums.Caption = Localization.GetString("AllFeedback", LocalResourceFile)
crumbAllAlbums.Url = NavigateURL()
crumbs.Add(crumbAllAlbums)
Dim currentCrumb As New CrumbInfo
currentCrumb.Caption = Localization.GetString("Tracking", LocalResourceFile)
currentCrumb.Url = Request.Url.ToString()
crumbs.Add(currentCrumb)
rptBreadCrumbs.DataSource = crumbs
rptBreadCrumbs.DataBind()
End Sub
Private Sub BindFeedback()
Dim objLayoutController As New LayoutController()
Dim objProductController As New ProductController
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
Dim objFeedbackController As New FeedbackController
Dim objFeedbackList As ArrayList = objFeedbackController.List(Me.ModuleId, Null.NullInteger, (lstStatus.SelectedValue = "Closed"), Null.NullString, SortType.CreateDate, SortDirection.Descending, Null.NullInteger, Null.NullInteger, Me.UserId, True, products)
If (objFeedbackList.Count = 0) Then
Dim noResults As String = Localization.GetString("NoResults", Me.LocalResourceFile)
Dim objMessage As LayoutInfo = objLayoutController.GetLayout(LayoutType.Message_Html, ModuleId, Settings)
ProcessMessage(phControls.Controls, objMessage.Tokens, noResults)
Else
Dim objPagedDataSource As New PagedDataSource
objPagedDataSource.AllowPaging = True
objPagedDataSource.DataSource = objFeedbackList
objPagedDataSource.PageSize = 10
If (Request("Page") <> "") Then
Try
objPagedDataSource.CurrentPageIndex = Convert.ToInt32(Request("Page"))
Catch ex As Exception
objPagedDataSource.CurrentPageIndex = 1
End Try
End If
Dim startSet As Integer = objPagedDataSource.CurrentPageIndex * objPagedDataSource.PageSize + 1
Dim endSet As Integer = (objPagedDataSource.CurrentPageIndex + 1) * objPagedDataSource.PageSize
If (endSet > objFeedbackList.Count) Then
endSet = objFeedbackList.Count
End If
Dim results As String = String.Format(Localization.GetString("Paging", LocalResourceFile), startSet.ToString(), endSet.ToString(), objFeedbackList.Count.ToString())
Dim strPages As String
If objPagedDataSource.PageCount = 1 Then
strPages = Localization.GetString("Page", LocalResourceFile)
Else
strPages = Localization.GetString("Pages", LocalResourceFile)
End If
For i As Integer = 1 To objPagedDataSource.PageCount
If i = (objPagedDataSource.CurrentPageIndex + 1) Then
strPages = strPages + i.ToString() & " "
Else
strPages = strPages + "<a href=" & NavigateURL(Me.TabId, "", "fbType=Tracking", "Status=" & lstStatus.SelectedValue, "Page=" & (i - 1).ToString()) & " class=""Normal"">" & i.ToString() & "</a> "
End If
Next
Dim objListHeader As LayoutInfo = objLayoutController.GetLayout(LayoutType.Search_Listing_Header_Html, ModuleId, Settings)
Dim objListItem As LayoutInfo = objLayoutController.GetLayout(LayoutType.Search_Listing_Item_Html, ModuleId, Settings)
Dim objListFooter As LayoutInfo = objLayoutController.GetLayout(LayoutType.Search_Listing_Footer_Html, ModuleId, Settings)
ProcessPaging(phControls.Controls, objListHeader.Tokens, strPages, results)
For Each objFeedback As FeedbackInfo In objPagedDataSource
ProcessFeedbackItem(phControls.Controls, objListItem.Tokens, objFeedback)
Next
ProcessPaging(phControls.Controls, objListFooter.Tokens, startSet, endSet)
End If
End Sub
Private Sub SetCriteria()
If (Request("Status") <> "") Then
If Not (lstStatus.Items.FindByValue(Request("Status")) Is Nothing) Then
lstStatus.SelectedValue = Request("Status")
End If
End If
End Sub
#End Region
#Region " Event Handlers "
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
BindCrumbs()
If (IsPostBack = False) Then
SetCriteria()
BindFeedback()
End If
End Sub
Private Sub lstStatus_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstStatus.SelectedIndexChanged
Response.Redirect(NavigateURL(Me.TabId, "", "fbType=Tracking", "Status=" & lstStatus.SelectedValue), True)
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