This commit is contained in:
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@@ -52,7 +52,7 @@
|
|||||||
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
|
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
|
||||||
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
|
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
|
||||||
"AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles",
|
"AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles",
|
||||||
"AYANOVA_SERVER_TEST_MODE": "true",
|
"AYANOVA_SERVER_TEST_MODE": "false",
|
||||||
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
|
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
|
||||||
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7",
|
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7",
|
||||||
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\"
|
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\"
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
# HOME-SCHEDULE Placeholder
|
# HOME-SCHEDULE Placeholder
|
||||||
|
|
||||||
[Incomplete - under construction]
|
[Incomplete - under construction]
|
||||||
|
|
||||||
|
|
||||||
|
Notes to cover:
|
||||||
|
Null dates - schedule has no way to display null dates (e.g. woitemscheduser with no start or end date selected). Null dates must be viewed in data table lists instead.
|
||||||
@@ -60,7 +60,9 @@ namespace AyaNova.Api.Controllers
|
|||||||
var UType = UserTypeFromContext.Type(HttpContext.Items);
|
var UType = UserTypeFromContext.Type(HttpContext.Items);
|
||||||
|
|
||||||
|
|
||||||
//Adjust query dates to encompass actual view range
|
//Note: query will return records that fall within viewed range even if they start or end outside of it
|
||||||
|
//However in month view (only, rest are as is) we can see up to 6 days before or after the month so in the interest of filling those voids:
|
||||||
|
//Adjust query dates to encompass actual potential view range
|
||||||
DateTime ViewStart = p.Start;
|
DateTime ViewStart = p.Start;
|
||||||
DateTime ViewEnd = p.End;
|
DateTime ViewEnd = p.End;
|
||||||
//this covers the largest possible window that could display due to nearly a week of the last or next month showing
|
//this covers the largest possible window that could display due to nearly a week of the last or next month showing
|
||||||
@@ -70,7 +72,6 @@ namespace AyaNova.Api.Controllers
|
|||||||
ViewEnd = p.End.AddDays(6);
|
ViewEnd = p.End.AddDays(6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//WORKORDERS
|
//WORKORDERS
|
||||||
if (p.WorkOrders && (UType == UserType.Service || UType == UserType.ServiceContractor))
|
if (p.WorkOrders && (UType == UserType.Service || UType == UserType.ServiceContractor))
|
||||||
{
|
{
|
||||||
@@ -88,19 +89,19 @@ namespace AyaNova.Api.Controllers
|
|||||||
s.Id = v.WoItemSchedUserId;
|
s.Id = v.WoItemSchedUserId;
|
||||||
s.Color = ColorFromWOItem(v, p);
|
s.Color = ColorFromWOItem(v, p);
|
||||||
s.TextColor = TextColor(s.Color);
|
s.TextColor = TextColor(s.Color);
|
||||||
s.Start = EpochSeconds(v.StartDate, p.TZOffset);
|
s.Start = (DateTime)v.StartDate;
|
||||||
s.End = EpochSeconds(v.StopDate, p.TZOffset);
|
s.End = (DateTime)v.StopDate;
|
||||||
s.Type = AyaType.WorkOrderItemScheduledUser;
|
s.Type = AyaType.WorkOrderItemScheduledUser;
|
||||||
s.Name = NameFromWOItem(v, p);
|
s.Name = NameFromWOItem(v, p);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static long? EpochSeconds(DateTime? dt, int tzOffset = 0)
|
// private static long? EpochSeconds(DateTime? dt, int tzOffset = 0)
|
||||||
{
|
// {
|
||||||
if (dt == null) return null;
|
// if (dt == null) return null;
|
||||||
DateTimeOffset dto = new DateTimeOffset((DateTime)dt);
|
// DateTimeOffset dto = new DateTimeOffset((DateTime)dt);
|
||||||
return dto.ToUnixTimeMilliseconds() + (tzOffset * 60000);
|
// return dto.ToUnixTimeMilliseconds() + (tzOffset * 60000);
|
||||||
}
|
// }
|
||||||
|
|
||||||
private static string ColorFromWOItem(ViewSchedulePersonalWorkOrder v, PersonalScheduleParams p)
|
private static string ColorFromWOItem(ViewSchedulePersonalWorkOrder v, PersonalScheduleParams p)
|
||||||
{
|
{
|
||||||
@@ -153,7 +154,6 @@ namespace AyaNova.Api.Controllers
|
|||||||
public class PersonalScheduleParams
|
public class PersonalScheduleParams
|
||||||
{
|
{
|
||||||
public ScheduleView View { get; set; }
|
public ScheduleView View { get; set; }
|
||||||
public int TZOffset { get; set; }
|
|
||||||
public DateTime Start { get; set; }
|
public DateTime Start { get; set; }
|
||||||
public DateTime End { get; set; }
|
public DateTime End { get; set; }
|
||||||
public PersonalScheduleWorkOrderColorSource ColorSource { get; set; }
|
public PersonalScheduleWorkOrderColorSource ColorSource { get; set; }
|
||||||
@@ -164,8 +164,12 @@ namespace AyaNova.Api.Controllers
|
|||||||
|
|
||||||
public class PersonalScheduleListItem
|
public class PersonalScheduleListItem
|
||||||
{
|
{
|
||||||
public long? Start { get; set; }
|
//Never be null dates in here even though source records might be have null dates because they are not queried for and
|
||||||
public long? End { get; set; }
|
//can't be displayed on a calendar anyway
|
||||||
|
//user can simply filter a data table by null dates to see them
|
||||||
|
//we shouldn't have allowed null dates in the first place in v7 but here we are :)
|
||||||
|
public DateTime Start { get; set; }
|
||||||
|
public DateTime End { get; set; }
|
||||||
public bool Timed { get { return true; } }
|
public bool Timed { get { return true; } }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public string Color { get; set; }
|
public string Color { get; set; }
|
||||||
|
|||||||
Reference in New Issue
Block a user