2019-05-17 11:27:51 +00:00
|
|
|
<vn-crud-model
|
|
|
|
vn-id="model"
|
2019-10-24 22:53:53 +00:00
|
|
|
url="WorkerTimeControls/filter"
|
2023-02-21 14:16:28 +00:00
|
|
|
filter="::$ctrl.filter"
|
2019-05-17 11:27:51 +00:00
|
|
|
data="$ctrl.hours">
|
|
|
|
</vn-crud-model>
|
2019-11-21 10:16:10 +00:00
|
|
|
<vn-card class="vn-pa-lg vn-w-lg">
|
2019-11-10 10:08:44 +00:00
|
|
|
<vn-table model="model" auto-load="false">
|
|
|
|
<vn-thead>
|
|
|
|
<vn-tr>
|
2019-11-15 09:37:42 +00:00
|
|
|
<vn-td ng-repeat="weekday in $ctrl.weekDays" center>
|
|
|
|
<div class="weekday" translate>{{::$ctrl.weekdayNames[$index].name}}</div>
|
|
|
|
<div>
|
|
|
|
<span>{{::weekday.dated | date: 'dd'}}</span>
|
|
|
|
<span title="{{::weekday.dated | date: 'MMMM' | translate}}" translate>
|
|
|
|
{{::weekday.dated | date: 'MMMM'}}
|
|
|
|
</span>
|
|
|
|
</div>
|
2023-02-21 14:16:28 +00:00
|
|
|
<vn-chip
|
2019-11-15 09:37:42 +00:00
|
|
|
title="{{::weekday.event.name}}"
|
|
|
|
ng-class="{invisible: !weekday.event}">
|
|
|
|
<vn-avatar
|
|
|
|
ng-style="::{backgroundColor: weekday.event.color}">
|
|
|
|
</vn-avatar>
|
2019-11-05 07:59:48 +00:00
|
|
|
<div>
|
2019-11-15 09:37:42 +00:00
|
|
|
{{::weekday.event.name}}
|
2019-11-05 07:59:48 +00:00
|
|
|
</div>
|
2019-11-15 09:37:42 +00:00
|
|
|
</vn-chip>
|
2019-11-10 10:08:44 +00:00
|
|
|
</vn-td>
|
|
|
|
</vn-tr>
|
|
|
|
</vn-thead>
|
|
|
|
<vn-tbody>
|
|
|
|
<vn-tr>
|
2019-11-21 10:16:10 +00:00
|
|
|
<vn-td ng-repeat="weekday in $ctrl.weekDays" class="hours vn-pa-none" expand>
|
|
|
|
<section ng-repeat="hour in weekday.hours">
|
2019-11-10 10:08:44 +00:00
|
|
|
<vn-icon
|
2019-11-15 09:37:42 +00:00
|
|
|
icon="{{
|
|
|
|
::hour.direction == 'in' ? 'arrow_forward' : 'arrow_back'
|
|
|
|
}}"
|
|
|
|
title="{{
|
|
|
|
::(hour.direction == 'in' ? 'In' : 'Out') | translate
|
|
|
|
}}"
|
|
|
|
ng-class="::{'invisible': hour.direction == 'middle'}">
|
2019-11-10 10:08:44 +00:00
|
|
|
</vn-icon>
|
2019-11-15 09:37:42 +00:00
|
|
|
<vn-chip
|
2021-06-17 13:09:04 +00:00
|
|
|
ng-class="::{'colored': hour.manual, 'clickable': true}"
|
2019-11-15 09:37:42 +00:00
|
|
|
removable="::hour.manual"
|
2021-06-17 13:09:04 +00:00
|
|
|
on-remove="$ctrl.showDeleteDialog($event, hour)"
|
|
|
|
ng-click="$ctrl.edit($event, hour)"
|
|
|
|
>
|
|
|
|
<prepend>
|
|
|
|
<vn-icon icon="edit"
|
|
|
|
vn-tooltip="Edit">
|
|
|
|
</vn-icon>
|
|
|
|
</prepend>
|
2019-11-15 09:37:42 +00:00
|
|
|
{{::hour.timed | date: 'HH:mm'}}
|
2019-11-05 07:59:48 +00:00
|
|
|
</vn-chip>
|
2019-11-10 10:08:44 +00:00
|
|
|
</section>
|
|
|
|
</vn-td>
|
|
|
|
</vn-tr>
|
|
|
|
</vn-tbody>
|
|
|
|
<vn-tfoot>
|
|
|
|
<vn-tr>
|
|
|
|
<vn-td ng-repeat="weekday in $ctrl.weekDays" center>
|
2019-11-15 09:37:42 +00:00
|
|
|
{{$ctrl.formatHours(weekday.workedHours)}} h.
|
2019-11-10 10:08:44 +00:00
|
|
|
</vn-td>
|
|
|
|
</vn-tr>
|
|
|
|
<vn-tr>
|
2023-02-21 14:16:28 +00:00
|
|
|
<vn-td center ng-repeat="weekday in $ctrl.weekDays">
|
2019-11-10 10:08:44 +00:00
|
|
|
<vn-icon-button
|
|
|
|
icon="add_circle"
|
|
|
|
vn-tooltip="Add time"
|
|
|
|
ng-click="$ctrl.showAddTimeDialog(weekday)">
|
|
|
|
</vn-icon-button>
|
|
|
|
</vn-td>
|
|
|
|
</vn-tr>
|
|
|
|
</vn-tfoot>
|
|
|
|
</vn-table>
|
|
|
|
</vn-card>
|
2022-10-31 06:34:34 +00:00
|
|
|
|
2023-03-02 13:55:18 +00:00
|
|
|
<vn-button-bar ng-show="$ctrl.state" class="vn-w-lg">
|
2023-02-21 14:16:28 +00:00
|
|
|
<vn-button
|
|
|
|
label="Satisfied"
|
2023-02-22 14:12:25 +00:00
|
|
|
disabled="$ctrl.state == 'CONFIRMED'"
|
2023-03-02 13:55:18 +00:00
|
|
|
ng-if="$ctrl.isHimSelf"
|
2022-11-02 13:22:18 +00:00
|
|
|
ng-click="$ctrl.isSatisfied()">
|
2022-10-31 06:34:34 +00:00
|
|
|
</vn-button>
|
2023-02-21 14:16:28 +00:00
|
|
|
<vn-button
|
|
|
|
label="Not satisfied"
|
2023-02-22 14:12:25 +00:00
|
|
|
disabled="$ctrl.state == 'REVISE'"
|
2023-03-02 13:55:18 +00:00
|
|
|
ng-if="$ctrl.isHimSelf"
|
2022-11-02 13:22:18 +00:00
|
|
|
ng-click="reason.show()">
|
2022-10-31 06:34:34 +00:00
|
|
|
</vn-button>
|
2023-02-22 14:12:25 +00:00
|
|
|
<vn-button
|
|
|
|
label="Reason"
|
2023-03-02 13:55:18 +00:00
|
|
|
ng-if="$ctrl.reason && ($ctrl.isHimSelf || $ctrl.isHr)"
|
2023-02-22 14:12:25 +00:00
|
|
|
ng-click="reason.show()">
|
|
|
|
</vn-button>
|
|
|
|
<vn-button
|
|
|
|
label="Resend"
|
2023-03-02 13:55:18 +00:00
|
|
|
ng-click="sendEmailConfirmation.show()"
|
2023-02-23 07:21:59 +00:00
|
|
|
class="right"
|
2023-03-02 13:55:18 +00:00
|
|
|
vn-tooltip="Resend email of this week to the user"
|
2023-02-23 07:21:59 +00:00
|
|
|
ng-show="::$ctrl.isHr">
|
2023-02-22 14:12:25 +00:00
|
|
|
</vn-button>
|
2022-10-31 06:34:34 +00:00
|
|
|
</vn-button-bar>
|
2023-02-21 14:16:28 +00:00
|
|
|
|
2019-11-10 10:08:44 +00:00
|
|
|
<vn-side-menu side="right">
|
|
|
|
<div class="vn-pa-md">
|
|
|
|
<div class="totalBox" style="text-align: center;">
|
|
|
|
<h6 translate>Hours</h6>
|
2023-02-21 14:16:28 +00:00
|
|
|
<vn-label-value
|
|
|
|
label="Week total"
|
2019-11-10 10:08:44 +00:00
|
|
|
value="{{$ctrl.weekTotalHours}} h.">
|
|
|
|
</vn-label-value>
|
2023-02-21 14:16:28 +00:00
|
|
|
<vn-label-value
|
|
|
|
label="Finish at"
|
2019-11-15 09:37:42 +00:00
|
|
|
value="{{$ctrl.getFinishTime()}}">
|
|
|
|
</vn-label-value>
|
2019-10-23 15:38:35 +00:00
|
|
|
</div>
|
2019-11-10 10:08:44 +00:00
|
|
|
<vn-calendar
|
2021-11-26 12:26:48 +00:00
|
|
|
vn-id="calendar"
|
2019-11-10 10:08:44 +00:00
|
|
|
class="vn-pt-md"
|
|
|
|
ng-model="$ctrl.date"
|
2023-02-21 14:16:28 +00:00
|
|
|
format-week="$ctrl.formatWeek($element)"
|
2023-03-14 06:44:39 +00:00
|
|
|
on-move="$ctrl.getMailStates($date)"
|
2019-11-10 10:08:44 +00:00
|
|
|
has-events="$ctrl.hasEvents($day)">
|
|
|
|
</vn-calendar>
|
|
|
|
</div>
|
|
|
|
</vn-side-menu>
|
2019-10-23 15:38:35 +00:00
|
|
|
<vn-dialog
|
|
|
|
vn-id="addTimeDialog"
|
2020-07-29 08:47:48 +00:00
|
|
|
on-accept="$ctrl.addTime()"
|
2020-05-06 12:38:09 +00:00
|
|
|
message="Add time">
|
2019-05-17 11:27:51 +00:00
|
|
|
<tpl-body>
|
2020-05-06 12:38:09 +00:00
|
|
|
<vn-input-time
|
|
|
|
vn-one
|
2021-06-17 13:09:04 +00:00
|
|
|
vn-focus
|
|
|
|
ng-model="$ctrl.newTimeEntry.timed"
|
2020-05-06 12:38:09 +00:00
|
|
|
label="Hour"
|
2021-06-17 13:09:04 +00:00
|
|
|
required="true">
|
2020-05-06 12:38:09 +00:00
|
|
|
</vn-input-time>
|
2021-06-17 13:09:04 +00:00
|
|
|
<vn-autocomplete
|
|
|
|
label="Type"
|
|
|
|
ng-model="$ctrl.newTimeEntry.direction"
|
|
|
|
data="$ctrl.entryDirections"
|
|
|
|
select-fields="['code','description']"
|
|
|
|
show-field="description"
|
|
|
|
value-field="code"
|
|
|
|
required="true">
|
|
|
|
</vn-autocomplete>
|
2019-05-17 11:27:51 +00:00
|
|
|
</tpl-body>
|
|
|
|
<tpl-buttons>
|
2019-10-30 15:57:14 +00:00
|
|
|
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
|
|
|
<button response="accept" translate>Save</button>
|
2019-05-17 11:27:51 +00:00
|
|
|
</tpl-buttons>
|
2019-11-05 07:59:48 +00:00
|
|
|
</vn-dialog>
|
|
|
|
<vn-confirm
|
|
|
|
vn-id="delete-entry-dialog"
|
2019-11-05 10:57:05 +00:00
|
|
|
on-accept="$ctrl.deleteTimeEntry()"
|
2019-11-05 07:59:48 +00:00
|
|
|
message="This time entry will be deleted"
|
|
|
|
question="Are you sure you want to delete this entry?">
|
2021-06-17 13:09:04 +00:00
|
|
|
</vn-confirm>
|
|
|
|
|
|
|
|
<!-- Edit entry Popover -->
|
|
|
|
<vn-popover vn-id="editEntry">
|
2021-06-18 10:32:37 +00:00
|
|
|
<vn-horizontal class="vn-pa-sm edit-time-entry">
|
|
|
|
<vn-autocomplete class="dense"
|
2021-06-17 13:09:04 +00:00
|
|
|
ng-model="$ctrl.selectedRow.direction"
|
|
|
|
data="$ctrl.entryDirections"
|
|
|
|
select-fields="['code','description']"
|
|
|
|
show-field="description"
|
|
|
|
value-field="code">
|
|
|
|
</vn-autocomplete>
|
|
|
|
<vn-icon-button vn-none
|
|
|
|
icon="check"
|
|
|
|
vn-tooltip="Save"
|
|
|
|
ng-click="$ctrl.save()">
|
|
|
|
</vn-icon-button>
|
|
|
|
</vn-horizontal>
|
2022-11-02 13:22:18 +00:00
|
|
|
</vn-popover>
|
|
|
|
|
|
|
|
<vn-dialog
|
|
|
|
vn-id="reason"
|
|
|
|
on-accept="$ctrl.isUnsatisfied()">
|
|
|
|
<tpl-body>
|
2023-03-02 13:55:18 +00:00
|
|
|
<div class="reasonDialog">
|
|
|
|
<vn-textarea
|
|
|
|
label="Reason"
|
|
|
|
ng-model="$ctrl.reason"
|
|
|
|
disabled="!$ctrl.isHimSelf"
|
|
|
|
rows="5"
|
|
|
|
required="true">
|
|
|
|
</vn-textarea>
|
|
|
|
</div>
|
2022-11-02 13:22:18 +00:00
|
|
|
</tpl-body>
|
2023-03-02 13:55:18 +00:00
|
|
|
<tpl-buttons ng-if="$ctrl.isHimSelf">
|
2022-11-02 13:22:18 +00:00
|
|
|
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
|
|
|
<button response="accept" translate>Save</button>
|
|
|
|
</tpl-buttons>
|
2023-02-21 14:16:28 +00:00
|
|
|
</vn-dialog>
|
2023-03-02 13:55:18 +00:00
|
|
|
|
|
|
|
<vn-dialog
|
|
|
|
vn-id="sendEmailConfirmation"
|
|
|
|
on-accept="$ctrl.resendEmail()"
|
|
|
|
message="Send time control email">
|
|
|
|
<tpl-body style="min-width: 500px;">
|
|
|
|
<span translate>Are you sure you want to send it?</span>
|
|
|
|
</tpl-body>
|
|
|
|
<tpl-buttons>
|
|
|
|
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
|
|
|
<button response="accept" translate>Confirm</button>
|
|
|
|
</tpl-buttons>
|
|
|
|
</vn-dialog>
|