Skip to content

Commit

Permalink
Merge main into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
manjencic committed Dec 4, 2023
2 parents bb71716 + d098455 commit e8751b1
Show file tree
Hide file tree
Showing 49 changed files with 446 additions and 1,590 deletions.
5 changes: 2 additions & 3 deletions zmsadmin/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@
"psr/http-message": "^1.0",
"container-interop/container-interop": "^1.2",
"twig/intl-extra": "^3.4",
"twig/twig": "3.*",
"symfony/polyfill-intl-icu": "^1.21"
"twig/twig": "3.*"
},
"bin": [],
"autoload": {
Expand All @@ -55,4 +54,4 @@
"BO\\Zmsadmin\\Tests\\": "tests/Zmsadmin/"
}
}
}
}
5 changes: 1 addition & 4 deletions zmsadmin/js/block/calldisplay/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,7 @@ class CallDisplayConfigView extends Component {
{ name: 'Uhrzeit, Anzahl Wartende, Wartezeit, 6-12 Aufrufe | Raum', value: 'clocknrwaitraum' },
{ name: '4-8 Aufrufe, nur Zahlen | Tür', value: 'rawdoor4-8' },
{ name: '6-18 Aufrufe | Tür', value: 'raw18door' },
{ name: '6-18 Aufrufe | Platz', value: 'raw18platz' },
{ name: '10 Aufrufe | Platz', value: 'default_platz' },
{ name: '10 Aufrufe | Tür', value: 'default_tuer' },
{ name: '10 Aufrufe | Raum', value: 'default_raum' }
{ name: '6-18 Aufrufe | Platz', value: 'raw18platz' }
]}
value={this.state.template}
onChange={onTemplateStatusChange} />
Expand Down
348 changes: 346 additions & 2 deletions zmsadmin/public/_js/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion zmsadmin/src/Zmsadmin/Helper/ClusterHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static function getNextProcess($excludedIds)
$queueList = static::getProcessList(\App::$now->format('Y-m-d'))
->toQueueList(\App::$now)
->withoutStatus(['fake','missed']);
$excludedIds = (0 < $queueList->count()) ? $excludedIds : '';
$excludedIds = (1 < $queueList->count()) ? $excludedIds : '';

if (1 > $queueList->count()) {
return new \BO\Zmsentities\Process();
Expand Down
1 change: 0 additions & 1 deletion zmsadmin/src/Zmsadmin/Helper/GraphDefaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ public static function getProcess()
id
status
createTimestamp
timeoutTime
reminderTimestamp
appointments{
date
Expand Down
9 changes: 0 additions & 9 deletions zmsadmin/src/Zmsadmin/WorkstationProcessNext.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,12 @@

namespace BO\Zmsadmin;

use \BO\Zmsentities\Collection\ProcessList;

class WorkstationProcessNext extends BaseController
{
/**
* @SuppressWarnings(Param)
* @return String
*/

public function timeToUnix($timeString)
{
list($hours, $minutes, $seconds) = explode(':', $timeString);
return mktime($hours, $minutes, $seconds);
}

public function readResponse(
\Psr\Http\Message\RequestInterface $request,
\Psr\Http\Message\ResponseInterface $response,
Expand Down
119 changes: 52 additions & 67 deletions zmsadmin/templates/block/queue/table.twig
Original file line number Diff line number Diff line change
Expand Up @@ -128,24 +128,12 @@
{% if item.queue.status == "reserved" %}
Reservierung
{% else %}
{% set familyName = item.clients|first.familyName|decodeEntities|raw %}
{% set currentTime = "now"|date('U') %}
{% set timeoutTime = item.timeoutTime|date('U') %}
{% set fiveMinutes = 300 %}
{% set timeDiff = currentTime - timeoutTime %}
{% set callCount = "" %}

{% set familyName = item.clients|first.familyName|decodeEntities|raw %}
{% if item.queue.callCount > 0 %}
{% set callCount = "<small>(%d)</small>"|format(item.queue.callCount) %}
{% endif %}

{% if timeDiff < fiveMinutes and item.queue.callCount > 0 %}
{% set remainingTime = fiveMinutes - timeDiff %}
{% set remainingMinutes = (remainingTime // 60) %}
{% set remainingSeconds = remainingTime % 60 %}
{% set formattedTime = '%02d:%02d'|format(remainingMinutes, remainingSeconds) %}
<b>{{ familyName }}</b> {{ callCount|raw }} war um {{ item.timeoutTime }} Uhr nicht anwesend und kann in {{ formattedTime }} Minuten wieder aufgerufen werden.
{% elseif source != 'counter' and (workstation.scope.id == item.scope.id or allowClusterWideCall) and isToday %}
{% if source != 'counter' and (workstation.scope.id == item.scope.id or allowClusterWideCall) and isToday %}
<a title="{% trans %}Diesen Bürger aufrufen{% endtrans %}" href="{{ urlGet('workstation', {}, {'calledprocess': item.id}) }}" data-process="{{ item.id }}">{{ familyName }}</a> {{ callCount|raw }}
{% else %}
{{ familyName }} {{ callCount|raw }}
Expand Down Expand Up @@ -228,60 +216,57 @@
<h2>Verpasste Termine</h2>
{% if processListMissed|length %}
<div class="table-responsive-wrapper">
<table class="table--base queue-missed">
<thead>
<tr>
<th>Lfdnr.</th>
<th>Uhrzeit</th>
<th>Name (Nummer)</th>
<th>Dienstleistung</th>
<th>Telefon</th>
<th>Art</th>
<th>Anmerkung</th>
<th>Freitextfeld: {{workstation.scope.preferences.client.customTextfieldLabel}}</th>
<th>Aktion</th>
</tr>
</thead>
{% set lfdnr = 0 %}
{% for item in processListMissed %}
{% set lfdnr = lfdnr + 1 %}
<tr class="missed">
<td>
{{ lfdnr }}.
</td>
<td>
{% if item.queue.withAppointment %}
{{ item.appointments|first.date|date("H:i") }}
{% else %}
{{ item.queue.arrivalTime|date("H:i") }}
{% endif %}
</td>
<td>{% if item.clients|first.familyName %}{{ item.clients|first.familyName }}{% else %}Wartenummer {{ item.queue.number }} {% endif %} ({{ item.queue.number }})</td>
<td title="{% for request in item.requests%}{{request.name}}{% if not loop.last %}; {% endif %}{% endfor %}">
{{ item.requests|first.name }}
{% if item.requests|length > 1 %}
+{{ (item.requests|length) - 1 }}
{% endif %}
</td>{#DL#}
<td>{{ item.clients|first.telephone }}</td>
<td>
{% if item.queue.withAppointment %}
Termin
{% if 1 < item.appointments|first.slotCount %}
({{ item.appointments|first.slotCount }})
<table class="table--base queue-missed">
<thead>
<tr>
<th>Lfdnr.</th>
<th>Uhrzeit</th>
<th>Name (Nummer)</th>
<th>Dienstleistung</th>
<th>Telefon</th>
<th>Art</th>
<th>Anmerkung</th>
<th>Freitextfeld: {{workstation.scope.preferences.client.customTextfieldLabel}}</th>
<th>Aktion</th>
</tr>
</thead>
{% set lfdnr = 0 %}
{% for item in processListMissed %}
{% set lfdnr = lfdnr + 1 %}
<tr class="missed">
<td>
{{ lfdnr }}.
</td>
<td>
{% if item.queue.withAppointment %}
{{ item.appointments|first.date|date("H:i") }}
{% else %}
{{ item.queue.arrivalTime|date("H:i") }}
{% endif %}
{% else %}
Spontankunde
{% endif %}
</td>
<td>Dieser Kunde ist nicht erschienen</td>
<td>{{ item.customTextfield|decodeEntities|raw }}</td>
<td>
<a href="#" data-id="{{ item.id }}" class="process-reset">wieder aufnehmen</a>
</td>
</tr>
{% endfor %}
</table>
</td>
<td>{% if item.clients|first.familyName %}{{ item.clients|first.familyName }}{% else %}Wartenummer {{ item.queue.number }} {% endif %} ({{ item.queue.number }}) </td>
<td title="{% for request in item.requests%}{{request.name}}{% if not loop.last %}; {% endif %}{% endfor %}">
{{ item.requests|first.name }}
{% if item.requests|length > 1 %}
+{{ (item.requests|length) - 1 }}
{% endif %}
</td>{#DL#}
<td>{{ item.clients|first.telephone }}</td>
<td>
{% if item.queue.withAppointment %}
Termin
{% if 1 < item.appointments|first.slotCount %}
({{ item.appointments|first.slotCount }})
{% endif %}
{% else %}
Spontankunde
{% endif %}
</td>
<td>Dieser Kunde ist nicht erschienen</td>
<td><a href="#" data-id="{{ item.id }}" class="process-reset">wieder aufnehmen</a></td>
</tr>
{% endfor %}
</table>
</div>
{% else %}
Keine Einträge gefunden.
Expand Down
1 change: 0 additions & 1 deletion zmsapi/public/doc/schema

This file was deleted.

1 change: 1 addition & 0 deletions zmsapi/public/doc/schema
2 changes: 1 addition & 1 deletion zmsapi/src/Zmsapi/ProcessFinished.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function readResponse(
\BO\Zmsdb\Connection\Select::getWriteConnection();
$query = new Query();
if ('pending' == $process['status']) {
$process = $query->updateEntity($process, \App::$now, 0, $process['status']);
$process = $query->updateEntity($process, \App::$now);
(new Workstation)->writeRemovedProcess($workstation);
} else {
$query->writeEntityFinished($process, \App::$now, true);
Expand Down
4 changes: 2 additions & 2 deletions zmsapi/src/Zmsapi/ProcessNextByScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ public function readResponse(
throw new Exception\Scope\ScopeNotFound();
}
$queueList = $query->readQueueList($scope->id, $dateTime, 1);

$message = Response\Message::create($request);
$message->data = static::getProcess($queueList, $dateTime, $exclude);

$response = Render::withLastModified($response, time(), '0');
$response = Render::withJson($response, $message, 200);
return $response;
Expand Down
3 changes: 1 addition & 2 deletions zmsapi/src/Zmsapi/ProcessQueued.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ public function readResponse(
$entity->testValid();
$this->testProcessData($entity);
$process = (new Query())->readEntity($entity['id'], $entity['authKey'], 1);
$previousStatus = $process->status;
$process->status = 'queued';
$process->queue['callCount'] = 0;
$process->queue['lastCallTime'] = 0;
$cluster = (new \BO\Zmsdb\Cluster)->readByScopeId($workstation->scope['id'], 1);
$workstation->testMatchingProcessScope($workstation->getScopeList($cluster), $process);
$process = (new Query())->updateEntity($process, \App::$now, 0, $previousStatus);
$process = (new Query())->updateEntity($process, \App::$now);
$message = Response\Message::create($request);
$message->data = $process;

Expand Down
22 changes: 0 additions & 22 deletions zmsapi/src/Zmsapi/WorkstationProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use \BO\Mellon\Validator;
use \BO\Zmsdb\Workstation;
use \BO\Zmsdb\Process;
use \BO\Zmsdb\Process as Query;

/**
* @SuppressWarnings(Coupling)
Expand All @@ -35,20 +34,10 @@ public function readResponse(
$exception->data = ['process' => $workstation->process];
throw $exception;
}

$entity = new \BO\Zmsentities\Process($input);
$entity->testValid();
$this->testProcessData($entity);
$process = (new Query())->readEntity($entity['id'], $entity['authKey'], 1);
$previousStatus = $process->status;
$process->status = 'called';
$process = (new Query())->updateEntity($process, \App::$now, 0, $previousStatus);

$process = new \BO\Zmsentities\Process($input);
$this->testProcess($process, $workstation, $allowClusterWideCall);
$process->setCallTime(\App::$now);
$process->queue['callCount']++;

$process->status = 'called';

$workstation->process = (new Workstation)->writeAssignedProcess($workstation, $process, \App::$now);
Expand All @@ -61,17 +50,6 @@ public function readResponse(
return $response;
}

protected function testProcessData($entity)
{
$authCheck = (new Query())->readAuthKeyByProcessId($entity->id);
if (! $authCheck) {
throw new Exception\Process\ProcessNotFound();
} elseif ($authCheck['authKey'] != $entity->authKey && $authCheck['authName'] != $entity->authKey) {
throw new Exception\Process\AuthKeyMatchFailed();
}
Helper\Matching::testCurrentScopeHasRequest($entity);
}

protected function testProcess($process, $workstation, $allowClusterWideCall)
{
if ('called' == $process->status || 'processing' == $process->status) {
Expand Down
5 changes: 0 additions & 5 deletions zmsapi/src/Zmsapi/WorkstationProcessDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use \BO\Slim\Render;
use \BO\Mellon\Validator;
use \BO\Zmsdb\Workstation;
use \BO\Zmsdb\Process as Query;

class WorkstationProcessDelete extends BaseController
{
Expand All @@ -27,10 +26,6 @@ public function readResponse(
if (! $workstation->process['id']) {
throw new Exception\Process\ProcessNotFound();
}

$process = (new Query())->readEntity($workstation->process['id'], $workstation->process['authKey'], 1);
$process = (new Query())->updateEntity($process, \App::$now, 0, $process->status);

$workstation->process->setStatusBySettings();
(new Workstation)->writeRemovedProcess($workstation);
unset($workstation->process);
Expand Down
29 changes: 5 additions & 24 deletions zmscalldisplay/js/block/analogClock.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,6 @@ class View {
}

setClock() {
if (document.querySelector('.second-hand')) {
this.setAnalogClock();
}

if (document.querySelector('.digital-clock')) {
const now = new Date();

document.querySelector('.digital-clock').innerHTML =
new Intl.DateTimeFormat('de-DE', {hour: '2-digit', minute: '2-digit'}).format(now)

document.querySelector('.digital-datum').innerHTML =
new Intl.DateTimeFormat('de-DE', { weekday: 'long', year: 'numeric', month: '2-digit', day: '2-digit' }).format(now)
}
}

setAnalogClock() {
const now = new Date();

const secondHand = document.querySelector('.second-hand');
Expand All @@ -32,25 +16,22 @@ class View {
const seconds = now.getSeconds();
const secondsDegrees = ((seconds / 60) * 360) + 90;
secondHand.style.transform = `rotate(${secondsDegrees}deg)`;

const mins = now.getMinutes();
const minsDegrees = ((mins / 60) * 360) + ((seconds/60)*6) + 90;
minsHand.style.transform = `rotate(${minsDegrees}deg)`;

const hour = now.getHours();
const hourDegrees = ((hour / 12) * 360) + ((mins/60)*30) + 90;
hourHand.style.transform = `rotate(${hourDegrees}deg)`;
hourHand.style.transform = `rotate(${hourDegrees}deg)`;
}

setDate() {
const dateString = document.querySelector('#aufrufanzeige_Datum');
const now = new Date();
let options = { weekday: 'long', year: 'numeric', month: '2-digit', day: '2-digit' }

if (dateString) {
dateString.innerHTML = new Intl.DateTimeFormat('de-DE', options).format(now)
}
}
dateString.innerHTML = new Intl.DateTimeFormat('de-DE', options).format(now)
}
}

export default View;
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e8751b1

Please sign in to comment.