Skip to content

Commit 9771c22

Browse files
authored
Merge pull request #64 from valadas/telerik-romoval
Telerik removal
2 parents 4df2fb8 + 38e3b80 commit 9771c22

8 files changed

+58
-169
lines changed

AnnouncementsEdit.ascx

+3-11
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<%@ Register TagPrefix="dnn" TagName="FilePickerUploader" Src="~/controls/filepickeruploader.ascx" %>
1010
<%@ Import Namespace="DotNetNuke.Services.Localization" %>
1111
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.UI.WebControls" Assembly="DotNetNuke" %>
12-
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.UI.WebControls" Assembly="DotNetNuke.Web.Deprecated" %>
12+
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.UI.WebControls.Internal" Assembly="DotNetNuke.Web" %>
1313
<div class="dnnForm dnnAnnouncementForm dnnClear" id="AnnouncementsForm">
1414
<ul class="dnnAdminTabNav dnnClear" id="">
1515
<li id="contentTab" runat="server"><a href="#dnnContent"><%=LocalizeString("content.Tab")%></a></li>
@@ -67,19 +67,11 @@
6767
</div>
6868
<div class="dnnFormItem">
6969
<dnn:Label ID="plPublishDate" Suffix=":" ControlName="publishDate" runat="server" />
70-
<div class="dateDiv"><dnn:DnnDatePicker ID="publishDate" runat="server" /></div>
71-
</div>
72-
<div class="dnnFormItem">
73-
<dnn:Label ID="plPublishTime" Suffix=":" ControlName="publishTime" runat="server" />
74-
<div class="dateDiv"><dnn:DnnTimePicker ID="publishTime" runat="server" /></div>
70+
<div class="dateDiv"><dnn:DnnDateTimePicker ID="publishDate" runat="server" /></div>
7571
</div>
7672
<div class="dnnFormItem">
7773
<dnn:Label ID="plExpireDate" Suffix=":" ControlName="expireDate" runat="server" />
78-
<div class="dateDiv"><dnn:DnnDatePicker ID="expireDate" runat="server" /></div>
79-
</div>
80-
<div class="dnnFormItem">
81-
<dnn:Label ID="plExpireTime" Suffix=":" ControlName="expireTime" runat="server" />
82-
<div class="dateDiv"><dnn:DnnTimePicker ID="expireTime" runat="server" /></div>
74+
<div class="dateDiv"><dnn:DnnDateTimePicker ID="expireDate" runat="server" /></div>
8375
</div>
8476
</fieldset>
8577
</div>

AnnouncementsEdit.ascx.cs

+13-13
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
using DotNetNuke.Web.Client.ClientResourceManagement;
4646
using DotNetNuke.Web.Mvp;
4747
using DotNetNuke.Web.UI.WebControls;
48-
48+
using DotNetNuke.Web.UI.WebControls.Internal;
4949
using WebFormsMvp;
5050

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

71+
protected UI.UserControls.LabelControl plTitle;
72+
protected DnnFilePickerUploader urlImage;
73+
protected UI.UserControls.TextEditor teDescription;
74+
protected UI.UserControls.UrlControl ctlURL;
75+
protected UI.UserControls.ModuleAuditControl ctlAudit;
76+
protected UI.UserControls.URLTrackingControl ctlTracking;
77+
7178
override protected void OnInit(EventArgs e)
7279
{
7380
base.OnInit(e);
@@ -157,8 +164,8 @@ private void CmdUpdateClick(object sender, EventArgs e)
157164
announcement.ImageSource = urlImage.FilePath;
158165
announcement.Description = teDescription.Text;
159166
announcement.URL = ctlURL.Url;
160-
announcement.PublishDate = GetDateTimeValue(publishDate, publishTime, DateTime.UtcNow);
161-
announcement.ExpireDate = GetDateTimeValue(expireDate, expireTime);
167+
announcement.PublishDate = GetDateTimeValue(publishDate, DateTime.UtcNow);
168+
announcement.ExpireDate = GetDateTimeValue(expireDate);
162169
announcement.LastModifiedByUserID = ModuleContext.PortalSettings.UserId;
163170
announcement.LastModifiedOnDate = DateTime.UtcNow;
164171
if (!string.IsNullOrWhiteSpace(txtViewOrder.Text))
@@ -201,14 +208,12 @@ private void BindForm()
201208
{
202209
var portalDateTime = TimeZoneInfo.ConvertTimeFromUtc(Model.AnnouncementInfo.PublishDate.Value, ModuleContext.PortalSettings.TimeZone);
203210
publishDate.SelectedDate = portalDateTime;
204-
publishTime.SelectedDate = portalDateTime;
205211
}
206212
if ((!Null.IsNull(Model.AnnouncementInfo.ExpireDate)) &&
207213
(Model.AnnouncementInfo.ExpireDate != (DateTime)SqlDateTime.Null))
208214
{
209215
var portalDateTime = TimeZoneInfo.ConvertTimeFromUtc(Model.AnnouncementInfo.ExpireDate.Value, ModuleContext.PortalSettings.TimeZone);
210216
expireDate.SelectedDate = portalDateTime;
211-
expireTime.SelectedDate = portalDateTime;
212217
}
213218

214219
var user = UserController.Instance.GetCurrentUserInfo();
@@ -276,7 +281,7 @@ private string ReturnURL
276281
}
277282
}
278283

279-
private DateTime? GetDateTimeValue(DnnDatePicker dnnDatePicker, DnnTimePicker dnnTimePicker)
284+
private DateTime? GetDateTimeValue(DnnDatePicker dnnDatePicker)
280285
{
281286
DateTime? resultValue = null;
282287

@@ -285,11 +290,6 @@ private string ReturnURL
285290
resultValue = dnnDatePicker.SelectedDate;
286291
}
287292

288-
if ((dnnTimePicker.SelectedTime != null) && (resultValue.HasValue))
289-
{
290-
resultValue = resultValue.Value.Add((TimeSpan)dnnTimePicker.SelectedTime);
291-
}
292-
293293
if (resultValue.HasValue)
294294
{
295295
return TimeZoneInfo.ConvertTimeToUtc(resultValue.Value, ModuleContext.PortalSettings.TimeZone);
@@ -298,9 +298,9 @@ private string ReturnURL
298298
return null;
299299
}
300300

301-
private DateTime? GetDateTimeValue(DnnDatePicker dnnDatePicker, DnnTimePicker dnnTimePicker, DateTime defaultValue)
301+
private DateTime? GetDateTimeValue(DnnDateTimePicker dnnDatePicker, DateTime defaultValue)
302302
{
303-
DateTime? resultValue = GetDateTimeValue(dnnDatePicker, dnnTimePicker);
303+
DateTime? resultValue = GetDateTimeValue(dnnDatePicker);
304304

305305
if (!resultValue.HasValue)
306306
{

AnnouncementsEdit.ascx.designer.cs

+32-120
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)