case 3892

This commit is contained in:
2021-06-22 19:13:05 +00:00
parent bc0e4dacc3
commit 86eea2e5fc

View File

@@ -559,7 +559,7 @@ namespace AyaNova
//case 1219 - need user for more stuff below //case 1219 - need user for more stuff below
User currentUser=User.GetItem(User.CurrentThreadUserID); User currentUser = User.GetItem(User.CurrentThreadUserID);
mSelectedUserGroupID = currentUser.LastSchedGroupID; mSelectedUserGroupID = currentUser.LastSchedGroupID;
FillScheduleableUserGroupList(); FillScheduleableUserGroupList();
@@ -573,7 +573,11 @@ namespace AyaNova
//case 714 //case 714
sc.DayView.TopRowTime = TimeSpan.FromHours(8); sc.DayView.TopRowTime = TimeSpan.FromHours(8);
//NewDateRange();
//case 3892 restrict scrollable day view day to that day only as it's not working outside of the current day
sc.DayView.VisibleTime.Start = TimeSpan.FromHours(0);
sc.DayView.VisibleTime.End = TimeSpan.FromHours(24);
//************************************** //**************************************
@@ -628,20 +632,20 @@ namespace AyaNova
//case 701 //case 701
#if (DEBUG) #if (DEBUG)
//testing interval (5 minutes) //testing interval (5 minutes)
this.SchedRefreshTimer.Interval = 300000; this.SchedRefreshTimer.Interval = 300000;
#else #else
//5 minutes //5 minutes
SchedRefreshTimer.Interval=300000; SchedRefreshTimer.Interval=300000;
#endif #endif
SchedRefreshTimer.Enabled = true; SchedRefreshTimer.Enabled = true;
SchedRefreshTimer.Start(); SchedRefreshTimer.Start();
DoNotAllowFetchAndBind = false; DoNotAllowFetchAndBind = false;
BindData(true); BindData(true);
} }
@@ -661,7 +665,7 @@ namespace AyaNova
u.LastSchedStartDate = new CSLA.SmartDate(sc.ActiveView.GetVisibleIntervals().Start); u.LastSchedStartDate = new CSLA.SmartDate(sc.ActiveView.GetVisibleIntervals().Start);
u.LastSchedStopDate = new CSLA.SmartDate(sc.ActiveView.GetVisibleIntervals().End); u.LastSchedStopDate = new CSLA.SmartDate(sc.ActiveView.GetVisibleIntervals().End);
//case 1390 //case 1390
int nstartdays=(u.LastSchedStartDate.Date - DateTime.Today).Days; int nstartdays = (u.LastSchedStartDate.Date - DateTime.Today).Days;
int nstopdays = (u.LastSchedStopDate.Date - DateTime.Today).Days; int nstopdays = (u.LastSchedStopDate.Date - DateTime.Today).Days;
if (nstartdays == 0 && nstopdays == 1) if (nstartdays == 0 && nstopdays == 1)
{ {
@@ -672,9 +676,9 @@ namespace AyaNova
//case 1553 //case 1553
StateButtonTool sbt = (StateButtonTool)ToolBarManager.Tools["LT:UI.Toolbar.Schedule.ShowClosed"]; StateButtonTool sbt = (StateButtonTool)ToolBarManager.Tools["LT:UI.Toolbar.Schedule.ShowClosed"];
if (!sbt.Checked) if (!sbt.Checked)
u.ScheduleLastViewOpenOnly=true; u.ScheduleLastViewOpenOnly = true;
else else
u.ScheduleLastViewOpenOnly=false; u.ScheduleLastViewOpenOnly = false;
u.Save(); u.Save();
@@ -743,7 +747,7 @@ namespace AyaNova
Resource r = new Resource(Guid.Empty.ToString(), Util.LocaleText.GetLocalizedText("Dashboard.Label.NotAssigned"));//case 1821 Resource r = new Resource(Guid.Empty.ToString(), Util.LocaleText.GetLocalizedText("Dashboard.Label.NotAssigned"));//case 1821
//Lite version has no unscheduled user //Lite version has no unscheduled user
if(!AyaBizUtils.Lite) if (!AyaBizUtils.Lite)
ss.Resources.Add(r); ss.Resources.Add(r);
foreach (UserListScheduleable.UserListScheduleableInfo ui in uls) foreach (UserListScheduleable.UserListScheduleableInfo ui in uls)
@@ -1141,7 +1145,7 @@ namespace AyaNova
} }
private void HideDateRangeControlsInPreviewDialog(Control ctl) private void HideDateRangeControlsInPreviewDialog(Control ctl)
{ {
switch (ctl.Name) switch (ctl.Name)
{ {
@@ -1155,8 +1159,8 @@ namespace AyaNova
} }
} }
foreach(Control c in ctl.Controls) foreach (Control c in ctl.Controls)
HideDateRangeControlsInPreviewDialog(c); HideDateRangeControlsInPreviewDialog(c);
} }
@@ -1167,7 +1171,7 @@ namespace AyaNova
foreach (Control c in ctl.Controls) foreach (Control c in ctl.Controls)
{ {
sb.Append(c.ToString()); sb.Append(c.ToString());
sb.Append(" - "); sb.Append(" - ");
sb.Append(c.Name); sb.Append(c.Name);
if (c.Controls.Count > 0) if (c.Controls.Count > 0)
@@ -1201,6 +1205,9 @@ namespace AyaNova
#region Events #region Events
#region Active view and date navigation events #region Active view and date navigation events
/// <summary> /// <summary>
/// Event fired when active view is about to change /// Event fired when active view is about to change
/// </summary> /// </summary>
@@ -1210,6 +1217,7 @@ namespace AyaNova
{ {
if (ignoreActiveViewChanging) if (ignoreActiveViewChanging)
return; return;
ShowView(e.NewView.Type); ShowView(e.NewView.Type);
e.Cancel = true; e.Cancel = true;
} }
@@ -1221,6 +1229,8 @@ namespace AyaNova
/// <param name="newView"></param> /// <param name="newView"></param>
private void ShowView(SchedulerViewType newView) private void ShowView(SchedulerViewType newView)
{ {
StateButtonTool sbt = (StateButtonTool)ToolBarManager.Tools["LT:UI.Toolbar.Schedule.TimeLineView"]; StateButtonTool sbt = (StateButtonTool)ToolBarManager.Tools["LT:UI.Toolbar.Schedule.TimeLineView"];
bool useTimeLineView = sbt.Checked; bool useTimeLineView = sbt.Checked;
ignoreActiveViewChanging = true; ignoreActiveViewChanging = true;
@@ -1230,8 +1240,11 @@ namespace AyaNova
if (useTimeLineView) if (useTimeLineView)
newView = SchedulerViewType.Timeline; newView = SchedulerViewType.Timeline;
else//case 714 else//case 714
{
sc.DayView.TopRowTime = TimeSpan.FromHours(8); sc.DayView.TopRowTime = TimeSpan.FromHours(8);
}
} }
sc.ActiveViewType = newView; sc.ActiveViewType = newView;
ignoreActiveViewChanging = false; ignoreActiveViewChanging = false;
@@ -1309,7 +1322,7 @@ namespace AyaNova
ToolBarManager.Tools["LT:UI.Toolbar.Schedule.AddToActiveWorkorderItem"].SharedProps.ToolTipText = ToolBarManager.Tools["LT:UI.Toolbar.Schedule.AddToActiveWorkorderItem"].SharedProps.ToolTipText =
Util.LocaleText.GetLocalizedText("UI.Toolbar.Schedule.AddToActiveWorkorderItem") + " (" + i.ServiceNumber + ")"; Util.LocaleText.GetLocalizedText("UI.Toolbar.Schedule.AddToActiveWorkorderItem") + " (" + i.ServiceNumber + ")";
} }
ToolBarManager.Tools["LT:UI.Toolbar.Schedule.PrintWorkorders"].SharedProps.Visible = true; ToolBarManager.Tools["LT:UI.Toolbar.Schedule.PrintWorkorders"].SharedProps.Visible = true;
} }
} }
@@ -1460,7 +1473,7 @@ namespace AyaNova
2, MidpointRounding.AwayFromZero); 2, MidpointRounding.AwayFromZero);
su.UserID = gNewResourceID; su.UserID = gNewResourceID;
if (w.IsDirty) if (w.IsDirty)
{ {
@@ -1565,7 +1578,7 @@ namespace AyaNova
WorkorderItemScheduledUser wisu = wi.ScheduledUsers.Add(wi); WorkorderItemScheduledUser wisu = wi.ScheduledUsers.Add(wi);
// Guid gUserID; // Guid gUserID;
@@ -1624,7 +1637,7 @@ namespace AyaNova
private void EditAppointment(Appointment apt) private void EditAppointment(Appointment apt)
{ {
if (apt.CustomFields==null || apt.CustomFields["AyaInfo"] == null) return; if (apt.CustomFields == null || apt.CustomFields["AyaInfo"] == null) return;
AppointmentList.AppointmentListInfo i = (AppointmentList.AppointmentListInfo)apt.CustomFields["AyaInfo"]; AppointmentList.AppointmentListInfo i = (AppointmentList.AppointmentListInfo)apt.CustomFields["AyaInfo"];
switch (i.SourceObjectType) switch (i.SourceObjectType)
@@ -1817,7 +1830,7 @@ namespace AyaNova
//case 1039 //log.Debug("FillScheduleableUserGroupList"); //case 1039 //log.Debug("FillScheduleableUserGroupList");
ComboBoxTool cbt = (ComboBoxTool)ToolBarManager.Tools["LT:UI.Toolbar.Schedule.SelectScheduleableUserGroup"]; ComboBoxTool cbt = (ComboBoxTool)ToolBarManager.Tools["LT:UI.Toolbar.Schedule.SelectScheduleableUserGroup"];
cbt.AutoComplete=true; cbt.AutoComplete = true;
cbt.ValueList.ValueListItems.Clear(); cbt.ValueList.ValueListItems.Clear();
cbt.ValueList.ValueListItems.Add(ScheduleableUserGroup.AllUsersGroupID, Util.LocaleText.GetLocalizedText("UI.Grid.RowFilterDropDownAllItem")); cbt.ValueList.ValueListItems.Add(ScheduleableUserGroup.AllUsersGroupID, Util.LocaleText.GetLocalizedText("UI.Grid.RowFilterDropDownAllItem"));
@@ -1831,7 +1844,7 @@ namespace AyaNova
//NVCHANGED //NVCHANGED
GenericNVList l = GenericNVList.GetList("aScheduleableUserGroup", "aID", "aName", true, true,false); GenericNVList l = GenericNVList.GetList("aScheduleableUserGroup", "aID", "aName", true, true, false);
//Loop through the items in the list and put them //Loop through the items in the list and put them
//into the combo box //into the combo box
@@ -1931,7 +1944,7 @@ namespace AyaNova
r.Inflate(-1, -1); r.Inflate(-1, -1);
FillRoundedRect(e.Cache.Paint, e.Graphics, e.Cache.GetSolidBrush(clAppointmentBackground), r, 5); FillRoundedRect(e.Cache.Paint, e.Graphics, e.Cache.GetSolidBrush(clAppointmentBackground), r, 5);
//case 1228 //case 1228
r.Inflate(-3, -3); r.Inflate(-3, -3);
e.Cache.FillRectangle(System.Drawing.Brushes.White, r); e.Cache.FillRectangle(System.Drawing.Brushes.White, r);
@@ -1990,7 +2003,7 @@ namespace AyaNova
Rectangle ir = new Rectangle(e.Bounds.X, e.Bounds.Y, 16, 16); Rectangle ir = new Rectangle(e.Bounds.X, e.Bounds.Y, 16, 16);
Brush br = e.Cache.GetSolidBrush(Color.WhiteSmoke); Brush br = e.Cache.GetSolidBrush(Color.WhiteSmoke);
//case 739 //case 739
e.Cache.Paint.DrawImage(e.Graphics,Util.Flag(i.PriorityARGB), ir); e.Cache.Paint.DrawImage(e.Graphics, Util.Flag(i.PriorityARGB), ir);
} }
} }
@@ -2009,7 +2022,7 @@ namespace AyaNova
{ {
Rectangle ir = new Rectangle(e.Bounds.X, e.Bounds.Y, 16, 16); Rectangle ir = new Rectangle(e.Bounds.X, e.Bounds.Y, 16, 16);
Brush br = e.Cache.GetSolidBrush(Color.WhiteSmoke); Brush br = e.Cache.GetSolidBrush(Color.WhiteSmoke);
e.Cache.Paint.DrawImage(e.Graphics,Resource1.ScheduleMarker16, ir); e.Cache.Paint.DrawImage(e.Graphics, Resource1.ScheduleMarker16, ir);
} }
e.Handled = true; e.Handled = true;
@@ -2065,7 +2078,7 @@ namespace AyaNova
#region Date range changed event #region Date range changed event
double nMaxWindow = 0; double nMaxWindow = 0;
// double nCurrentWindow = 0; // double nCurrentWindow = 0;
private void sc_VisibleIntervalChanged(object sender, EventArgs e) private void sc_VisibleIntervalChanged(object sender, EventArgs e)
{ {
@@ -2085,48 +2098,57 @@ namespace AyaNova
//System.Diagnostics.Debug.WriteLine(DateTime.Now.ToString() + " *New date range should fetch*"); //System.Diagnostics.Debug.WriteLine(DateTime.Now.ToString() + " *New date range should fetch*");
return true; return true;
} }
// System.Diagnostics.Debug.WriteLine(DateTime.Now.ToString() + " Not a new date range no fetch"); // System.Diagnostics.Debug.WriteLine(DateTime.Now.ToString() + " Not a new date range no fetch");
return false; return false;
} }
#endregion date range change //case 3892
//void DayView_TopRowTimeChanged(object sender, DevExpress.XtraScheduler.Native.ChangeEventArgs e)
//{
// System.Diagnostics.Debug.WriteLine(DateTime.Now.ToString() + "DayView_TopRowTimeChanged fired");
// BindData();
//}
#region case 812 selected appointments
public System.Collections.Generic.List<AppointmentList.AppointmentListInfo> SelectedAppointments
{
get
{
System.Collections.Generic.List<AppointmentList.AppointmentListInfo> apts = new List<AppointmentList.AppointmentListInfo>();
if (sc.SelectedAppointments.Count == 0) return apts;
foreach (Appointment a in sc.SelectedAppointments)
{
apts.Add((AppointmentList.AppointmentListInfo)a.CustomFields["AyaInfo"]);
}
return apts;
}
}
public System.Collections.Generic.List<Guid> VisibleUsers #endregion date range change
{
get
{
System.Collections.Generic.List<Guid> usrs = new List<Guid>();
for (int x = 0; x < ss.Resources.Count; x++)
{
Resource r = ss.Resources[x];
if (r.Id == null || string.IsNullOrEmpty(r.Id.ToString())) continue;
Guid id = new Guid(r.Id.ToString());
if (id == Guid.Empty) continue;
if(r.Visible)
usrs.Add(id);
}
return usrs; #region case 812 selected appointments
} public System.Collections.Generic.List<AppointmentList.AppointmentListInfo> SelectedAppointments
} {
#endregion get
{
System.Collections.Generic.List<AppointmentList.AppointmentListInfo> apts = new List<AppointmentList.AppointmentListInfo>();
if (sc.SelectedAppointments.Count == 0) return apts;
foreach (Appointment a in sc.SelectedAppointments)
{
apts.Add((AppointmentList.AppointmentListInfo)a.CustomFields["AyaInfo"]);
}
return apts;
}
}
public System.Collections.Generic.List<Guid> VisibleUsers
{
get
{
System.Collections.Generic.List<Guid> usrs = new List<Guid>();
for (int x = 0; x < ss.Resources.Count; x++)
{
Resource r = ss.Resources[x];
if (r.Id == null || string.IsNullOrEmpty(r.Id.ToString())) continue;
Guid id = new Guid(r.Id.ToString());
if (id == Guid.Empty) continue;
if (r.Visible)
usrs.Add(id);
}
return usrs;
}
}
#endregion