Skip to content

Commit

Permalink
Revert "Merge branch 'dev' into mix-1498-1629"
Browse files Browse the repository at this point in the history
This reverts commit d50c3aa, reversing
changes made to 2383042.
  • Loading branch information
ThomasAFink committed Dec 4, 2023
1 parent d50c3aa commit 518ffe6
Show file tree
Hide file tree
Showing 50 changed files with 1,581 additions and 442 deletions.
5 changes: 3 additions & 2 deletions zmsadmin/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"psr/http-message": "^1.0",
"container-interop/container-interop": "^1.2",
"twig/intl-extra": "^3.4",
"twig/twig": "3.*"
"twig/twig": "3.*",
"symfony/polyfill-intl-icu": "^1.21"
},
"bin": [],
"autoload": {
Expand All @@ -54,4 +55,4 @@
"BO\\Zmsadmin\\Tests\\": "tests/Zmsadmin/"
}
}
}
}
5 changes: 4 additions & 1 deletion zmsadmin/js/block/calldisplay/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,10 @@ 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: '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' }
]}
value={this.state.template}
onChange={onTemplateStatusChange} />
Expand Down
348 changes: 2 additions & 346 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 = (1 < $queueList->count()) ? $excludedIds : '';
$excludedIds = (0 < $queueList->count()) ? $excludedIds : '';

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

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: 67 additions & 52 deletions zmsadmin/templates/block/queue/table.twig
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,24 @@
{% if item.queue.status == "reserved" %}
Reservierung
{% else %}
{% set callCount = "" %}
{% 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 = "" %}

{% if item.queue.callCount > 0 %}
{% set callCount = "<small>(%d)</small>"|format(item.queue.callCount) %}
{% endif %}
{% if source != 'counter' and (workstation.scope.id == item.scope.id or allowClusterWideCall) and isToday %}

{% 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 %}
<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 @@ -216,57 +228,60 @@
<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 }})
{% endif %}
{% else %}
Spontankunde
<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 }})
{% 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>
{% 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>
</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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../../vendor/eappointment/zmsentities/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);
$process = $query->updateEntity($process, \App::$now, 0, $process['status']);
(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: 2 additions & 1 deletion zmsapi/src/Zmsapi/ProcessQueued.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ 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);
$process = (new Query())->updateEntity($process, \App::$now, 0, $previousStatus);
$message = Response\Message::create($request);
$message->data = $process;

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

/**
* @SuppressWarnings(Coupling)
Expand All @@ -34,10 +35,20 @@ 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 @@ -50,6 +61,17 @@ 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
1 change: 1 addition & 0 deletions zmsapi/src/Zmsapi/WorkstationProcessDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use \BO\Slim\Render;
use \BO\Mellon\Validator;
use \BO\Zmsdb\Workstation;
use \BO\Zmsdb\Process as Query;

class WorkstationProcessDelete extends BaseController
{
Expand Down
1 change: 1 addition & 0 deletions zmsapi/src/Zmsapi/WorkstationUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function readResponse(
$input = Validator::input()->isJson()->assertValid()->getValue();
$entity = new \BO\Zmsentities\Workstation($input);
$entity->testValid();
Helper\User::testWorkstationAssigend($entity, $resolveReferences);
Helper\User::testWorkstationIsOveraged($entity);
if ($entity->getUseraccount()->id != $currentWorkstation->getUseraccount()->id) {
throw new Exception\Workstation\WorkstationAccessFailed();
Expand Down
29 changes: 24 additions & 5 deletions zmscalldisplay/js/block/analogClock.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ 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 @@ -16,22 +32,25 @@ 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' }
dateString.innerHTML = new Intl.DateTimeFormat('de-DE', options).format(now)
}

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

export default View;
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.
Binary file not shown.
Binary file not shown.
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.
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.
Binary file not shown.
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.
Binary file not shown.
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.
Binary file not shown.
Loading

0 comments on commit 518ffe6

Please sign in to comment.