From b1633f2ca6fb92e7169a6c18246b3a3098a3938a Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Mon, 8 Jul 2019 08:34:15 -0700 Subject: [PATCH] 7.1.1 - PopulateOwnerList Datasource update Implemented PortalID to Datasource so that users for that specific portal would be populated. --- Source/DnnDocuments/EditDocs.ascx.vb | 134 +++++++++++++-------------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/Source/DnnDocuments/EditDocs.ascx.vb b/Source/DnnDocuments/EditDocs.ascx.vb index 09d0b4b..2f051b1 100644 --- a/Source/DnnDocuments/EditDocs.ascx.vb +++ b/Source/DnnDocuments/EditDocs.ascx.vb @@ -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 @@ -40,10 +40,10 @@ Namespace DotNetNuke.Modules.Documents ''' ''' ----------------------------------------------------------------------------- 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 @@ -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" - - ''' ----------------------------------------------------------------------------- - ''' - ''' Page_Load runs when the control is loaded - ''' - ''' - ''' - ''' - ''' [cnurse] 9/22/2004 Updated to reflect design changes for Help, 508 support - ''' and localisation - ''' - ''' ----------------------------------------------------------------------------- + + ''' ----------------------------------------------------------------------------- + ''' + ''' Page_Load runs when the control is loaded + ''' + ''' + ''' + ''' + ''' [cnurse] 9/22/2004 Updated to reflect design changes for Help, 508 support + ''' and localisation + ''' + ''' ----------------------------------------------------------------------------- Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim objDocumentsSettings As DocumentsSettingsInfo @@ -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 @@ -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 ''' ----------------------------------------------------------------------------- @@ -314,14 +314,14 @@ Namespace DotNetNuke.Modules.Documents ''' ''' ----------------------------------------------------------------------------- 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 @@ -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 @@ -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 @@ -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 @@ -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. Private Sub InitializeComponent() End Sub @@ -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 @@ -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"