feat: mobilni responsivita, testy, klavesove zkratky, drag & drop, univerzalizace

- Mobile responsive CSS (touch targets 44px, iOS anti-zoom, reduced motion)
- Vitest setup s 39 testy (formatters, attendanceHelpers, useTableSort)
- Klavesove zkratky (Shift+? napoveda, Ctrl+S ulozit, navigace)
- Drag & drop pro polozky nabidek (@dnd-kit, SortableRow, useSortableList)
- Univerzalizace: odstraneni BOHA brandingu z UI, emailu, PDF
- Smazany nepotrebne soubory (deploy.sh, AUTH_SYSTEM.md, example_design, .htaccess)
- CORS konfigurovatelny pres env promennou

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-12 17:33:37 +01:00
parent 5ef6fc8064
commit bb2bbb8ff6
35 changed files with 2716 additions and 4392 deletions

View File

@@ -1,7 +1,7 @@
<?php
/**
* BOHA Automation - Invoice PDF Export (Print-ready HTML)
* Invoice PDF Export (Print-ready HTML)
*
* Generuje HTML fakturu dle vzoru POHODA s QR platebnim kodem (SPAYD).
* GET /api/admin/invoices-pdf.php?id=X
@@ -361,7 +361,7 @@ try {
$custDic = $customer ? $esc($customer['vat_id'] ?? '') : '';
// Dodavatel
$suppName = $esc($settings['company_name'] ?? 'BOHA Automation s.r.o.');
$suppName = $esc($settings['company_name'] ?? '');
$suppStreet = $esc($settings['street'] ?? '');
$suppCity = trim(($settings['postal_code'] ?? '') . ' ' . ($settings['city'] ?? ''));
$suppCountry = $esc($settings['country'] ?? 'Česká republika');

View File

@@ -1,7 +1,7 @@
<?php
/**
* BOHA Automation - Offers PDF Export (Print-ready HTML)
* Offers PDF Export (Print-ready HTML)
*
* Returns a self-contained HTML page that auto-triggers window.print().
* The browser's "Save as PDF" produces the final PDF.

View File

@@ -1,7 +1,7 @@
<?php
/**
* BOHA Automation - TOTP 2FA API
* TOTP 2FA API
*
* GET ?action=status - 2FA status
* POST ?action=setup - generovat secret + QR

View File

@@ -1,7 +1,7 @@
<?php
/**
* BOHA Automation - API Configuration Bootstrap
* API Configuration Bootstrap
*
* Nacte helper funkce, env promenne a konstanty.
* Toto je jediny soubor, ktery API endpointy musi require_once.

View File

@@ -1,7 +1,7 @@
<?php
/**
* BOHA Automation - Audit Logging System
* Audit Logging System
*
* Comprehensive audit trail for all administrative actions
*/

View File

@@ -1,7 +1,7 @@
<?php
/**
* BOHA Automation - JWT Authentication Handler
* JWT Authentication Handler
*
* Handles JWT access tokens and refresh tokens for stateless authentication.
* Access tokens: Short-lived (configurable, default 15 min), stored in memory on client

View File

@@ -1,7 +1,7 @@
<?php
/**
* BOHA Automation - Leave Request Email Notifications
* Leave Request Email Notifications
*
* Sends email notifications when leave requests are created.
*/
@@ -66,16 +66,17 @@ class LeaveNotification
<td style='padding: 10px; border-bottom: 1px solid #ddd;'>" . htmlspecialchars($notes) . '</td>
</tr>' : '') . "
</table>
" . (env('APP_URL', '') ? "
<p style='margin-top: 20px;'>
<a href='https://www.boha-automation.cz/boha/leave-approval'
<a href='" . htmlspecialchars(env('APP_URL', '')) . "/leave-approval'
style='background: #de3a3a; color: #fff; padding: 10px 20px;
text-decoration: none; border-radius: 5px;'>
Přejít ke schvalování
</a>
</p>
</p>" : "") . "
<hr style='margin: 30px 0; border: none; border-top: 1px solid #ddd;'>
<p style='font-size: 12px; color: #999;'>
Tato zpráva byla automaticky vygenerována systémem BOHA Automation.<br>
Tato zpráva byla automaticky vygenerována systémem.<br>
Datum: " . date('d.m.Y H:i:s') . '
</p>
</body>

View File

@@ -1,7 +1,7 @@
<?php
/**
* BOHA Automation - Email Helper
* Email Helper
*
* Sends emails via PHP mail() function.
* Configuration via .env variables.
@@ -23,7 +23,7 @@ class Mailer
public static function send(string $to, string $subject, string $htmlBody, ?string $replyTo = null): bool
{
$fromEmail = env('SMTP_FROM_EMAIL', env('CONTACT_EMAIL_FROM', 'web@boha-automation.cz'));
$fromName = env('SMTP_FROM_NAME', 'BOHA Automation');
$fromName = env('SMTP_FROM_NAME', 'System');
$encodedSubject = '=?UTF-8?B?' . base64_encode($subject) . '?=';

View File

@@ -25,11 +25,10 @@ define('MAX_LOGIN_ATTEMPTS', 5);
define('LOCKOUT_MINUTES', 15);
define('BCRYPT_COST', 12);
// CORS - aktualizuj po nasazeni na subdomenu
define('CORS_ALLOWED_ORIGINS', [
'http://www.boha-automation.cz',
'https://www.boha-automation.cz',
]);
// CORS - konfigurovatelne pres env (comma-separated), fallback na hardcoded hodnoty
define('CORS_ALLOWED_ORIGINS', env('CORS_ALLOWED_ORIGINS', '')
? array_map('trim', explode(',', (string) env('CORS_ALLOWED_ORIGINS', '')))
: ['http://www.boha-automation.cz', 'https://www.boha-automation.cz']);
// Paths
define('API_ROOT', dirname(__DIR__));