Skip to content

Commit f4b0984

Browse files
authored
Merge pull request #935 from it-at-m/feature-zmskvr-225-ampel-sachbearbeiteransicht
feat (ZMSKVR-225): improving traffic light and adding to workstation
2 parents 89f5b26 + 1ca7586 commit f4b0984

File tree

5 files changed

+184
-90
lines changed

5 files changed

+184
-90
lines changed

zmsadmin/js/page/workstation/index.js

+12
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ class View extends BaseView {
204204
this.loadAppointmentForm();
205205
if ('counter' == this.page)
206206
this.loadQueueInfo();
207+
if ('workstation' == this.page)
208+
this.loadClientNext();
207209
this.loadQueueTable();
208210
this.loadCalendar();
209211
}, null, event.currentTarget);
@@ -235,6 +237,8 @@ class View extends BaseView {
235237
}).then(() => {
236238
if ('counter' == this.page)
237239
this.loadQueueInfo();
240+
if ('workstation' == this.page)
241+
this.loadClientNext();
238242
this.loadQueueTable();
239243
this.loadCalendar();
240244
hideSpinner(scope.$main);
@@ -259,6 +263,8 @@ class View extends BaseView {
259263
this.loadAppointmentForm();
260264
if ('counter' == this.page)
261265
this.loadQueueInfo();
266+
if ('workstation' == this.page)
267+
this.loadClientNext();
262268
this.loadQueueTable();
263269
this.loadCalendar();
264270
}, scope.$main, event.currentTarget);
@@ -285,6 +291,8 @@ class View extends BaseView {
285291
this.loadAppointmentForm();
286292
if ('counter' == this.page)
287293
this.loadQueueInfo();
294+
if ('workstation' == this.page)
295+
this.loadClientNext();
288296
this.loadQueueTable();
289297
this.loadCalendar();
290298
}, null, event.currentTarget);
@@ -343,6 +351,8 @@ class View extends BaseView {
343351
this.loadAppointmentForm();
344352
if ('counter' == this.page)
345353
this.loadQueueInfo();
354+
if ('workstation' == this.page)
355+
this.loadClientNext();
346356
this.loadQueueTable();
347357
this.loadCalendar();
348358
hideSpinner();
@@ -535,6 +545,8 @@ class View extends BaseView {
535545
if (this.$main.find('.lightbox').length == 0) {
536546
if ('counter' == this.page)
537547
this.loadQueueInfo(false);
548+
if ('workstation' == this.page)
549+
this.loadClientNext(false);
538550
this.loadQueueTable(false);
539551
}
540552
}

zmsadmin/src/Zmsadmin/WorkstationProcess.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
namespace BO\Zmsadmin;
99

10+
use DateTime;
11+
1012
/**
1113
* Init Controller to display next Button Template only
1214
*
@@ -24,6 +26,7 @@ public function readResponse(
2426
) {
2527
$workstation = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 2])->getEntity();
2628
$template = ($workstation->process->hasId() && 'processing' == $workstation->process->status) ? 'info' : 'next';
29+
$selectedDate = (new DateTime())->format('Y-m-d');
2730
if ($workstation->process->hasId() && 'called' == $workstation->process->getStatus()) {
2831
return \BO\Slim\Render::redirect(
2932
'workstationProcessCalled',
@@ -32,11 +35,14 @@ public function readResponse(
3235
)
3336
);
3437
}
38+
$workstationInfo = Helper\WorkstationInfo::getInfoBoxData($workstation, $selectedDate);
3539
return \BO\Slim\Render::withHtml(
3640
$response,
3741
'block/process/' . $template . '.twig',
3842
array(
39-
'workstation' => $workstation
43+
'workstation' => $workstation,
44+
'workstationInfo' => $workstationInfo,
45+
'selectedDate' => $selectedDate
4046
)
4147
);
4248
}
+1-32
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,3 @@
11
<time datetime="{{ getNow()|date("c") }}">
22
<abbr class="currentTime" id="currentTime" aria-live="off" role="timer" aria-label="Aktuelle Uhrzeit">{{ getNow()|date("H:i") }} Uhr</abbr>
3-
</time>
4-
5-
{% if workstationInfo.waitingTimeEstimate %}
6-
| Wartezeit:
7-
<strong>
8-
<span class="color-red">
9-
{% if workstationInfo.waitingTimeEstimate < 60 %}
10-
00:{{ workstationInfo.waitingTimeEstimate }}
11-
{% else %}
12-
{% set minutes = (workstationInfo.waitingTimeEstimate % 60) %}
13-
{% set hours = (workstationInfo.waitingTimeEstimate / 60)|round(0, 'floor') %}
14-
{% if hours < 10 %}0{{ hours }}{% else %}{{ hours }}{% endif %}:{% if minutes < 10 %}0{{ minutes }}{% else %}{{ minutes }}{% endif %}
15-
{% endif %}
16-
</span> {% trans %}Stunden{% endtrans %}
17-
</strong>
18-
{% endif %}
19-
20-
{% if workstationInfo.workstationList %}
21-
{% set toolTip = "" %}
22-
{% set linebreak = "\n" %}
23-
{% for workstation in workstationInfo.workstationList %}
24-
{% if loop.last %}{% set linebreak = "" %}{% endif %}
25-
{% set toolTip = toolTip ~ workstation.useraccount.id ~ " an Platz " ~ workstation.name ~ linebreak %}
26-
{% endfor %}
27-
<span class="tooltip" title="{{ toolTip|e('html') }}">|
28-
{% if workstationInfo.workstationList|length > 1 %}
29-
{{ workstationInfo.workstationList|length }} Arbeitsplätze
30-
{% else %}
31-
{{ workstationInfo.workstationList|length }} Arbeitsplatz
32-
{% endif %}
33-
</span>
34-
{% endif %}
3+
</time>

zmsadmin/templates/block/process/next.twig

+114-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,124 @@
2222
<span class="user"><i class="fas fa-user" aria-hidden="true"></i></span>
2323
<span class="arrow"><i class="fas fa-arrow-alt-circle-right" aria-hidden="true"></i></span>
2424
<span class="text">Aufruf nächster Kunde</span>
25-
</a>
26-
</div>
25+
</button>
26+
</div>
2727
{% endblock %}
2828

2929
{% block board_footer %}
3030
{% include "block/process/footer.twig" %}
31+
32+
<div class="footer-seperator"></div>
33+
34+
<ul class="list list--table bordered">
35+
36+
{% set waiting_customers = workstationInfo.waitingClientsEffective %}
37+
38+
<li class="traffic-light {% if waiting_customers >= 0 and waiting_customers <= 10 %}green
39+
{% elseif waiting_customers >= 11 and waiting_customers <= 20 %}yellow
40+
{% elseif waiting_customers >= 21 and waiting_customers <= 40 %}orange
41+
{% elseif waiting_customers >= 41 %}red
42+
{% endif %}">
43+
<div class="cell middle">
44+
<h4 class="wartende">{% trans %}Wartende{% endtrans %}:</h4>
45+
</div>
46+
<div class="cell right">
47+
<span class="waiting-count">{{ workstationInfo.waitingClientsEffective }}</span>
48+
</div>
49+
</li>
50+
<li>
51+
<div class="cell middle">
52+
<h4>{% trans %}Durchschnittliche Wartezeit von Terminkunden{% endtrans %}:</h4>
53+
</div>
54+
<div class="cell right">
55+
{{ workstationInfo.averageWaitingTimeWithAppointment|round }} Minuten
56+
</div>
57+
</li>
58+
<li>
59+
<div class="cell middle">
60+
<h4>{% trans %}Durchschnittliche Wartezeit von Spontankunden{% endtrans %}:</h4>
61+
</div>
62+
<div class="cell right">
63+
{{ workstationInfo.averageWaitingTimeWithoutAppointment|round }} Minuten
64+
</div>
65+
</li>
66+
<li>
67+
<div class="cell middle">
68+
<h4>{% trans %}Wartezeit für neue Spontankunden{% endtrans %}:</h4>
69+
</div>
70+
<div class="cell right">
71+
{% if workstationInfo.workstationGhostCount == 0 %}
72+
<span class="color-red">{% trans %}unbekannt{% endtrans %}</span>
73+
{% else %}
74+
<strong>
75+
{% if workstationInfo.waitingTimeEstimate < 120 %}
76+
{{ workstationInfo.waitingTimeOptimistic }} - {{ workstationInfo.waitingTimeEstimate }}<br />{{ "%s"|format("Minuten")|trans }}
77+
{% else %}
78+
{% set minutes = (workstationInfo.waitingTimeEstimate % 60) %}
79+
{% set hours = (workstationInfo.waitingTimeEstimate / 60)|round(0, 'floor') %}
80+
{{ "%02d"|format(hours) ~ ':' ~ "%02d"|format(minutes) }}
81+
{% endif %}
82+
</strong>
83+
{% endif %}
84+
</div>
85+
</li>
86+
87+
<style>
88+
.footer-seperator {
89+
margin-top: 10px;
90+
border-top: 1px solid #ddd;
91+
padding-top: 10px;
92+
}
93+
94+
.traffic-light {
95+
display: flex;
96+
width: 100%;
97+
height: 100%;
98+
}
99+
100+
.wartende {
101+
display: flex;
102+
padding-left: 5%;
103+
padding-top: 14px;
104+
}
105+
106+
h4 {
107+
font-weight: normal;
108+
text-align: left;
109+
}
110+
111+
.cell.right {
112+
display: flex;
113+
align-items: center; /* Vertically align the items in the center */
114+
}
115+
116+
.waiting-count {
117+
font-size: 16px; /* Style for the number */
118+
font-weight: bold;
119+
display: flex;
120+
padding-left: 58%;
121+
padding-top: 14px;
122+
}
123+
124+
.green {
125+
background-color: rgba(0, 255, 0, 0.5); /* Green */
126+
}
127+
128+
.yellow {
129+
background-color: rgba(255, 255, 0, 0.5); /* Yellow */
130+
}
131+
132+
.orange {
133+
background-color: rgba(255, 127, 0, 0.5); /* Orange */
134+
}
135+
136+
.red {
137+
background-color: rgba(255, 0, 0, 0.5); /* Red */
138+
}
139+
140+
</style>
141+
</ul>
142+
31143
{% endblock %}
32144

33145
{% endembed %}

zmsadmin/templates/block/queue/info.twig

+50-55
Original file line numberDiff line numberDiff line change
@@ -135,68 +135,63 @@
135135
{{ workstationInfo.averageWaitingTimeWithoutAppointment|round }} Minuten
136136
</div>
137137
</li>
138-
<li>
138+
139+
{% set waiting_customers = workstationInfo.waitingClientsEffective %}
140+
<li class="traffic-light {% if waiting_customers >= 0 and waiting_customers <= 10 %}green
141+
{% elseif waiting_customers >= 11 and waiting_customers <= 20 %}yellow
142+
{% elseif waiting_customers >= 21 and waiting_customers <= 40 %}orange
143+
{% elseif waiting_customers >= 41 %}red
144+
{% endif %}">
139145
<div class="cell middle">
140-
<h4>{% trans %}Wartende{% endtrans %}:</h4>
146+
<h4 class="wartende">{% trans %}Wartende{% endtrans %}:</h4>
141147
</div>
142148
<div class="cell right">
143149
<span class="waiting-count">{{ workstationInfo.waitingClientsEffective }}</span>
144-
145-
{% set waiting_customers = workstationInfo.waitingClientsEffective %}
146-
147-
{% if waiting_customers >= 0 and waiting_customers <= 10 %}
148-
<div class="traffic-light green" title="Grün" alt="Grün"></div>
149-
{% elseif waiting_customers >= 11 and waiting_customers <= 20 %}
150-
<div class="traffic-light yellow" title="Gelb" alt="Gelb"></div>
151-
{% elseif waiting_customers >= 21 and waiting_customers <= 40 %}
152-
<div class="traffic-light orange" title="Orange" alt="Orange"></div>
153-
{% elseif waiting_customers >= 41 %}
154-
<div class="traffic-light red" title="Rot" alt="Rot"></div>
155-
{% endif %}
156150
</div>
157-
</li>
158-
159-
<style>
160-
.cell.right {
161-
display: flex;
162-
align-items: center; /* Vertically align the items in the center */
163-
gap: 10px; /* Adds space between the number and the traffic light */
164-
}
165-
166-
.waiting-count {
167-
font-size: 16px; /* Style for the number */
168-
font-weight: bold;
169-
}
170-
171-
.traffic-light {
172-
width: 12px;
173-
height: 12px;
174-
border-radius: 50%;
175-
display: inline-block;
176-
background-color: #ccc; /* Default background color for unstyled traffic lights */
177-
text-align: center;
178-
line-height: 12px;
179-
color: white;
180-
border: 2px solid #222;
181-
}
182-
183-
.green {
184-
background-color: rgba(0, 255, 0, 0.5); /* Green */
185-
}
186-
187-
.yellow {
188-
background-color: rgba(255, 255, 0, 0.5); /* Yellow */
189-
}
190-
191-
.orange {
192-
background-color: rgba(255, 127, 0, 0.5); /* Orange */
193-
}
151+
</li>
194152

195-
.red {
196-
background-color: rgba(255, 0, 0, 0.5); /* Red */
197-
}
153+
<style>
154+
155+
.traffic-light {
156+
display: flex;
157+
width: 100%;
158+
height: 100%;
159+
}
160+
161+
.wartende {
162+
display: flex;
163+
margin-left: 10px;
164+
}
165+
166+
.cell.right {
167+
display: flex;
168+
align-items: center; /* Vertically align the items in the center */
169+
}
170+
171+
.waiting-count {
172+
font-size: 16px; /* Style for the number */
173+
font-weight: bold;
174+
margin-right: 10px;
175+
}
176+
177+
.green {
178+
background-color: rgba(0, 255, 0, 0.5); /* Green */
179+
}
180+
181+
.yellow {
182+
background-color: rgba(255, 255, 0, 0.5); /* Yellow */
183+
}
184+
185+
.orange {
186+
background-color: rgba(255, 127, 0, 0.5); /* Orange */
187+
}
188+
189+
.red {
190+
background-color: rgba(255, 0, 0, 0.5); /* Red */
191+
}
192+
193+
</style>
198194

199-
</style>
200195
{% endif %}
201196

202197
</ul>

0 commit comments

Comments
 (0)