Skip to content

Commit c914cc0

Browse files
committed
Adding the ability to register time in history when using punch clock
1 parent 932ac55 commit c914cc0

4 files changed

Lines changed: 13 additions & 0 deletions

File tree

eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Infrastructure/Models/Settings/AssignedSite.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ public class AssignedSite
154154
public bool UsePunchClock { get; set; }
155155

156156
public bool UseDetailedPauseEditing { get; set; }
157+
public bool UsePunchClockWithAllowRegisteringInHistory { get; set; }
157158

158159
// implicit conversion from Microting.TimePlanningBase.Infrastructure.Data.Entities.AssignedSite to AssignedSite
159160
public static implicit operator AssignedSite(
@@ -301,6 +302,7 @@ public static implicit operator AssignedSite(
301302
UseOnlyPlanHours = model.UseOnlyPlanHours,
302303
UsePunchClock = model.UsePunchClock,
303304
UseDetailedPauseEditing = model.UseDetailedPauseEditing,
305+
UsePunchClockWithAllowRegisteringInHistory = model.UsePunchClockWithAllowRegisteringInHistory,
304306
};
305307
}
306308
}

eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Services/TimePlanningSettingService/TimeSettingService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,7 @@ public async Task<OperationResult> UpdateAssignedSite(Infrastructure.Models.Sett
655655
dbAssignedSite.FridayPlanHours = site.FridayPlanHours;
656656
dbAssignedSite.SaturdayPlanHours = site.SaturdayPlanHours;
657657
dbAssignedSite.SundayPlanHours = site.SundayPlanHours;
658+
dbAssignedSite.UsePunchClockWithAllowRegisteringInHistory = site.UsePunchClockWithAllowRegisteringInHistory;
658659

659660
await dbAssignedSite.Update(_dbContext);
660661

eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-planning-actions/assigned-site/assigned-site-dialog.component.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@
7676
{{ 'Use punch clock' | translate }}
7777
</mat-checkbox>
7878
</div>
79+
<div class="d-flex flex-row" *ngIf="data.allowPersonalTimeRegistration && !data.allowAcceptOfPlannedHours && data.usePunchClock">
80+
<!-- data.allowPersonalTimeRegistration -->
81+
<mat-checkbox class="p-1"
82+
[id]="'usePunchClockWithAllowRegisteringInHistory'"
83+
[name]="'usePunchClockWithAllowRegisteringInHistory'"
84+
[(ngModel)]="data.usePunchClockWithAllowRegisteringInHistory">
85+
{{ 'Allow registering time in history for punch clock' | translate }}
86+
</mat-checkbox>
87+
</div>
7988
<div class="d-flex flex-row" *ngIf="data.allowPersonalTimeRegistration && !data.usePunchClock && selectCurrentUserIsFirstUser$ | async">
8089
<!-- data.allowAcceptOfPlannedHours -->
8190
<mat-checkbox class="p-1"

eform-client/src/app/plugins/modules/time-planning-pn/models/assigned-sites/assigned-site.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,5 @@ export class AssignedSiteModel {
154154
useGoogleSheetAsDefault: boolean;
155155
useOnlyPlanHours: boolean;
156156
usePunchClock: boolean;
157+
usePunchClockWithAllowRegisteringInHistory: boolean
157158
}

0 commit comments

Comments
 (0)