Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7.1.1 - PopulateOwnerList Datasource update #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 67 additions & 67 deletions Source/DnnDocuments/EditDocs.ascx.vb
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
'
' DotNetNuke� - http://www.dotnetnuke.com
' Copyright (c) 2002-2011
' by DotNetNuke Corporation
'
' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
'
' The above copyright notice and this permission notice shall be included in all copies or substantial portions
' of the Software.
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
' DEALINGS IN THE SOFTWARE.
'

'
' DotNetNuke� - http://www.dotnetnuke.com
' Copyright (c) 2002-2011
' by DotNetNuke Corporation
'
' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
'
' The above copyright notice and this permission notice shall be included in all copies or substantial portions
' of the Software.
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
' DEALINGS IN THE SOFTWARE.
'
Imports System.IO
Imports System.Linq
Imports System.Web
Expand All @@ -40,10 +40,10 @@ Namespace DotNetNuke.Modules.Documents
''' </history>
''' -----------------------------------------------------------------------------
Public MustInherit Class EditDocs
Inherits Entities.Modules.PortalModuleBase

Inherits Entities.Modules.PortalModuleBase
#Region "Controls"

Protected WithEvents plName As UI.UserControls.LabelControl
Protected WithEvents txtName As System.Web.UI.WebControls.TextBox
Protected WithEvents valName As System.Web.UI.WebControls.RequiredFieldValidator
Expand All @@ -69,29 +69,29 @@ Namespace DotNetNuke.Modules.Documents
Protected WithEvents valSortIndex As System.Web.UI.WebControls.RangeValidator
Protected WithEvents lblOwner As System.Web.UI.WebControls.Label
Protected WithEvents lnkChange As System.Web.UI.WebControls.LinkButton
Protected WithEvents lblAudit As System.Web.UI.WebControls.Label

Protected WithEvents lblAudit As System.Web.UI.WebControls.Label
#End Region

#Region "Private Members"

Private mintItemId As Integer

Private mintItemId As Integer
#End Region

#Region "Event Handlers"

''' -----------------------------------------------------------------------------
''' <summary>
''' Page_Load runs when the control is loaded
''' </summary>
''' <remarks>
''' </remarks>
''' <history>
''' [cnurse] 9/22/2004 Updated to reflect design changes for Help, 508 support
''' and localisation
''' </history>
''' -----------------------------------------------------------------------------
''' -----------------------------------------------------------------------------
''' <summary>
''' Page_Load runs when the control is loaded
''' </summary>
''' <remarks>
''' </remarks>
''' <history>
''' [cnurse] 9/22/2004 Updated to reflect design changes for Help, 508 support
''' and localisation
''' </history>
''' -----------------------------------------------------------------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objDocumentsSettings As DocumentsSettingsInfo

Expand Down Expand Up @@ -246,8 +246,8 @@ Namespace DotNetNuke.Modules.Documents
If Not objFile Is Nothing Then
' Get file's folder security
Dim moduleRoles As ModulePermissionCollection = ModulePermissionController.GetModulePermissions(ModuleId, TabId)
Dim fileRoles As FolderPermissionCollection = Security.Permissions.FolderPermissionController.GetFolderPermissionsCollectionByFolder(PortalId, objFile.Folder)
Return CheckRolesMatch(moduleRoles, fileRoles)
Dim fileRoles As FolderPermissionCollection = Security.Permissions.FolderPermissionController.GetFolderPermissionsCollectionByFolder(PortalId, objFile.Folder)
Return CheckRolesMatch(moduleRoles, fileRoles)
End If
End Select
Return True
Expand Down Expand Up @@ -294,13 +294,13 @@ Namespace DotNetNuke.Modules.Documents
Next
If blnNotMatching Then
' Warn user that roles do not match
DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me, _
DotNetNuke.Services.Localization.Localization.GetString("msgFileSecurityWarning.Text", Me.LocalResourceFile).Replace("[$ROLELIST]", IIf(strRolesForMessage.IndexOf(",") >= 0, "s", "").ToString & "'" & strRolesForMessage & "'"), _
DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me,
DotNetNuke.Services.Localization.Localization.GetString("msgFileSecurityWarning.Text", Me.LocalResourceFile).Replace("[$ROLELIST]", IIf(strRolesForMessage.IndexOf(",") >= 0, "s", "").ToString & "'" & strRolesForMessage & "'"),
DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.YellowWarning)
Return False
Else
Return True
End If
End If
End Function

''' -----------------------------------------------------------------------------
Expand All @@ -314,14 +314,14 @@ Namespace DotNetNuke.Modules.Documents
''' </history>
''' -----------------------------------------------------------------------------
Private Function CheckFileExists(ByVal Url As String) As Boolean
Dim intFileId As Integer
Dim intFileId As Integer
Dim objFile As New DotNetNuke.Services.FileSystem.FileInfo
Dim blnAddWarning As Boolean

If Url = String.Empty Then
' File not selected
DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me, _
DotNetNuke.Services.Localization.Localization.GetString("msgNoFileSelected.Text", Me.LocalResourceFile), _
DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me,
DotNetNuke.Services.Localization.Localization.GetString("msgNoFileSelected.Text", Me.LocalResourceFile),
DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.YellowWarning)
Return False
Else
Expand Down Expand Up @@ -352,8 +352,8 @@ Namespace DotNetNuke.Modules.Documents

If blnAddWarning Then
' Display a "file not found" warning
DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me, _
DotNetNuke.Services.Localization.Localization.GetString("msgFileDeleted.Text", Me.LocalResourceFile), _
DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me,
DotNetNuke.Services.Localization.Localization.GetString("msgFileDeleted.Text", Me.LocalResourceFile),
DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.YellowWarning)
Return False
End If
Expand Down Expand Up @@ -457,10 +457,10 @@ Namespace DotNetNuke.Modules.Documents
Me.cmdUpdate.Visible = False

' '' Display page-level warning instructing users to click update again if they want to ignore the warning
DotNetNuke.UI.Skins.Skin.AddPageMessage( _
Me.Page, _
DotNetNuke.Services.Localization.Localization.GetString("msgFileWarningHeading.Text", Me.LocalResourceFile), _
DotNetNuke.Services.Localization.Localization.GetString("msgFileWarning.Text", Me.LocalResourceFile), _
DotNetNuke.UI.Skins.Skin.AddPageMessage(
Me.Page,
DotNetNuke.Services.Localization.Localization.GetString("msgFileWarningHeading.Text", Me.LocalResourceFile),
DotNetNuke.Services.Localization.Localization.GetString("msgFileWarning.Text", Me.LocalResourceFile),
Skins.Controls.ModuleMessage.ModuleMessageType.YellowWarning)
Exit Sub
End If
Expand Down Expand Up @@ -539,10 +539,10 @@ Namespace DotNetNuke.Modules.Documents
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub

End Sub
#End Region

#Region "Private methods"
Private Property ItemID() As Integer
Get
Expand All @@ -566,12 +566,12 @@ Namespace DotNetNuke.Modules.Documents
End If

Return objDocumentsSettings
End Function
End Function
#End Region

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub
Expand All @@ -580,10 +580,10 @@ Namespace DotNetNuke.Modules.Documents
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

End Sub
#End Region

Private Sub lnkChange_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lnkChange.Click
lblOwner.Visible = False
lnkChange.Visible = False
Expand Down Expand Up @@ -615,7 +615,7 @@ Namespace DotNetNuke.Modules.Documents

Private Sub PopulateOwnerList()
' populate owner list
lstOwner.DataSource = UserController.GetUsers(Null.NullInteger).Cast(Of UserInfo).Distinct().OrderBy(Function(i As UserInfo) i.DisplayName)
lstOwner.DataSource = UserController.GetUsers(PortalId).Cast(Of UserInfo).Distinct().OrderBy(Function(i As UserInfo) i.DisplayName)

lstOwner.DataTextField = "DisplayName"
lstOwner.DataValueField = "UserId"
Expand Down