Upload via GUI (278 Dateien)
This commit is contained in:
@@ -55,6 +55,7 @@ function run_check_sla(PDO $pdo, bool $verbose = false): array
|
||||
email_send_and_log($t['department_email'], $subject, email_wrap($inner), null, 'SLA-überschritten-Mail (Abteilung)', $t['ticket_number']);
|
||||
}
|
||||
notify_admins_overdue_ticket($t);
|
||||
fcm_notify_overdue($t); // Push auf die Android-App
|
||||
$newlyOverdue++;
|
||||
if ($verbose) {
|
||||
$log[] = "[ok] Ticket #{$t['ticket_number']} als überfällig markiert";
|
||||
|
||||
@@ -1143,6 +1143,72 @@ function run_migrations(PDO $pdo, bool $verbose = false): array
|
||||
}
|
||||
}
|
||||
|
||||
// Migration 0040: Geräte der Android-App für Push-Benachrichtigungen (Firebase Cloud Messaging).
|
||||
if (!isset($done['php_0040_push_devices'])) {
|
||||
try {
|
||||
$drv = $pdo->getAttribute(PDO::ATTR_DRIVER_NAME);
|
||||
$ai = $drv === 'sqlite' ? 'INTEGER PRIMARY KEY AUTOINCREMENT' : 'INT AUTO_INCREMENT PRIMARY KEY';
|
||||
$eng = $drv === 'sqlite' ? '' : ' ENGINE=InnoDB DEFAULT CHARSET=utf8mb4';
|
||||
$pdo->exec("CREATE TABLE IF NOT EXISTS push_devices (
|
||||
id $ai,
|
||||
staff_id INT NOT NULL,
|
||||
token TEXT NOT NULL,
|
||||
token_hash CHAR(64) NOT NULL,
|
||||
platform VARCHAR(20) NOT NULL DEFAULT 'android',
|
||||
device_name VARCHAR(120) NULL,
|
||||
app_version VARCHAR(30) NULL,
|
||||
created_at DATETIME NULL,
|
||||
last_seen_at DATETIME NULL,
|
||||
UNIQUE (token_hash)
|
||||
)$eng");
|
||||
$pdo->exec('CREATE INDEX idx_push_devices_staff ON push_devices (staff_id)');
|
||||
$pdo->prepare('INSERT INTO schema_migrations (migration) VALUES (?)')->execute(['php_0040_push_devices']);
|
||||
$result['applied']++;
|
||||
if ($verbose) $result['log'][] = ' [OK] php_0040_push_devices';
|
||||
} catch (Throwable $e) {
|
||||
$result['errors'][] = 'php_0040_push_devices: ' . $e->getMessage();
|
||||
if ($verbose) $result['log'][] = ' [FAIL] php_0040_push_devices - ' . $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
// Migration 0041: Push-Einstellungen je Mitarbeiter (welche Popups, stille Zeiten).
|
||||
if (!isset($done['php_0041_push_prefs'])) {
|
||||
try {
|
||||
$drv = $pdo->getAttribute(PDO::ATTR_DRIVER_NAME);
|
||||
$eng = $drv === 'sqlite' ? '' : ' ENGINE=InnoDB DEFAULT CHARSET=utf8mb4';
|
||||
$pdo->exec("CREATE TABLE IF NOT EXISTS push_prefs (
|
||||
staff_id INT NOT NULL PRIMARY KEY,
|
||||
events VARCHAR(300) NOT NULL,
|
||||
quiet_from CHAR(5) NULL,
|
||||
quiet_to CHAR(5) NULL
|
||||
)$eng");
|
||||
$pdo->prepare('INSERT INTO schema_migrations (migration) VALUES (?)')->execute(['php_0041_push_prefs']);
|
||||
$result['applied']++;
|
||||
if ($verbose) $result['log'][] = ' [OK] php_0041_push_prefs';
|
||||
} catch (Throwable $e) {
|
||||
$result['errors'][] = 'php_0041_push_prefs: ' . $e->getMessage();
|
||||
if ($verbose) $result['log'][] = ' [FAIL] php_0041_push_prefs - ' . $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
// Migration 0042: Aktivität der Mitarbeiter + automatischer Offline-Status.
|
||||
if (!isset($done['php_0042_staff_activity'])) {
|
||||
try {
|
||||
$has = function (string $table, string $col) use ($pdo): bool {
|
||||
try { $pdo->query("SELECT $col FROM $table LIMIT 1"); return true; } catch (Throwable $e) { return false; }
|
||||
};
|
||||
if (!$has('staff', 'last_active_at')) $pdo->exec('ALTER TABLE staff ADD COLUMN last_active_at DATETIME NULL');
|
||||
if (!$has('staff_availability', 'auto_offline')) $pdo->exec('ALTER TABLE staff_availability ADD COLUMN auto_offline TINYINT NOT NULL DEFAULT 0');
|
||||
if (!$has('staff_availability', 'prev_status')) $pdo->exec('ALTER TABLE staff_availability ADD COLUMN prev_status VARCHAR(20) NULL');
|
||||
$pdo->prepare('INSERT INTO schema_migrations (migration) VALUES (?)')->execute(['php_0042_staff_activity']);
|
||||
$result['applied']++;
|
||||
if ($verbose) $result['log'][] = ' [OK] php_0042_staff_activity';
|
||||
} catch (Throwable $e) {
|
||||
$result['errors'][] = 'php_0042_staff_activity: ' . $e->getMessage();
|
||||
if ($verbose) $result['log'][] = ' [FAIL] php_0042_staff_activity - ' . $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ function staff_login(array $staff): void
|
||||
session_regenerate_id(true);
|
||||
$_SESSION['staff_id'] = $staff['id'];
|
||||
$_SESSION['staff_last_activity'] = time();
|
||||
staff_touch_activity(get_db(), (int) $staff['id']);
|
||||
}
|
||||
|
||||
function staff_logout(): void
|
||||
@@ -96,6 +97,8 @@ function require_staff_login(): array
|
||||
redirect('/staff/login.php');
|
||||
}
|
||||
$_SESSION['staff_last_activity'] = time();
|
||||
// Echte Seitenaufrufe zählen als Aktivität (Hintergrund-Abrufe per fetch nicht)
|
||||
if (staff_is_user_navigation()) staff_touch_activity(get_db(), (int) $staff['id']);
|
||||
|
||||
// "Eingebauter" Ersatz für echte Server-Cronjobs (siehe includes/pseudo_cron.php):
|
||||
// bei jeder authentifizierten Backend-Anfrage werden fällige Jobs im Hintergrund geprüft.
|
||||
|
||||
@@ -19,6 +19,8 @@ require_once __DIR__ . '/admin_models.php';
|
||||
require_once __DIR__ . '/queues.php';
|
||||
require_once __DIR__ . '/integrations.php';
|
||||
require_once __DIR__ . '/reports.php';
|
||||
require_once __DIR__ . '/fcm.php';
|
||||
require_once __DIR__ . '/staff_activity.php';
|
||||
require_once __DIR__ . '/notifications.php';
|
||||
require_once __DIR__ . '/plugins.php';
|
||||
require_once __DIR__ . '/app_downloads.php';
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Offizieller Plugin- und Theme-Katalog dieser DeskHub-Version (siehe plugin-webseite/README.md).
|
||||
* Mit diesen Werten gilt der geprüfte Modus: Plugins nur aus diesem Katalog, nur mit Signatur des Herausgebers.
|
||||
* Ändern: Webseite → Verwaltung → „Einstellungen für DeskHub“, dann Release neu bauen.
|
||||
*/
|
||||
return [
|
||||
'plugins_url' => 'https://plugin-deskhub.viper.ipv64.net/catalog.php?type=plugins',
|
||||
'themes_url' => 'https://plugin-deskhub.viper.ipv64.net/catalog.php?type=themes',
|
||||
'access_key' => '', // Zugangsschlüssel des Katalogs (docker-build gibt ihn aus); leer = Katalog ohne Zugangsschutz
|
||||
'publisher_key' => '-----BEGIN PUBLIC KEY-----
|
||||
MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEApuCBEnEYk4uVtP4cijWN
|
||||
LBgzjGU9TKb8Zjygk6DIeKKiR3Li7MUjkSPzP4JIZolxdzN147yw4gKG08WUSx4B
|
||||
@@ -20,4 +14,5 @@ XGlAo9JY6X4WIJ5etRMzwrhwTG7BTz1ClrE51628qO4q9ymFLiEoakQhYevfTnRa
|
||||
hrQtwtRCAjN86vPD3dT4cXtjZnYQ+9/DEHNy2CBieIVXAgMBAAE=
|
||||
-----END PUBLIC KEY-----
|
||||
',
|
||||
'access_key' => '64f141c43fc64dbfd1391ac8bfad81933bb59bb5c4d791d2',
|
||||
];
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* Offizieller Plugin- und Theme-Katalog dieser DeskHub-Version (siehe plugin-webseite/README.md).
|
||||
* Mit diesen Werten gilt der geprüfte Modus: Plugins nur aus diesem Katalog, nur mit Signatur des Herausgebers.
|
||||
* Ändern: Webseite → Verwaltung → „Einstellungen für DeskHub“, dann Release neu bauen.
|
||||
*/
|
||||
return [
|
||||
'plugins_url' => 'https://plugin-deskhub.viper.ipv64.net/catalog.php?type=plugins',
|
||||
'themes_url' => 'https://plugin-deskhub.viper.ipv64.net/catalog.php?type=themes',
|
||||
'access_key' => '', // Zugangsschlüssel des Katalogs (docker-build gibt ihn aus); leer = Katalog ohne Zugangsschutz
|
||||
'publisher_key' => '-----BEGIN PUBLIC KEY-----
|
||||
MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEApuCBEnEYk4uVtP4cijWN
|
||||
LBgzjGU9TKb8Zjygk6DIeKKiR3Li7MUjkSPzP4JIZolxdzN147yw4gKG08WUSx4B
|
||||
QbtvfgD40CxjRC83D3L+/8K2FaWmYGsQefhZjtsZzY9xtJjUEEVe0eRYlyi2ZDgW
|
||||
nDcz0++KTnRmPwd2qz2MNsgx1gOciRRawqOXzzlx7u5aKaVHzpxTIMaFA/7i/Tpd
|
||||
Eu8fEuTP88LDbwKuYVo8Aid5s3y171uRCDDu+91Bwu0sIxzAXH+Z/yXqHppmEGxX
|
||||
HCYXGn/L/sEAKRsH9aIO8muE8wpOF5QhDW4NtWD5QFPxbkvLzvRBp5Q3jyvRjHXy
|
||||
S1i4h8VujBNJXC5AsVjXgO/4Aq4q/j1HhOfhK6Njv0gwt54CnK+SVsniwro0fpZr
|
||||
XGlAo9JY6X4WIJ5etRMzwrhwTG7BTz1ClrE51628qO4q9ymFLiEoakQhYevfTnRa
|
||||
hrQtwtRCAjN86vPD3dT4cXtjZnYQ+9/DEHNy2CBieIVXAgMBAAE=
|
||||
-----END PUBLIC KEY-----
|
||||
',
|
||||
];
|
||||
Reference in New Issue
Block a user