Commit abc2ddb4 by Daniel Barker

Task Items testing mode/filters, TMS Find Task form, Time Entry details

Task Items
- Testing Mode checkbox: Testing Items shows every column, Task Items hides App, Version, Date and Testing Status. Kept until logout. Task Items button from emT3 opens list in Testing Mode
- Added filtering functionality. My Open Items / All Items / Filters. Filters button opens offcanvas with additional filtering options.
- New Task Item Status column (ITEM_STATUS, codes STATUS); Testing Status now saves STATUS2 codes and displays descriptions. New rows default to OPEN.
- Assigned saves a USER_ID chosen from users employed during the task's dates ("First L."); validated on save.
- Version is now a managed list from the project's existing versions (RenameVersionName / DeleteVersionName).

Time Entries
- Compact View checkbox hides Time and Place; saved per user (users.HIDE_TIME_ENTRIES_FIELDS via SetHideTimeEntriesFields).
- Details button per row edits time_items.DETAILS in an offcanvas.
- Summary limited to 500 characters with inline notices.
- Hours required, zero allowed, negative rejected.
- All focused tasks listed; date problems checked before save via GetTimeEntryDateProblem and shown under the Task field. Date rule now includes the project's start/end dates.

Find Task
- Replace uTaskPickerOffCanvas with the View.TaskPicker TMS popup form.
- All / My / Focused task filter (GetTaskPickerProjects taskFilter).
- Lists every task in the project; unavailable ones show why and can't be selected.
- Footer End Date; SetTaskStatus -> SetTaskStatusAndEndDate (Closed/Complete require an End Date, not before the task's start date).
parent dd94c9fb
...@@ -14,6 +14,7 @@ emT3XDataServer/Source/__history/ ...@@ -14,6 +14,7 @@ emT3XDataServer/Source/__history/
emT3XDataServer/Source/__recovery/ emT3XDataServer/Source/__recovery/
emT3XDataServer/Win32/ emT3XDataServer/Win32/
.validation/ .validation/
.claude/
*.exe *.exe
*.local *.local
......
...@@ -172,6 +172,7 @@ procedure TAuthService.Logout; ...@@ -172,6 +172,7 @@ procedure TAuthService.Logout;
begin begin
DeleteToken; DeleteToken;
DMConnection.currentTaskId := ''; DMConnection.currentTaskId := '';
DMConnection.taskItemsTestingMode := False;
DMConnection.timeEntriesWeekOf := ''; DMConnection.timeEntriesWeekOf := '';
DMConnection.timeEntriesStartDate := ''; DMConnection.timeEntriesStartDate := '';
DMConnection.timeEntriesEndDate := ''; DMConnection.timeEntriesEndDate := '';
......
...@@ -21,6 +21,10 @@ type ...@@ -21,6 +21,10 @@ type
public public
currentTaskId: string; currentTaskId: string;
// Task Items view: True = Testing Items mode (every column), False = Task Items mode
// (App, Version, Date and Testing Status hidden). Set by the screen's Testing Mode
// checkbox and kept until logout or refresh; a direct task_id link always opens in Testing mode.
taskItemsTestingMode: Boolean;
// Time Entries range saved when a row opens Task Items, restored by Back ('' = none) // Time Entries range saved when a row opens Task Items, restored by Back ('' = none)
timeEntriesWeekOf: string; timeEntriesWeekOf: string;
timeEntriesStartDate: string; timeEntriesStartDate: string;
......
...@@ -27,6 +27,7 @@ type ...@@ -27,6 +27,7 @@ type
public public
class procedure Display(logoutProc: TLogoutProc); class procedure Display(logoutProc: TLogoutProc);
procedure ShowTaskItems(const ATaskId: string); procedure ShowTaskItems(const ATaskId: string);
procedure SetTaskItemsTitle(const ATestingMode: Boolean);
procedure ShowTimeEntries; procedure ShowTimeEntries;
end; end;
...@@ -62,7 +63,8 @@ begin ...@@ -62,7 +63,8 @@ begin
end end
else else
begin begin
lblAppTitle.Caption := 'Task Items'; // A direct task_id link opens Task Items in Testing mode
SetTaskItemsTitle(True);
ShowForm(TFTaskItems); ShowForm(TFTaskItems);
end; end;
end; end;
...@@ -80,14 +82,24 @@ begin ...@@ -80,14 +82,24 @@ begin
Application.CreateForm(aFormClass, pnlMain.ElementID, FChildForm); Application.CreateForm(aFormClass, pnlMain.ElementID, FChildForm);
end; end;
// Opened from a Time Entries row; the URL is left as-is, so a refresh lands back on Time Entries // Opened from a Time Entries row; the URL is left as-is, so a refresh lands back on Time Entries.
// Opens in the mode last picked with the screen's Testing Mode checkbox (Task Items at first).
procedure TFViewMain.ShowTaskItems(const ATaskId: string); procedure TFViewMain.ShowTaskItems(const ATaskId: string);
begin begin
DMConnection.currentTaskId := ATaskId; DMConnection.currentTaskId := ATaskId;
lblAppTitle.Caption := 'Task Items'; SetTaskItemsTitle(DMConnection.taskItemsTestingMode);
ShowForm(TFTaskItems); ShowForm(TFTaskItems);
end; end;
// Page title for the Task Items screen's mode; also called when its Testing Mode checkbox changes
procedure TFViewMain.SetTaskItemsTitle(const ATestingMode: Boolean);
begin
if ATestingMode then
lblAppTitle.Caption := 'Testing Items'
else
lblAppTitle.Caption := 'Task Items';
end;
procedure TFViewMain.ShowTimeEntries; procedure TFViewMain.ShowTimeEntries;
begin begin
DMConnection.currentTaskId := ''; DMConnection.currentTaskId := '';
......
...@@ -70,6 +70,42 @@ object FTaskItems: TFTaskItems ...@@ -70,6 +70,42 @@ object FTaskItems: TFTaskItems
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = btnInsertRowClick OnClick = btnInsertRowClick
end end
object btnMyOpenItems: TWebButton
Left = 438
Top = 88
Width = 96
Height = 25
Caption = 'My Open Items'
ElementID = 'btn_my_open_items'
ElementFont = efCSS
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnMyOpenItemsClick
end
object btnAllItems: TWebButton
Left = 438
Top = 119
Width = 96
Height = 25
Caption = 'All Items'
ElementID = 'btn_all_items'
ElementFont = efCSS
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnAllItemsClick
end
object btnFilters: TWebButton
Left = 438
Top = 150
Width = 96
Height = 25
Caption = 'Filters'
ElementID = 'btn_filters'
ElementFont = efCSS
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnFiltersClick
end
object btnCopyRow: TWebButton object btnCopyRow: TWebButton
Left = 78 Left = 78
Top = 210 Top = 210
...@@ -168,9 +204,21 @@ object FTaskItems: TFTaskItems ...@@ -168,9 +204,21 @@ object FTaskItems: TFTaskItems
object xdwdsTasksassignedTo: TStringField object xdwdsTasksassignedTo: TStringField
FieldName = 'assignedTo' FieldName = 'assignedTo'
end end
object xdwdsTasksassignedToDesc: TStringField
FieldName = 'assignedToDesc'
end
object xdwdsTasksstatus: TStringField object xdwdsTasksstatus: TStringField
FieldName = 'status' FieldName = 'status'
end end
object xdwdsTasksstatusDesc: TStringField
FieldName = 'statusDesc'
end
object xdwdsTasksitemStatus: TStringField
FieldName = 'itemStatus'
end
object xdwdsTasksitemStatusDesc: TStringField
FieldName = 'itemStatusDesc'
end
object xdwdsTasksstatusDate: TStringField object xdwdsTasksstatusDate: TStringField
FieldName = 'statusDate' FieldName = 'statusDate'
end end
......
...@@ -4,6 +4,18 @@ ...@@ -4,6 +4,18 @@
<h5 class="mb-0" id="lbl_project_name"></h5> <h5 class="mb-0" id="lbl_project_name"></h5>
<div class="d-flex align-items-center gap-2 ms-auto flex-nowrap"> <div class="d-flex align-items-center gap-2 ms-auto flex-nowrap">
<!-- Checked = Testing Items mode (every column); unchecked = Task Items mode
(App, Version, Date and Testing Status hidden) -->
<div class="form-check mb-0 me-2 text-nowrap">
<input class="form-check-input" type="checkbox" id="chk_testing_items" />
<label class="form-check-label small" for="chk_testing_items"
title="Show the App, Version, Date and Testing Status columns">Testing Mode</label>
</div>
<button id="btn_my_open_items" type="button" class="btn btn-sm btn-outline-secondary text-nowrap">My Open Items</button>
<button id="btn_all_items" type="button" class="btn btn-sm btn-outline-secondary text-nowrap">All Items</button>
<button id="btn_filters" type="button" class="btn btn-sm btn-outline-secondary text-nowrap">Filters</button>
<div id="lbl_total_rows" class="me-2 text-nowrap"></div> <div id="lbl_total_rows" class="me-2 text-nowrap"></div>
<div class="task-toolbar d-flex align-items-center gap-1 px-2 py-1"> <div class="task-toolbar d-flex align-items-center gap-1 px-2 py-1">
...@@ -59,4 +71,26 @@ ...@@ -59,4 +71,26 @@
</button> </button>
</div> </div>
</div> </div>
<div class="offcanvas offcanvas-end" tabindex="-1" id="offcanvasFilters" aria-labelledby="flt_title">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="flt_title">Filters</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<h6>Assigned</h6>
<div id="flt_assigned_list" class="mb-3"></div>
<h6>Task Item Status</h6>
<div id="flt_item_status_list" class="mb-3"></div>
<div id="flt_status_wrap">
<h6>Testing Status</h6>
<div id="flt_status_list" class="mb-3"></div>
</div>
<button id="btn_flt_clear" type="button" class="btn btn-secondary">Clear Filters</button>
</div>
</div>
</div> </div>
object FTaskPicker: TFTaskPicker
Width = 840
Height = 470
CSSLibrary = cssBootstrap
ElementFont = efCSS
OnClose = WebFormClose
OnCloseQuery = WebFormCloseQuery
OnCreate = WebFormCreate
object lblStatus: TWebLabel
Left = 24
Top = 256
Width = 3
Height = 15
ElementID = 'task_picker_status'
ElementFont = efCSS
HeightPercent = 100.000000000000000000
ShowAccelChar = False
Visible = False
WidthPercent = 100.000000000000000000
end
object lblTaskNotice: TWebLabel
Left = 24
Top = 232
Width = 3
Height = 15
ElementID = 'task_picker_task_notice'
ElementFont = efCSS
HeightPercent = 100.000000000000000000
ShowAccelChar = False
Visible = False
WidthPercent = 100.000000000000000000
end
object edtWorkDate: TWebEdit
Left = 24
Top = 64
Width = 121
Height = 22
ElementID = 'task_picker_date'
ElementFont = efCSS
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnChange = edtWorkDateChange
end
object rbAllTasks: TWebRadioButton
Left = 296
Top = 64
Width = 113
Height = 22
Caption = 'All Tasks'
Checked = True
ChildOrder = 1
Color = clNone
ElementID = 'task_picker_task_filter_all'
ElementFont = efCSS
GroupName = 'task_picker_task_filter'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = rbTaskFilterClick
end
object rbMyTasks: TWebRadioButton
Left = 424
Top = 64
Width = 113
Height = 22
Caption = 'My Tasks'
Checked = False
ChildOrder = 2
Color = clNone
ElementID = 'task_picker_task_filter_my'
ElementFont = efCSS
GroupName = 'task_picker_task_filter'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = rbTaskFilterClick
end
object rbFocusedTasks: TWebRadioButton
Left = 552
Top = 64
Width = 113
Height = 22
Caption = 'Focused Tasks'
Checked = False
ChildOrder = 3
Color = clNone
ElementID = 'task_picker_task_filter_focused'
ElementFont = efCSS
GroupName = 'task_picker_task_filter'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = rbTaskFilterClick
end
object cboScope: TWebLookupComboBox
Left = 24
Top = 136
Width = 233
Height = 22
ChildOrder = 4
ElementID = 'task_picker_scope'
ElementFont = efCSS
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnChange = cboScopeChange
ItemIndex = -1
LookupValues = <
item
Value = 'MY'
DisplayText = 'My Projects'
end
item
Value = 'ACTIVE'
DisplayText = 'Active Projects'
end
item
Value = 'ALL'
DisplayText = 'All Projects'
end>
end
object cboCustomer: TWebLookupComboBox
Left = 280
Top = 136
Width = 233
Height = 22
ChildOrder = 5
ElementID = 'task_picker_customer'
ElementFont = efCSS
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnChange = cboCustomerChange
ItemIndex = -1
LookupValues = <>
end
object cboProject: TWebLookupComboBox
Left = 536
Top = 136
Width = 233
Height = 22
ChildOrder = 6
ElementID = 'task_picker_project'
ElementFont = efCSS
Enabled = False
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnChange = cboProjectChange
ItemIndex = -1
LookupValues = <>
end
object cboTask: TWebLookupComboBox
Left = 24
Top = 208
Width = 745
Height = 22
ChildOrder = 7
ElementID = 'task_picker_task'
ElementFont = efCSS
Enabled = False
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnChange = cboTaskChange
ItemIndex = -1
LookupValues = <>
end
object chkFocusedTask: TWebCheckBox
Left = 24
Top = 424
Width = 113
Height = 22
Caption = 'Focused Task'
ChildOrder = 8
ElementID = 'task_picker_add_focus'
ElementFont = efCSS
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = chkFocusedTaskClick
end
object cboTaskStatus: TWebLookupComboBox
Left = 200
Top = 424
Width = 145
Height = 22
ChildOrder = 9
ElementID = 'task_picker_task_status'
ElementFont = efCSS
Enabled = False
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnChange = cboTaskStatusChange
ItemIndex = -1
LookupValues = <>
end
object edtEndDate: TWebEdit
Left = 360
Top = 424
Width = 145
Height = 22
ChildOrder = 14
ElementID = 'task_picker_end_date'
ElementFont = efCSS
Enabled = False
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnChange = edtEndDateChange
end
object btnClose: TWebButton
Left = 752
Top = 16
Width = 25
Height = 25
ChildOrder = 10
ElementID = 'btn_task_picker_close'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnCloseClick
end
object btnCancel: TWebButton
Left = 520
Top = 424
Width = 80
Height = 25
Caption = 'Cancel'
ChildOrder = 11
ElementID = 'btn_task_picker_cancel'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnCancelClick
end
object btnSave: TWebButton
Left = 608
Top = 424
Width = 80
Height = 25
Caption = 'Save'
ChildOrder = 12
ElementID = 'btn_task_picker_save'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
Visible = False
WidthPercent = 100.000000000000000000
OnClick = btnSaveClick
end
object btnSelect: TWebButton
Left = 696
Top = 424
Width = 80
Height = 25
Caption = 'Select'
ChildOrder = 13
ElementID = 'btn_task_picker_select'
ElementFont = efCSS
Enabled = False
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnSelectClick
end
object tmrTaskNotice: TWebTimer
Enabled = False
Interval = 6000
OnTimer = tmrTaskNoticeTimer
Left = 120
Top = 344
end
object xdwcTaskPicker: TXDataWebClient
Connection = DMConnection.ApiConnection
Left = 40
Top = 344
end
end
<!-- Find Task: a TMS popup form (TFTaskPicker), opened from a Time Entries row's task menu.
The popup itself gets its border, rounding and shadow from ElementPopupClassName.
Every input, select and button here is bound to a component in View.TaskPicker.dfm
by its id; the selects' options come from each TWebLookupComboBox's LookupValues. -->
<div class="d-flex flex-column h-100 bg-body">
<div class="d-flex align-items-center justify-content-between px-3 py-2 border-bottom flex-shrink-0">
<h5 class="mb-0" id="task_picker_title">Find Task</h5>
<button type="button" class="btn-close" id="btn_task_picker_close" aria-label="Close"></button>
</div>
<div class="p-3 flex-grow-1 overflow-auto">
<div class="row g-2 align-items-end mb-3">
<div class="col-md-4">
<label for="task_picker_date" class="form-label">Work Date</label>
<input type="date" id="task_picker_date" class="form-control form-control-sm"
title="Select also sets the row's date. Every task is listed, but only one that can take hours on this date can be selected." />
</div>
<!-- Filters the loaded project's task list in the browser, like emT3's
All / My Tasks / Focused on the Time Entry screen -->
<div class="col-md d-flex align-items-center flex-wrap gap-3 pb-1" id="task_picker_task_filter_group">
<div class="form-check form-check-inline m-0">
<input class="form-check-input" type="radio" name="task_picker_task_filter"
id="task_picker_task_filter_all" value="ALL" checked />
<label class="form-check-label" for="task_picker_task_filter_all">All Tasks</label>
</div>
<div class="form-check form-check-inline m-0">
<input class="form-check-input" type="radio" name="task_picker_task_filter"
id="task_picker_task_filter_my" value="MY" />
<label class="form-check-label" for="task_picker_task_filter_my">My Tasks</label>
</div>
<div class="form-check form-check-inline m-0">
<input class="form-check-input" type="radio" name="task_picker_task_filter"
id="task_picker_task_filter_focused" value="FOCUSED" />
<label class="form-check-label" for="task_picker_task_filter_focused">Focused Tasks</label>
</div>
</div>
</div>
<div class="row g-2 align-items-end mb-3">
<div class="col-md">
<label for="task_picker_scope" class="form-label">Show</label>
<select id="task_picker_scope" class="form-select form-select-sm">
<option value="MY" selected>My Projects</option>
<option value="ACTIVE">Active Projects</option>
<option value="ALL">All Projects</option>
</select>
</div>
<div class="col-md" id="task_picker_customer_group">
<label for="task_picker_customer" class="form-label">Customer</label>
<select id="task_picker_customer" class="form-select form-select-sm">
<option value=""></option>
</select>
</div>
<div class="col-md">
<label for="task_picker_project" class="form-label">Project</label>
<select id="task_picker_project" class="form-select form-select-sm" disabled>
<option value=""></option>
</select>
</div>
</div>
<div class="row g-2 align-items-end mb-3">
<div class="col-md">
<label for="task_picker_task" class="form-label">Task</label>
<!-- lblTaskNotice: the red popup Select shows under the Task dropdown for a
task that can't take hours on the Work Date, styled like the Time
Entries Summary's limit popup (css/time-entries.css); starts hidden
through its Visible in the .dfm -->
<div class="time-task-wrap">
<select id="task_picker_task" class="form-select form-select-sm" disabled>
<option value=""></option>
</select>
<div id="task_picker_task_notice" class="time-summary-notice time-summary-notice-error"
role="status" aria-live="polite"></div>
</div>
</div>
</div>
<!-- lblStatus; starts hidden through its Visible in the .dfm -->
<div id="task_picker_status" class="alert alert-danger py-1 px-2 mb-0 small"></div>
</div>
<div class="d-flex align-items-center gap-2 px-3 py-2 border-top flex-shrink-0">
<div class="d-flex align-items-center gap-2">
<input class="form-check-input m-0" type="checkbox" id="task_picker_add_focus" />
<label class="form-check-label mb-0" for="task_picker_add_focus">
Focused Task
</label>
</div>
<!-- The selected task's own status; Save applies it with Focused Task -->
<div class="d-flex align-items-center gap-2 ms-3">
<label for="task_picker_task_status" class="form-label mb-0">Status</label>
<select id="task_picker_task_status" class="form-select form-select-sm" style="width: 9rem;" disabled></select>
</div>
<!-- The selected task's End Date (tasks.COMPLETION_DATE); optional, except
that Closed and Complete need one. Picking a status fills it; Save
stores it with the Status. -->
<div class="d-flex align-items-center gap-2 ms-3 me-auto">
<label for="task_picker_end_date" class="form-label mb-0 text-nowrap">End Date</label>
<input type="date" id="task_picker_end_date" class="form-control form-control-sm" style="width: 9.5rem;" disabled
title="When the task was completed. Hours can't be entered after it." />
</div>
<!-- With unsaved Status, End Date or Focused Task changes, Save shows in place of
Select and Cancel undoes the changes; otherwise Cancel closes.
Save starts hidden through btnSave.Visible in the .dfm. -->
<button type="button" class="btn btn-outline-secondary btn-sm" id="btn_task_picker_cancel">Cancel</button>
<button type="button" class="btn btn-success btn-sm" id="btn_task_picker_save">Save</button>
<button type="button" class="btn btn-primary btn-sm" id="btn_task_picker_select" disabled>Select</button>
</div>
</div>
...@@ -147,6 +147,9 @@ object FTimeEntries: TFTimeEntries ...@@ -147,6 +147,9 @@ object FTimeEntries: TFTimeEntries
object xdwdsTimeEntriessummary: TStringField object xdwdsTimeEntriessummary: TStringField
FieldName = 'summary' FieldName = 'summary'
end end
object xdwdsTimeEntriesdetails: TStringField
FieldName = 'details'
end
object xdwdsTimeEntriesplace: TStringField object xdwdsTimeEntriesplace: TStringField
FieldName = 'place' FieldName = 'place'
end end
......
...@@ -3,6 +3,13 @@ ...@@ -3,6 +3,13 @@
<h5 class="mb-0 text-nowrap" id="lbl_time_entries_title"></h5> <h5 class="mb-0 text-nowrap" id="lbl_time_entries_title"></h5>
<div class="d-flex align-items-center gap-2 ms-auto flex-nowrap"> <div class="d-flex align-items-center gap-2 ms-auto flex-nowrap">
<!-- Compact View hides the Time and Place columns (Hours always shows); saved per user (users.HIDE_TIME_ENTRIES_FIELDS) -->
<div class="form-check mb-0 me-2 text-nowrap">
<input class="form-check-input" type="checkbox" id="chk_hide_time_fields" />
<label class="form-check-label small" for="chk_hide_time_fields"
title="Hide the Time and Place columns">Compact View</label>
</div>
<div id="lbl_time_total_hours" class="me-2 text-nowrap fw-semibold">Total Hours: 0</div> <div id="lbl_time_total_hours" class="me-2 text-nowrap fw-semibold">Total Hours: 0</div>
<div id="lbl_time_total_rows" class="me-2 text-nowrap"></div> <div id="lbl_time_total_rows" class="me-2 text-nowrap"></div>
...@@ -43,86 +50,21 @@ ...@@ -43,86 +50,21 @@
<div id="time_entries_table_host" class="flex-grow-1 min-h-0 overflow-auto"></div> <div id="time_entries_table_host" class="flex-grow-1 min-h-0 overflow-auto"></div>
<div class="modal fade" tabindex="-1" id="task_picker_modal" aria-labelledby="task_picker_title" aria-hidden="true" data-bs-backdrop="static"> <!-- Details (time_items.DETAILS) for one row; OK puts it on the row, the row's Save stores it.
<div class="modal-dialog modal-lg"> Static backdrop so a stray click outside doesn't throw away typed text. -->
<div class="modal-content"> <div class="offcanvas offcanvas-end" tabindex="-1" id="offcanvasTimeDetails" aria-labelledby="time_details_title"
<div class="modal-header"> data-bs-backdrop="static" style="--bs-offcanvas-width: min(40rem, 100vw);">
<h5 class="modal-title" id="task_picker_title">Find Task</h5> <div class="offcanvas-header">
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <h5 class="offcanvas-title" id="time_details_title">Details</h5>
</div> <button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="row g-2 mb-3">
<div class="col-md-4">
<label for="task_picker_date" class="form-label">Work Date</label>
<input type="date" id="task_picker_date" class="form-control form-control-sm"
title="Select also sets the row's date. Only projects and tasks open on this date are listed." />
</div>
</div>
<div class="row g-2 align-items-end mb-3">
<div class="col-md">
<label for="task_picker_scope" class="form-label">Show</label>
<select id="task_picker_scope" class="form-select form-select-sm">
<option value="MY" selected>My Projects</option>
<option value="ACTIVE">Active Projects</option>
<option value="ALL">All Projects</option>
</select>
</div>
<div class="col-md" id="task_picker_customer_group">
<label for="task_picker_customer" class="form-label">Customer</label>
<select id="task_picker_customer" class="form-select form-select-sm">
<option value=""></option>
</select>
</div>
<div class="col-md">
<label for="task_picker_project" class="form-label">Project</label>
<select id="task_picker_project" class="form-select form-select-sm" disabled>
<option value=""></option>
</select>
</div>
</div>
<div class="row g-2 align-items-end mb-3">
<div class="col-md">
<label for="task_picker_task" class="form-label">Task</label>
<select id="task_picker_task" class="form-select form-select-sm" disabled>
<option value=""></option>
</select>
</div>
</div>
<div id="task_picker_status" class="alert alert-danger py-1 px-2 mb-0 d-none small"></div>
</div>
<div class="modal-footer">
<div class="d-flex align-items-center gap-2">
<input class="form-check-input m-0" type="checkbox" id="task_picker_add_focus" />
<label class="form-check-label mb-0" for="task_picker_add_focus">
Focused Task
</label>
</div>
<!-- The selected task's own status; Save applies it with Focused Task -->
<div class="d-flex align-items-center gap-2 ms-3 me-auto">
<label for="task_picker_task_status" class="form-label mb-0">Status</label>
<select id="task_picker_task_status" class="form-select form-select-sm" style="width: 9rem;" disabled></select>
</div>
<button type="button" class="btn btn-outline-secondary btn-sm" data-bs-dismiss="modal">
Cancel
</button>
<button type="button" class="btn btn-outline-success btn-sm" id="btn_task_picker_save" disabled> <div class="offcanvas-body d-flex flex-column">
Save <textarea id="time_details_text" class="form-control flex-grow-1 mb-3" style="resize: none;" aria-labelledby="time_details_title"></textarea>
</button>
<button type="button" class="btn btn-primary btn-sm" id="btn_task_picker_select" disabled> <div class="d-flex justify-content-end gap-2">
Select <button type="button" class="btn btn-outline-secondary btn-sm" data-bs-dismiss="offcanvas">Cancel</button>
</button> <button type="button" class="btn btn-primary btn-sm" id="btn_time_details_ok">OK</button>
</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -42,6 +42,88 @@ ...@@ -42,6 +42,88 @@
min-width: 0; min-width: 0;
} }
/* Summary's 500-character limit: nothing shows while the field sits at the
limit; it only glows briefly when a keystroke or paste runs into it */
.time-summary-wrap {
position: relative;
min-width: 0; /* lets the summary shrink beside the Details button */
}
/* A paste cut short (amber) */
.time-summary-wrap textarea.time-summary-flash {
animation: time-summary-flash 600ms ease-out;
}
@keyframes time-summary-flash {
from {
border-color: var(--bs-warning);
box-shadow: 0 0 0 .3rem rgba(var(--bs-warning-rgb), .6);
}
to {
box-shadow: 0 0 0 .25rem rgba(var(--bs-warning-rgb), 0);
}
}
/* Typing blocked at the limit (red) */
.time-summary-wrap textarea.time-summary-flash-error {
animation: time-summary-flash-error 600ms ease-out;
}
@keyframes time-summary-flash-error {
from {
border-color: var(--bs-danger);
box-shadow: 0 0 0 .3rem rgba(var(--bs-danger-rgb), .6);
}
to {
box-shadow: 0 0 0 .25rem rgba(var(--bs-danger-rgb), 0);
}
}
/* Shown for 6 seconds under the Summary: a paste cut off (amber), or typing
or saving past the 500-character limit (red, below) */
.time-summary-notice {
position: absolute;
top: calc(100% + 2px);
right: 0;
z-index: 6;
padding: .125rem .5rem;
font-size: .75rem;
white-space: nowrap;
color: var(--bs-warning-text-emphasis);
background: var(--bs-warning-bg-subtle);
border: 1px solid var(--bs-warning-border-subtle);
border-radius: var(--bs-border-radius-sm);
box-shadow: var(--bs-box-shadow-sm);
pointer-events: none;
}
/* Same popup in red, for "Maximum length is 500 characters" */
.time-summary-notice.time-summary-notice-error {
color: var(--bs-danger-text-emphasis);
background: var(--bs-danger-bg-subtle);
border-color: var(--bs-danger-border-subtle);
}
/* The same red glow and popup for a task that can't take hours on the date:
under a grid row's Task field when it's saved, and under the Find Task
picker's Task dropdown when Select is clicked */
.time-field-flash-error {
animation: time-summary-flash-error 600ms ease-out;
}
.time-task-wrap {
position: relative;
min-width: 0;
}
/* Left-aligned under the Task field (the Summary's sits at the right) */
.time-task-wrap > .time-summary-notice {
left: 0;
right: auto;
}
.time-table .dropdown-menu { .time-table .dropdown-menu {
z-index: 1055; z-index: 1055;
} }
......
...@@ -18,7 +18,7 @@ uses ...@@ -18,7 +18,7 @@ uses
View.Login in 'View.Login.pas' {FViewLogin: TWebForm} {*.html}, View.Login in 'View.Login.pas' {FViewLogin: TWebForm} {*.html},
View.ErrorPage in 'View.ErrorPage.pas' {FViewErrorPage: TWebForm} {*.html}, View.ErrorPage in 'View.ErrorPage.pas' {FViewErrorPage: TWebForm} {*.html},
View.TimeEntries in 'View.TimeEntries.pas' {FTimeEntries: TWebForm} {*.html}, View.TimeEntries in 'View.TimeEntries.pas' {FTimeEntries: TWebForm} {*.html},
uTaskPickerOffCanvas in 'uTaskPickerOffCanvas.pas'; View.TaskPicker in 'View.TaskPicker.pas' {FTaskPicker: TWebForm} {*.html};
{$R *.res} {$R *.res}
......
...@@ -156,7 +156,10 @@ ...@@ -156,7 +156,10 @@
<Form>FTimeEntries</Form> <Form>FTimeEntries</Form>
<DesignClass>TWebForm</DesignClass> <DesignClass>TWebForm</DesignClass>
</DCCReference> </DCCReference>
<DCCReference Include="uTaskPickerOffCanvas.pas"/> <DCCReference Include="View.TaskPicker.pas">
<Form>FTaskPicker</Form>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<None Include="index.html"/> <None Include="index.html"/>
<None Include="css\app.css"/> <None Include="css\app.css"/>
<None Include="config\config.json"/> <None Include="config\config.json"/>
......
...@@ -11,12 +11,11 @@ procedure ClearTaskStatusClasses(const AElement: TJSHTMLElement); ...@@ -11,12 +11,11 @@ procedure ClearTaskStatusClasses(const AElement: TJSHTMLElement);
procedure ApplyTaskStatusClass(const AElement: TJSHTMLElement; const AStatus: string); procedure ApplyTaskStatusClass(const AElement: TJSHTMLElement; const AStatus: string);
function ExtractOptionNames(const SourceArray: TJSArray): TJSArray; function ExtractOptionNames(const SourceArray: TJSArray): TJSArray;
function ExtractCodeDescs(const SourceArray: TJSArray): TJSArray;
function ExtractAssignedOptionNames(const ResponseResult: TJSObject): TJSArray;
function ExtractReportedOptionNames(const ResponseResult: TJSObject): TJSArray; function ExtractReportedOptionNames(const ResponseResult: TJSObject): TJSArray;
function ExtractApplicationOptionNames(const ResponseResult: TJSObject): TJSArray; function ExtractApplicationOptionNames(const ResponseResult: TJSObject): TJSArray;
function ExtractVersionOptionNames(const ResponseResult: TJSObject): TJSArray;
function FindOptionIgnoreCase(const AItems: TJSArray; const AName: string): string; function FindOptionIgnoreCase(const AItems: TJSArray; const AName: string): string;
function GetOptionsForField(const AFieldName: string; const AApplicationOptions, AReportedByOptions, AAssignedToOptions: TJSArray): TJSArray; function GetOptionsForField(const AFieldName: string; const AApplicationOptions, AVersionOptions, AReportedByOptions: TJSArray): TJSArray;
procedure FocusTrigger(const ATriggerId: string); procedure FocusTrigger(const ATriggerId: string);
...@@ -30,23 +29,24 @@ var ...@@ -30,23 +29,24 @@ var
begin begin
statusText := Trim(AStatus); statusText := Trim(AStatus);
if SameText(statusText, 'Cannot Duplicate') then // Testing Status codes (codes table, CATEGORY = 'TASK', CODE_TYPE = 'STATUS2')
if SameText(statusText, 'CD') then
Result := 'status-cannot-duplicate' Result := 'status-cannot-duplicate'
else if SameText(statusText, 'Cannot Test') then else if SameText(statusText, 'CT') then
Result := 'status-cannot-test' Result := 'status-cannot-test'
else if SameText(statusText, 'Future Enhancement') then else if SameText(statusText, 'FE') then
Result := 'status-future-enhancement' Result := 'status-future-enhancement'
else if SameText(statusText, 'Fixed - Verified') then else if SameText(statusText, 'FV') then
Result := 'status-fixed-verified' Result := 'status-fixed-verified'
else if SameText(statusText, 'Fixed') then else if SameText(statusText, 'FX') then
Result := 'status-fixed' Result := 'status-fixed'
else if SameText(statusText, 'Investigating') then else if SameText(statusText, 'IN') then
Result := 'status-investigating' Result := 'status-investigating'
else if SameText(statusText, 'Not Fixed') then else if SameText(statusText, 'NF') then
Result := 'status-not-fixed' Result := 'status-not-fixed'
else if SameText(statusText, 'Non-Issue') then else if SameText(statusText, 'NI') then
Result := 'status-non-issue' Result := 'status-non-issue'
else if SameText(statusText, 'Possibly a Problem') then else if SameText(statusText, 'PP') then
Result := 'status-possibly-a-problem' Result := 'status-possibly-a-problem'
else else
Result := 'status-default'; Result := 'status-default';
...@@ -96,46 +96,28 @@ begin ...@@ -96,46 +96,28 @@ begin
end; end;
end; end;
function ExtractCodeDescs(const SourceArray: TJSArray): TJSArray; function ExtractReportedOptionNames(const ResponseResult: TJSObject): TJSArray;
var
i: Integer;
optionObj: TJSObject;
begin
Result := TJSArray.new;
if not Assigned(SourceArray) then
Exit;
for i := 0 to SourceArray.length - 1 do
begin
optionObj := TJSObject(SourceArray[i]);
if Assigned(optionObj) then
Result.push(string(optionObj['codeDesc']));
end;
end;
function ExtractAssignedOptionNames(const ResponseResult: TJSObject): TJSArray;
begin begin
if not Assigned(ResponseResult) then if not Assigned(ResponseResult) then
Exit(TJSArray.new); Exit(TJSArray.new);
Result := ExtractOptionNames(TJSArray(ResponseResult['assignedToOptions'])); Result := ExtractOptionNames(TJSArray(ResponseResult['reportedByOptions']));
end; end;
function ExtractReportedOptionNames(const ResponseResult: TJSObject): TJSArray; function ExtractApplicationOptionNames(const ResponseResult: TJSObject): TJSArray;
begin begin
if not Assigned(ResponseResult) then if not Assigned(ResponseResult) then
Exit(TJSArray.new); Exit(TJSArray.new);
Result := ExtractOptionNames(TJSArray(ResponseResult['reportedByOptions'])); Result := ExtractOptionNames(TJSArray(ResponseResult['applicationOptions']));
end; end;
function ExtractApplicationOptionNames(const ResponseResult: TJSObject): TJSArray; function ExtractVersionOptionNames(const ResponseResult: TJSObject): TJSArray;
begin begin
if not Assigned(ResponseResult) then if not Assigned(ResponseResult) then
Exit(TJSArray.new); Exit(TJSArray.new);
Result := ExtractOptionNames(TJSArray(ResponseResult['applicationOptions'])); Result := ExtractOptionNames(TJSArray(ResponseResult['versionOptions']));
end; end;
function FindOptionIgnoreCase(const AItems: TJSArray; const AName: string): string; function FindOptionIgnoreCase(const AItems: TJSArray; const AName: string): string;
...@@ -156,14 +138,14 @@ begin ...@@ -156,14 +138,14 @@ begin
end; end;
end; end;
function GetOptionsForField(const AFieldName: string; const AApplicationOptions, AReportedByOptions, AAssignedToOptions: TJSArray): TJSArray; function GetOptionsForField(const AFieldName: string; const AApplicationOptions, AVersionOptions, AReportedByOptions: TJSArray): TJSArray;
begin begin
if SameText(AFieldName, 'application') then if SameText(AFieldName, 'application') then
Result := AApplicationOptions Result := AApplicationOptions
else if SameText(AFieldName, 'version') then
Result := AVersionOptions
else if SameText(AFieldName, 'reportedBy') then else if SameText(AFieldName, 'reportedBy') then
Result := AReportedByOptions Result := AReportedByOptions
else if SameText(AFieldName, 'assignedTo') then
Result := AAssignedToOptions
else else
Result := nil; Result := nil;
end; end;
......
...@@ -257,7 +257,7 @@ begin ...@@ -257,7 +257,7 @@ begin
Exit; Exit;
end; end;
if not (SameText(FCurrentField, 'assignedTo') or SameText(FCurrentField, 'application') or SameText(FCurrentField, 'reportedBy')) then if not (SameText(FCurrentField, 'application') or SameText(FCurrentField, 'version') or SameText(FCurrentField, 'reportedBy')) then
Exit; Exit;
if FCurrentEditName <> '' then if FCurrentEditName <> '' then
...@@ -356,7 +356,7 @@ begin ...@@ -356,7 +356,7 @@ begin
Event.preventDefault; Event.preventDefault;
Event.stopPropagation; Event.stopPropagation;
if not (SameText(FCurrentField, 'assignedTo') or SameText(FCurrentField, 'application') or SameText(FCurrentField, 'reportedBy')) then if not (SameText(FCurrentField, 'application') or SameText(FCurrentField, 'version') or SameText(FCurrentField, 'reportedBy')) then
Exit; Exit;
el := TJSHTMLElement(Event.currentTarget); el := TJSHTMLElement(Event.currentTarget);
...@@ -383,7 +383,7 @@ begin ...@@ -383,7 +383,7 @@ begin
Event.preventDefault; Event.preventDefault;
Event.stopPropagation; Event.stopPropagation;
if not (SameText(FCurrentField, 'assignedTo') or SameText(FCurrentField, 'application') or SameText(FCurrentField, 'reportedBy')) then if not (SameText(FCurrentField, 'application') or SameText(FCurrentField, 'version') or SameText(FCurrentField, 'reportedBy')) then
Exit; Exit;
el := TJSHTMLElement(Event.currentTarget); el := TJSHTMLElement(Event.currentTarget);
...@@ -401,7 +401,7 @@ procedure TNameManager.OpenManager(const AFieldName: string; const ARowIndex: In ...@@ -401,7 +401,7 @@ procedure TNameManager.OpenManager(const AFieldName: string; const ARowIndex: In
var var
titleEl: TJSHTMLElement; titleEl: TJSHTMLElement;
begin begin
if not (SameText(AFieldName, 'assignedTo') or SameText(AFieldName, 'application') or SameText(AFieldName, 'reportedBy')) then if not (SameText(AFieldName, 'application') or SameText(AFieldName, 'version') or SameText(AFieldName, 'reportedBy')) then
Exit; Exit;
FCurrentField := AFieldName; FCurrentField := AFieldName;
...@@ -414,10 +414,10 @@ begin ...@@ -414,10 +414,10 @@ begin
begin begin
if SameText(AFieldName, 'application') then if SameText(AFieldName, 'application') then
titleEl.innerHTML := 'Manage Application' titleEl.innerHTML := 'Manage Application'
else if SameText(AFieldName, 'reportedBy') then else if SameText(AFieldName, 'version') then
titleEl.innerHTML := 'Manage Reported By' titleEl.innerHTML := 'Manage Version'
else else
titleEl.innerHTML := 'Manage Assigned To'; titleEl.innerHTML := 'Manage Reported By';
end; end;
ResetInputArea; ResetInputArea;
......
...@@ -28,7 +28,13 @@ type ...@@ -28,7 +28,13 @@ type
uqTaskItemsSTATUS_DATE: TDateField; uqTaskItemsSTATUS_DATE: TDateField;
uqTaskItemsREPORTED_BY: TStringField; uqTaskItemsREPORTED_BY: TStringField;
uqTaskItemsASSIGNED_TO: TStringField; uqTaskItemsASSIGNED_TO: TStringField;
uqTaskItemsASSIGNED_USER_ID: TStringField;
uqTaskItemsASSIGNED_FIRST_NAME: TStringField;
uqTaskItemsASSIGNED_LAST_NAME: TStringField;
uqTaskItemsSTATUS: TStringField; uqTaskItemsSTATUS: TStringField;
uqTaskItemsSTATUS_DESC: TStringField;
uqTaskItemsITEM_STATUS: TStringField;
uqTaskItemsITEM_STATUS_DESC: TStringField;
uqTaskItemsFIXED_VERSION: TStringField; uqTaskItemsFIXED_VERSION: TStringField;
uqTaskItemsFORM_SECTION: TStringField; uqTaskItemsFORM_SECTION: TStringField;
uqTaskItemsISSUE: TStringField; uqTaskItemsISSUE: TStringField;
...@@ -49,6 +55,10 @@ type ...@@ -49,6 +55,10 @@ type
uqTaskItemCodesCODE: TStringField; uqTaskItemCodesCODE: TStringField;
uqTaskItemCodesCODE_DESC: TStringField; uqTaskItemCodesCODE_DESC: TStringField;
uqTaskItemCodesCODE_TYPE: TStringField; uqTaskItemCodesCODE_TYPE: TStringField;
uqTaskStatusCodes: TUniQuery;
uqTaskStatusCodesCODE: TStringField;
uqTaskStatusCodesCODE_DESC: TStringField;
uqTaskStatusCodesCODE_TYPE: TStringField;
uqGetTaskRowPosition: TUniQuery; uqGetTaskRowPosition: TUniQuery;
uqMoveTaskRowTemp: TUniQuery; uqMoveTaskRowTemp: TUniQuery;
uqShiftTaskRowsDown: TUniQuery; uqShiftTaskRowsDown: TUniQuery;
...@@ -64,15 +74,14 @@ type ...@@ -64,15 +74,14 @@ type
uqShiftTaskRowsForInsert: TUniQuery; uqShiftTaskRowsForInsert: TUniQuery;
uqProjectReportedUsers: TUniQuery; uqProjectReportedUsers: TUniQuery;
uqTaskAssignedUsers: TUniQuery; uqTaskAssignedUsers: TUniQuery;
uqAssignedInsert: TUniQuery; uqTaskAssignedUsersUSER_ID: TStringField;
uqAssignedRename: TUniQuery; uqTaskAssignedUsersFIRST_NAME: TStringField;
uqAssignedDelete: TUniQuery; uqTaskAssignedUsersLAST_NAME: TStringField;
uqRenameAssignedTo: TUniQuery; uqCheckAssignedUser: TUniQuery;
uqBlankAssignedTo: TUniQuery; uqProjectVersions: TUniQuery;
uqTaskAssignedUsersTASK_ITEM_USER_ID: TStringField; uqProjectVersionsNAME: TStringField;
uqTaskAssignedUsersTASK_ID: TStringField; uqRenameTaskItemVersion: TUniQuery;
uqTaskAssignedUsersUSER_TYPE: TStringField; uqBlankTaskItemVersion: TUniQuery;
uqTaskAssignedUsersNAME: TStringField;
uqProjectApplications: TUniQuery; uqProjectApplications: TUniQuery;
uqApplicationInsert: TUniQuery; uqApplicationInsert: TUniQuery;
uqApplicationRename: TUniQuery; uqApplicationRename: TUniQuery;
......
...@@ -25,7 +25,11 @@ type ...@@ -25,7 +25,11 @@ type
taskDate: TDateTime; taskDate: TDateTime;
reportedBy: string; reportedBy: string;
assignedTo: string; assignedTo: string;
assignedToDesc: string;
status: string; status: string;
statusDesc: string;
itemStatus: string;
itemStatusDesc: string;
statusDate: TDateTime; statusDate: TDateTime;
fixedVersion: string; fixedVersion: string;
formSection: string; formSection: string;
...@@ -48,11 +52,22 @@ type ...@@ -48,11 +52,22 @@ type
name: string; name: string;
end; end;
TTaskAssignedUserOption = class
public
userId: string;
name: string;
end;
TTaskApplicationOption = class TTaskApplicationOption = class
public public
name: string; name: string;
end; end;
TTaskVersionOption = class
public
name: string;
end;
TTaskItemCode = class TTaskItemCode = class
public public
code: string; code: string;
...@@ -66,16 +81,17 @@ type ...@@ -66,16 +81,17 @@ type
task: TTaskHeader; task: TTaskHeader;
items: TList<TTaskItem>; items: TList<TTaskItem>;
applicationOptions: TList<TTaskApplicationOption>; applicationOptions: TList<TTaskApplicationOption>;
versionOptions: TList<TTaskVersionOption>;
reportedByOptions: TList<TTaskUserOption>; reportedByOptions: TList<TTaskUserOption>;
assignedToOptions: TList<TTaskUserOption>; assignedToOptions: TList<TTaskAssignedUserOption>;
statusOptions: TList<TTaskItemCode>; statusOptions: TList<TTaskItemCode>;
itemStatusOptions: TList<TTaskItemCode>;
constructor Create; constructor Create;
destructor Destroy; override; destructor Destroy; override;
end; end;
TTaskUserOptionsResponse = class TTaskUserOptionsResponse = class
public public
assignedToOptions: TList<TTaskUserOption>;
reportedByOptions: TList<TTaskUserOption>; reportedByOptions: TList<TTaskUserOption>;
constructor Create; constructor Create;
destructor Destroy; override; destructor Destroy; override;
...@@ -88,6 +104,13 @@ type ...@@ -88,6 +104,13 @@ type
destructor Destroy; override; destructor Destroy; override;
end; end;
TTaskVersionOptionsResponse = class
public
versionOptions: TList<TTaskVersionOption>;
constructor Create;
destructor Destroy; override;
end;
TTaskRowSave = class TTaskRowSave = class
public public
taskItemId: integer; taskItemId: integer;
...@@ -122,11 +145,6 @@ type ...@@ -122,11 +145,6 @@ type
[HttpPost] function AddTaskRow(taskId: string; insertAfterItemNum: Integer): Boolean; [HttpPost] function AddTaskRow(taskId: string; insertAfterItemNum: Integer): Boolean;
[HttpPost] function CopyTaskRow(taskId: string; sourceTaskItemId: Integer): Integer; [HttpPost] function CopyTaskRow(taskId: string; sourceTaskItemId: Integer): Integer;
[HttpPost] function AddAssignedName(taskId: string; name: string): TTaskUserOptionsResponse;
[HttpPost] function RenameAssignedName(taskId: string; oldName: string; newName: string): TTaskUserOptionsResponse;
[HttpPost] function DeleteAssignedName(taskId: string; name: string): TTaskUserOptionsResponse;
[HttpPost] function AddReportedName(taskId: string; name: string): TTaskUserOptionsResponse; [HttpPost] function AddReportedName(taskId: string; name: string): TTaskUserOptionsResponse;
[HttpPost]function RenameReportedName(taskId: string; oldName: string; newName: string): TTaskUserOptionsResponse; [HttpPost]function RenameReportedName(taskId: string; oldName: string; newName: string): TTaskUserOptionsResponse;
[HttpPost]function DeleteReportedName(taskId: string; name: string): TTaskUserOptionsResponse; [HttpPost]function DeleteReportedName(taskId: string; name: string): TTaskUserOptionsResponse;
...@@ -135,6 +153,11 @@ type ...@@ -135,6 +153,11 @@ type
[HttpPost] function RenameApplicationName(taskId: string; oldName: string; newName: string): TTaskApplicationOptionsResponse; [HttpPost] function RenameApplicationName(taskId: string; oldName: string; newName: string): TTaskApplicationOptionsResponse;
[HttpPost] function DeleteApplicationName(taskId: string; name: string): TTaskApplicationOptionsResponse; [HttpPost] function DeleteApplicationName(taskId: string; name: string): TTaskApplicationOptionsResponse;
// Versions have no table of their own: the list is the versions already used in the project,
// so adding one is just saving it on a row
[HttpPost] function RenameVersionName(taskId: string; oldName: string; newName: string): TTaskVersionOptionsResponse;
[HttpPost] function DeleteVersionName(taskId: string; name: string): TTaskVersionOptionsResponse;
[HttpPost] procedure MoveTaskRow(const taskId: Integer; const taskItemId: Integer; const newItemNum: Integer); [HttpPost] procedure MoveTaskRow(const taskId: Integer; const taskItemId: Integer; const newItemNum: Integer);
[HttpPost] function DeleteTaskRow(const taskId: Integer; const taskItemId: Integer): Boolean; [HttpPost] function DeleteTaskRow(const taskId: Integer; const taskItemId: Integer): Boolean;
[HttpPost] function SaveTaskItemField(const Item: TTaskItemFieldSave): Boolean; [HttpPost] function SaveTaskItemField(const Item: TTaskItemFieldSave): Boolean;
...@@ -148,32 +171,34 @@ begin ...@@ -148,32 +171,34 @@ begin
inherited; inherited;
items := TList<TTaskItem>.Create; items := TList<TTaskItem>.Create;
applicationOptions := TList<TTaskApplicationOption>.Create; applicationOptions := TList<TTaskApplicationOption>.Create;
versionOptions := TList<TTaskVersionOption>.Create;
reportedByOptions := TList<TTaskUserOption>.Create; reportedByOptions := TList<TTaskUserOption>.Create;
assignedToOptions := TList<TTaskUserOption>.Create; assignedToOptions := TList<TTaskAssignedUserOption>.Create;
statusOptions := TList<TTaskItemCode>.Create; statusOptions := TList<TTaskItemCode>.Create;
itemStatusOptions := TList<TTaskItemCode>.Create;
end; end;
destructor TTaskItemsResponse.Destroy; destructor TTaskItemsResponse.Destroy;
begin begin
items.Free; items.Free;
applicationOptions.Free; applicationOptions.Free;
versionOptions.Free;
reportedByOptions.Free; reportedByOptions.Free;
assignedToOptions.Free; assignedToOptions.Free;
statusOptions.Free; statusOptions.Free;
itemStatusOptions.Free;
inherited; inherited;
end; end;
constructor TTaskUserOptionsResponse.Create; constructor TTaskUserOptionsResponse.Create;
begin begin
inherited; inherited;
assignedToOptions := TList<TTaskUserOption>.Create;
reportedByOptions := TList<TTaskUserOption>.Create; reportedByOptions := TList<TTaskUserOption>.Create;
end; end;
destructor TTaskUserOptionsResponse.Destroy; destructor TTaskUserOptionsResponse.Destroy;
begin begin
assignedToOptions := TList<TTaskUserOption>.Create; reportedByOptions.Free;
reportedByOptions := TList<TTaskUserOption>.Create;
inherited; inherited;
end; end;
...@@ -189,6 +214,18 @@ begin ...@@ -189,6 +214,18 @@ begin
inherited; inherited;
end; end;
constructor TTaskVersionOptionsResponse.Create;
begin
inherited;
versionOptions := TList<TTaskVersionOption>.Create;
end;
destructor TTaskVersionOptionsResponse.Destroy;
begin
versionOptions.Free;
inherited;
end;
initialization initialization
RegisterServiceType(TypeInfo(ITaskItemService)); RegisterServiceType(TypeInfo(ITaskItemService));
......
...@@ -25,6 +25,7 @@ type ...@@ -25,6 +25,7 @@ type
category: string; category: string;
categoryDesc: string; categoryDesc: string;
summary: string; summary: string;
details: string;
end; end;
TTimeEntryTaskOption = class TTimeEntryTaskOption = class
...@@ -46,6 +47,7 @@ type ...@@ -46,6 +47,7 @@ type
userName: string; userName: string;
userStartDate: string; // yyyy-mm-dd employment window, '' = open-ended userStartDate: string; // yyyy-mm-dd employment window, '' = open-ended
userEndDate: string; userEndDate: string;
hideTimeEntriesFields: Boolean; // users.HIDE_TIME_ENTRIES_FIELDS = 'T': Compact View (hide Time and Place)
count: Integer; count: Integer;
items: TList<TTimeEntry>; items: TList<TTimeEntry>;
taskOptions: TList<TTimeEntryTaskOption>; taskOptions: TList<TTimeEntryTaskOption>;
...@@ -61,11 +63,12 @@ type ...@@ -61,11 +63,12 @@ type
userId: string; userId: string;
taskDate: string; taskDate: string;
taskId: string; taskId: string;
hours: Double; hours: Nullable<Double>; // required, 0 allowed; nullable so a missing value is rejected, not saved as 0
taskTime: string; taskTime: string;
place: string; place: string;
category: string; category: string;
summary: string; summary: string;
details: string;
end; end;
TTaskPickerOption = class TTaskPickerOption = class
...@@ -74,8 +77,11 @@ type ...@@ -74,8 +77,11 @@ type
display: string; display: string;
customerId: string; customerId: string;
completed: Boolean; // tasks only: COMPLETION_DATE is set completed: Boolean; // tasks only: COMPLETION_DATE is set
completionDate: string; // tasks only: COMPLETION_DATE as 'yyyy-mm-dd' (the picker's End Date), '' = none
unavailableReason: string; // tasks only: why hours can't go on the picker date, '' = allowed unavailableReason: string; // tasks only: why hours can't go on the picker date, '' = allowed
status: string; // tasks only: task status code status: string; // tasks only: task status code
assigned: Boolean; // tasks only: the user has a task_assigned_user row (My Tasks)
focused: Boolean; // tasks only: that row has FOCUSED_TASK = 'T' (Focused Tasks)
end; end;
TTaskPickerOptionsResponse = class TTaskPickerOptionsResponse = class
...@@ -98,13 +104,17 @@ type ...@@ -98,13 +104,17 @@ type
[HttpGet] function GetTimeEntries(userId, startDate, endDate, keptEntryIds: string): TTimeEntriesResponse; [HttpGet] function GetTimeEntries(userId, startDate, endDate, keptEntryIds: string): TTimeEntriesResponse;
[HttpPost] function AddTimeEntry(userId, taskDate: string): string; [HttpPost] function AddTimeEntry(userId, taskDate: string): string;
[HttpPost] function SaveTimeEntry(Item: TTimeEntrySave): string; [HttpPost] function SaveTimeEntry(Item: TTimeEntrySave): string;
// Why hours can't go on taskDate for this user and task ('' = allowed); the
// grid asks before SaveTimeEntry, which still enforces the same rule
function GetTimeEntryDateProblem(userId, taskId, taskDate: string): string;
[HttpPost] function DeleteTimeEntry(userId: string; entryId: Integer): Boolean; [HttpPost] function DeleteTimeEntry(userId: string; entryId: Integer): Boolean;
[HttpPost] function AddTaskToFocus(userId, taskId: string): Boolean; [HttpPost] function AddTaskToFocus(userId, taskId: string): Boolean;
[HttpPost] function RemoveTaskFromFocus(userId, taskId: string): Boolean; [HttpPost] function RemoveTaskFromFocus(userId, taskId: string): Boolean;
[HttpPost] function SetTaskStatus(taskId, status, taskDate: string): Boolean; [HttpPost] function SetTaskStatusAndEndDate(taskId, status, endDate: string): Boolean;
[HttpPost] function SetHideTimeEntriesFields(userId: string; hide: Boolean): Boolean;
function GetTaskPickerCustomers: TTaskPickerOptionsResponse; function GetTaskPickerCustomers: TTaskPickerOptionsResponse;
function GetTaskPickerStatuses: TTaskPickerOptionsResponse; function GetTaskPickerStatuses: TTaskPickerOptionsResponse;
function GetTaskPickerProjects(customerId, scope, userId, taskDate: string): TTaskPickerOptionsResponse; function GetTaskPickerProjects(customerId, scope, userId, taskDate, taskFilter: string): TTaskPickerOptionsResponse;
function GetTaskPickerTasks(projectId, userId, taskDate: string): TTaskPickerOptionsResponse; function GetTaskPickerTasks(projectId, userId, taskDate: string): TTaskPickerOptionsResponse;
function GetTaskPickerTaskContext(taskId: string): TTaskPickerTaskContext; function GetTaskPickerTaskContext(taskId: string): TTaskPickerTaskContext;
end; end;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
MemoLogLevel=5 MemoLogLevel=5
FileLogLevel=5 FileLogLevel=5
webClientVersion=0.9.4.1 webClientVersion=0.9.4.1
LogFileNum=243 LogFileNum=269
[Database] [Database]
--Server=192.168.102.131 --Server=192.168.102.131
......
...@@ -114,11 +114,11 @@ ...@@ -114,11 +114,11 @@
<VerInfo_Locale>1033</VerInfo_Locale> <VerInfo_Locale>1033</VerInfo_Locale>
<DCC_ExeOutput>.\bin</DCC_ExeOutput> <DCC_ExeOutput>.\bin</DCC_ExeOutput>
<DCC_UnitSearchPath>C:\RADTOOLS\FastMM4;$(DCC_UnitSearchPath)</DCC_UnitSearchPath> <DCC_UnitSearchPath>C:\RADTOOLS\FastMM4;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_Keys>CompanyName=EM Systems;FileDescription=$(MSBuildProjectName);FileVersion=0.9.4.1;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=0.9.11;Comments=</VerInfo_Keys> <VerInfo_Keys>CompanyName=EM Systems;FileDescription=$(MSBuildProjectName);FileVersion=0.9.4.3;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=0.9.11;Comments=</VerInfo_Keys>
<VerInfo_MajorVer>0</VerInfo_MajorVer> <VerInfo_MajorVer>0</VerInfo_MajorVer>
<VerInfo_MinorVer>9</VerInfo_MinorVer> <VerInfo_MinorVer>9</VerInfo_MinorVer>
<VerInfo_AutoIncVersion>true</VerInfo_AutoIncVersion> <VerInfo_AutoIncVersion>false</VerInfo_AutoIncVersion>
<VerInfo_Build>1</VerInfo_Build> <VerInfo_Build>3</VerInfo_Build>
<VerInfo_Release>4</VerInfo_Release> <VerInfo_Release>4</VerInfo_Release>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''"> <PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
......
-- emT3 web: database update for Task Items testing mode, Compact View and Time Entry details
-- MariaDB. Safe to re-run. Note: ALTER TABLE auto-commits, so this can't run as one transaction.
--
-- Before running: make sure the STATUS2 descriptions in step 3 match the ones used on dev,
-- since step 4 converts existing task_items.STATUS values by matching on CODE_DESC.
-- To undo the status conversion, restore task_items from task_items_bak_20261126.
-- 1. Back up task_items before converting Testing Status values
CREATE TABLE IF NOT EXISTS task_items_bak_20261126 AS
SELECT * FROM task_items;
-- 2. New columns
-- Task Item Status (codes TASK / STATUS); existing rows stay blank, new rows default to OPEN
ALTER TABLE task_items
ADD COLUMN IF NOT EXISTS ITEM_STATUS varchar(7) DEFAULT NULL AFTER NOTES;
-- Time Entries Compact View (hides Time and Place), saved per user
ALTER TABLE users
ADD COLUMN IF NOT EXISTS HIDE_TIME_ENTRIES_FIELDS varchar(1) DEFAULT 'F' AFTER AUTO_LAUNCH_TASK_TRACKER;
-- Time Entry Details offcanvas
ALTER TABLE time_items
ADD COLUMN IF NOT EXISTS DETAILS text DEFAULT NULL AFTER SUMMARY;
-- 3. Testing Status codes (codes TASK / STATUS2)
INSERT IGNORE INTO codes (CATEGORY, CODE_TYPE, CODE, CODE_DESC, CREATE_DATE) VALUES
('TASK', 'STATUS2', 'CD', 'Cannot Duplicate', NOW()),
('TASK', 'STATUS2', 'CT', 'Cannot Test', NOW()),
('TASK', 'STATUS2', 'FE', 'Future Enhancement', NOW()),
('TASK', 'STATUS2', 'FV', 'Fixed - Verified', NOW()),
('TASK', 'STATUS2', 'FX', 'Fixed', NOW()),
('TASK', 'STATUS2', 'IN', 'Investigating', NOW()),
('TASK', 'STATUS2', 'NF', 'Not Fixed', NOW()),
('TASK', 'STATUS2', 'NI', 'Non-Issue', NOW()),
('TASK', 'STATUS2', 'PP', 'Possibly a Problem', NOW());
-- 4. Convert existing Testing Status descriptions to their codes
UPDATE task_items ti
JOIN codes c
ON c.CATEGORY = 'TASK'
AND c.CODE_TYPE = 'STATUS2'
AND c.CODE_DESC = TRIM(ti.STATUS)
SET ti.STATUS = c.CODE;
-- 5. Checks
-- a) Testing Status values that still aren't a code (should return no rows)
SELECT ti.STATUS, COUNT(*) AS ROW_COUNT
FROM task_items ti
WHERE TRIM(IFNULL(ti.STATUS, '')) <> ''
AND ti.STATUS NOT IN (SELECT CODE FROM codes WHERE CATEGORY = 'TASK' AND CODE_TYPE = 'STATUS2')
GROUP BY ti.STATUS;
-- b) Task Item Status list (must include OPEN, which new rows default to)
SELECT CODE, CODE_DESC FROM codes WHERE CATEGORY = 'TASK' AND CODE_TYPE = 'STATUS' ORDER BY CODE_DESC;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment