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

Telerik removal #64

Merged
merged 2 commits into from
Nov 14, 2020
Merged
Show file tree
Hide file tree
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
14 changes: 3 additions & 11 deletions AnnouncementsEdit.ascx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<%@ Register TagPrefix="dnn" TagName="FilePickerUploader" Src="~/controls/filepickeruploader.ascx" %>
<%@ Import Namespace="DotNetNuke.Services.Localization" %>
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.UI.WebControls" Assembly="DotNetNuke" %>
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.UI.WebControls" Assembly="DotNetNuke.Web.Deprecated" %>
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.UI.WebControls.Internal" Assembly="DotNetNuke.Web" %>
<div class="dnnForm dnnAnnouncementForm dnnClear" id="AnnouncementsForm">
<ul class="dnnAdminTabNav dnnClear" id="">
<li id="contentTab" runat="server"><a href="#dnnContent"><%=LocalizeString("content.Tab")%></a></li>
Expand Down Expand Up @@ -67,19 +67,11 @@
</div>
<div class="dnnFormItem">
<dnn:Label ID="plPublishDate" Suffix=":" ControlName="publishDate" runat="server" />
<div class="dateDiv"><dnn:DnnDatePicker ID="publishDate" runat="server" /></div>
</div>
<div class="dnnFormItem">
<dnn:Label ID="plPublishTime" Suffix=":" ControlName="publishTime" runat="server" />
<div class="dateDiv"><dnn:DnnTimePicker ID="publishTime" runat="server" /></div>
<div class="dateDiv"><dnn:DnnDateTimePicker ID="publishDate" runat="server" /></div>
</div>
<div class="dnnFormItem">
<dnn:Label ID="plExpireDate" Suffix=":" ControlName="expireDate" runat="server" />
<div class="dateDiv"><dnn:DnnDatePicker ID="expireDate" runat="server" /></div>
</div>
<div class="dnnFormItem">
<dnn:Label ID="plExpireTime" Suffix=":" ControlName="expireTime" runat="server" />
<div class="dateDiv"><dnn:DnnTimePicker ID="expireTime" runat="server" /></div>
<div class="dateDiv"><dnn:DnnDateTimePicker ID="expireDate" runat="server" /></div>
</div>
</fieldset>
</div>
Expand Down
26 changes: 13 additions & 13 deletions AnnouncementsEdit.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
using DotNetNuke.Web.Client.ClientResourceManagement;
using DotNetNuke.Web.Mvp;
using DotNetNuke.Web.UI.WebControls;

using DotNetNuke.Web.UI.WebControls.Internal;
using WebFormsMvp;

#endregion
Expand All @@ -68,6 +68,13 @@ public partial class AnnouncementsEdit : ModuleView<AnnouncementsEditModel>, IAn
public event EventHandler<EditItemEventArgs> DeleteAnnouncement;
public event EventHandler<EditItemEventArgs> UpdateAnnouncement;

protected UI.UserControls.LabelControl plTitle;
protected DnnFilePickerUploader urlImage;
protected UI.UserControls.TextEditor teDescription;
protected UI.UserControls.UrlControl ctlURL;
protected UI.UserControls.ModuleAuditControl ctlAudit;
protected UI.UserControls.URLTrackingControl ctlTracking;

override protected void OnInit(EventArgs e)
{
base.OnInit(e);
Expand Down Expand Up @@ -157,8 +164,8 @@ private void CmdUpdateClick(object sender, EventArgs e)
announcement.ImageSource = urlImage.FilePath;
announcement.Description = teDescription.Text;
announcement.URL = ctlURL.Url;
announcement.PublishDate = GetDateTimeValue(publishDate, publishTime, DateTime.UtcNow);
announcement.ExpireDate = GetDateTimeValue(expireDate, expireTime);
announcement.PublishDate = GetDateTimeValue(publishDate, DateTime.UtcNow);
announcement.ExpireDate = GetDateTimeValue(expireDate);
announcement.LastModifiedByUserID = ModuleContext.PortalSettings.UserId;
announcement.LastModifiedOnDate = DateTime.UtcNow;
if (!string.IsNullOrWhiteSpace(txtViewOrder.Text))
Expand Down Expand Up @@ -201,14 +208,12 @@ private void BindForm()
{
var portalDateTime = TimeZoneInfo.ConvertTimeFromUtc(Model.AnnouncementInfo.PublishDate.Value, ModuleContext.PortalSettings.TimeZone);
publishDate.SelectedDate = portalDateTime;
publishTime.SelectedDate = portalDateTime;
}
if ((!Null.IsNull(Model.AnnouncementInfo.ExpireDate)) &&
(Model.AnnouncementInfo.ExpireDate != (DateTime)SqlDateTime.Null))
{
var portalDateTime = TimeZoneInfo.ConvertTimeFromUtc(Model.AnnouncementInfo.ExpireDate.Value, ModuleContext.PortalSettings.TimeZone);
expireDate.SelectedDate = portalDateTime;
expireTime.SelectedDate = portalDateTime;
}

var user = UserController.Instance.GetCurrentUserInfo();
Expand Down Expand Up @@ -276,7 +281,7 @@ private string ReturnURL
}
}

private DateTime? GetDateTimeValue(DnnDatePicker dnnDatePicker, DnnTimePicker dnnTimePicker)
private DateTime? GetDateTimeValue(DnnDatePicker dnnDatePicker)
{
DateTime? resultValue = null;

Expand All @@ -285,11 +290,6 @@ private string ReturnURL
resultValue = dnnDatePicker.SelectedDate;
}

if ((dnnTimePicker.SelectedTime != null) && (resultValue.HasValue))
{
resultValue = resultValue.Value.Add((TimeSpan)dnnTimePicker.SelectedTime);
}

if (resultValue.HasValue)
{
return TimeZoneInfo.ConvertTimeToUtc(resultValue.Value, ModuleContext.PortalSettings.TimeZone);
Expand All @@ -298,9 +298,9 @@ private string ReturnURL
return null;
}

private DateTime? GetDateTimeValue(DnnDatePicker dnnDatePicker, DnnTimePicker dnnTimePicker, DateTime defaultValue)
private DateTime? GetDateTimeValue(DnnDateTimePicker dnnDatePicker, DateTime defaultValue)
{
DateTime? resultValue = GetDateTimeValue(dnnDatePicker, dnnTimePicker);
DateTime? resultValue = GetDateTimeValue(dnnDatePicker);

if (!resultValue.HasValue)
{
Expand Down
152 changes: 32 additions & 120 deletions AnnouncementsEdit.ascx.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading