Skip to content

Commit

Permalink
Merge pull request #13 from markmcavoy/feature/account_created_data_e…
Browse files Browse the repository at this point in the history
…xport

Feature/account "Created data" field export
  • Loading branch information
fordnn committed Dec 9, 2021
2 parents 863781e + 10bc50f commit 66358c4
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 53 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.suo
*.user

.vs/
bin/
obj/
6 changes: 6 additions & 0 deletions App_LocalResources/MainControl.ascx.resx
Original file line number Diff line number Diff line change
Expand Up @@ -303,4 +303,10 @@
<data name="ExportByRole.Text" xml:space="preserve">
<value>Export By Role</value>
</data>
<data name="ExportCreatedDate.Help" xml:space="preserve">
<value>Export the date when the user account was created</value>
</data>
<data name="ExportCreatedDate.Text" xml:space="preserve">
<value>Export Created Date</value>
</data>
</root>
8 changes: 8 additions & 0 deletions Components/ExportController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,21 @@ FOR XML PATH('')) Roles
.Replace("{0}", objExportInfo.ExportByRole.ToString()));
}

if (objExportInfo.ExportCreatedDate)
{
sbSelect.Append(", u.CreatedOnDate");
htFieldNames["CreatedOnDate"] = 1;
}

idr = DotNetNuke.Data.DataProvider.Instance().ExecuteSQL(sbSelect.ToString() + sbFrom.ToString() + sbWhere.ToString());
DataTable dt = DotNetNuke.Common.Globals.ConvertDataReaderToDataTable(idr);
if (objExportInfo.ExportPasswords)
{
dt = AddPasswordsColumn(PortalId, dt);
}



string strResult = "";

switch (objExportInfo.ExportFileType)
Expand Down
7 changes: 6 additions & 1 deletion MainControl.ascx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
<dnn:Label runat="server" id="lblIncludeNonAuthorised" resourcekey="IncludeNonAuthorised" AssociatedControlID="cbIncludeNonAuthorised"></dnn:Label>
<asp:CheckBox runat="server" ID="cbIncludeNonAuthorised" CssClass="normalCheckBox" />
</div>
<div class="dnnFormItem">
<dnn:Label runat="server" id="lblExportCreatedDate" resourcekey="ExportCreatedDate" AssociatedControlID="cbExportCreatedDate"></dnn:Label>
<asp:CheckBox runat="server" ID="cbExportCreatedDate" CssClass="normalCheckBox" />
</div>
<div class="dnnFormItem">
<dnn:Label runat="server" id="lblExportRoles" resourcekey="ExportRoles" AssociatedControlID="cbExportRoles"></dnn:Label>
<asp:CheckBox runat="server" ID="cbExportRoles" CssClass="normalCheckBox" />
Expand Down Expand Up @@ -172,7 +176,8 @@
objValues.IncludeDeleted = $("#<%=cbIncludeDeleted.ClientID%>").prop("checked");
objValues.IncludeNonAuthorised = $("#<%=cbIncludeNonAuthorised.ClientID%>").prop("checked");
objValues.ExportRoles = $("#<%=cbExportRoles.ClientID%>").prop("checked");
objValues.ExportPasswords = $("#<%=cbExportPasswords.ClientID%>").prop("checked");
objValues.ExportPasswords = $("#<%=cbExportPasswords.ClientID%>").prop("checked");
objValues.ExportCreatedDate = $("#<%=cbExportCreatedDate.ClientID%>").prop("checked");
objValues.PropertiesToExport = "";
$("#<%=cblPropertiesToExport.ClientID%> input[type='checkbox']:checked").each(
function (ind, val)
Expand Down
2 changes: 1 addition & 1 deletion MainControl.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private void ExtraPageLoad()
ddlExportByRole.Items.Clear();
ddlExportByRole.Items.Add(new ListItem(Localization.GetString("AllRoles", this.LocalResourceFile), "-1"));
RoleController objRoleController = new RoleController();
foreach (RoleInfo objRole in objRoleController.GetRoles(this.PortalId))
foreach (RoleInfo objRole in objRoleController.GetPortalRoles(this.PortalId))
{
ddlExportByRole.Items.Add(new ListItem(objRole.RoleName, objRole.RoleID.ToString()));
}
Expand Down
Loading

0 comments on commit 66358c4

Please sign in to comment.