Wersja po sprzątaniu i tłumaczeniach

This commit is contained in:
Flatlogic Bot 2026-03-01 17:31:49 +00:00
parent 1c68363a11
commit e1d38e6487
15 changed files with 413 additions and 210 deletions

View File

@ -778,8 +778,8 @@ class WorkflowEngine {
$meetingId = $stmt->fetchColumn(); $meetingId = $stmt->fetchColumn();
if (!$meetingId) { if (!$meetingId) {
$stmt = $this->pdo->prepare("INSERT INTO meetings (bni_group_id, meeting_date, meeting_datetime, meeting_key) VALUES (?, DATE(?), ?, ?)"); $stmt = $this->pdo->prepare("INSERT INTO meetings (bni_group_id, meeting_datetime, meeting_key) VALUES (?, ?, ?)");
$stmt->execute([$bniGroupId, $meetingDatetime, $meetingDatetime, $meetingKey]); $stmt->execute([$bniGroupId, $meetingDatetime, $meetingKey]);
$meetingId = $this->pdo->lastInsertId(); $meetingId = $this->pdo->lastInsertId();
} }

View File

@ -1,12 +1,14 @@
<?php <?php
require_once 'lib/ErrorHandler.php'; require_once 'lib/ErrorHandler.php';
register_error_handler();
require_once 'lib/i18n.php';
require_once 'db/config.php'; require_once 'db/config.php';
header('Content-Type: application/json'); header('Content-Type: application/json');
if ($_SERVER['REQUEST_METHOD'] !== 'POST') { if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
http_response_code(405); http_response_code(405);
echo json_encode(['error' => ['message' => 'Method not allowed.'], 'correlation_id' => uniqid()]); echo json_encode(['error' => ['message' => t('error.method_not_allowed', 'Niedozwolona metoda.')], 'correlation_id' => uniqid()]);
exit; exit;
} }
@ -27,7 +29,7 @@ $business_description = $_POST['business_description'] ?? null;
if (empty($first_name) || empty($last_name) || empty($email) || empty($password)) { if (empty($first_name) || empty($last_name) || empty($email) || empty($password)) {
http_response_code(422); http_response_code(422);
echo json_encode(['error' => ['message' => 'First name, last name, email, and password are required.'], 'correlation_id' => uniqid()]); echo json_encode(['error' => ['message' => t('error.missing_fields', 'Imię, nazwisko, email i hasło są wymagane.')], 'correlation_id' => uniqid()]);
exit; exit;
} }
@ -107,7 +109,7 @@ try {
} }
if ($e->errorInfo[1] == 1062) { if ($e->errorInfo[1] == 1062) {
http_response_code(409); // Conflict http_response_code(409); // Conflict
echo json_encode(['error' => ['message' => 'An account with this email address already exists.'], 'correlation_id' => uniqid()]); echo json_encode(['error' => ['message' => t('error.email_exists', 'Konto z tym adresem email już istnieje.')], 'correlation_id' => uniqid()]);
} else { } else {
throw $e; // Re-throw to be caught by the global error handler throw $e; // Re-throw to be caught by the global error handler
} }

View File

@ -1,5 +1,6 @@
<?php <?php
require_once 'WorkflowEngine.php'; require_once 'WorkflowEngine.php';
require_once 'lib/i18n.php';
require_once 'lib/ErrorHandler.php'; require_once 'lib/ErrorHandler.php';
require_once 'lib/WorkflowExceptions.php'; require_once 'lib/WorkflowExceptions.php';
@ -129,7 +130,7 @@ $instance = $engine->getInstanceByDefId($person_id, $process_definition_id);
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<div class="mt-3"> <div class="mt-3">
<h5>Available Actions</h5> <h5><?= t('modal.available_actions', 'Dostępne akcje') ?></h5>
<?php <?php
$currentNode = $all_nodes[$currentNodeId] ?? null; $currentNode = $all_nodes[$currentNodeId] ?? null;
if ($currentNode && isset($currentNode['ui_hints']['form_schema'])): if ($currentNode && isset($currentNode['ui_hints']['form_schema'])):
@ -171,17 +172,17 @@ $instance = $engine->getInstanceByDefId($person_id, $process_definition_id);
<hr> <hr>
<div class="add-note-container"> <div class="add-note-container">
<h5>Dodaj notatkę</h5> <h5><?= t('modal.add_note', 'Dodaj notatkę') ?></h5>
<div class="mb-3"> <div class="mb-3">
<textarea id="noteMessage" class="form-control" rows="2" placeholder="Wpisz treść notatki..."></textarea> <textarea id="noteMessage" class="form-control" rows="2" placeholder="Wpisz treść notatki..."></textarea>
</div> </div>
<button id="addNoteBtn" class="btn btn-secondary" data-instance-id="<?= $instanceId ?>">Dodaj notatkę</button> <button id="addNoteBtn" class="btn btn-secondary" data-instance-id="<?= $instanceId ?>"><?= t('modal.add_note', 'Dodaj notatkę') ?></button>
</div> </div>
<hr> <hr>
<div class="history-container"> <div class="history-container">
<h5>Historia</h5> <h5><?= t('modal.history', 'Historia') ?></h5>
<?php if (empty($events)): ?> <?php if (empty($events)): ?>
<p>Brak zdarzeń.</p> <p>Brak zdarzeń.</p>
<?php else: ?> <?php else: ?>
@ -248,10 +249,10 @@ $instance = $engine->getInstanceByDefId($person_id, $process_definition_id);
<div class="text-center"> <div class="text-center">
<?php if ($eligibility['is_eligible']): ?> <?php if ($eligibility['is_eligible']): ?>
<h4>Process Not Started</h4> <h4><?= t('modal.process_not_started', 'Proces nie został uruchomiony') ?></h4>
<p>This process has not been started for this person.</p> <p>This process has not been started for this person.</p>
<button id="startProcessBtn" class="btn btn-primary" data-person-id="<?= $person_id ?>" data-process-id="<?= $process_definition_id ?>"> <button id="startProcessBtn" class="btn btn-primary" data-person-id="<?= $person_id ?>" data-process-id="<?= $process_definition_id ?>">
Start Process <?= t('modal.start_process', 'Uruchom proces') ?>
</button> </button>
<?php else: ?> <?php else: ?>
<h4>Not Eligible</h4> <h4>Not Eligible</h4>

View File

@ -1,5 +1,6 @@
<?php <?php
session_start(); session_start();
require_once __DIR__ . "/lib/i18n.php";
if (!isset($_SESSION['user_id'])) { if (!isset($_SESSION['user_id'])) {
header('Location: login.php'); header('Location: login.php');

View File

@ -5,38 +5,38 @@
<li class="nav-item"> <li class="nav-item">
<a class="nav-link <?= ($current_page == 'index.php' || $current_page == '') ? 'active' : '' ?>" aria-current="page" href="/"> <a class="nav-link <?= ($current_page == 'index.php' || $current_page == '') ? 'active' : '' ?>" aria-current="page" href="/">
<i class="bi bi-kanban"></i> <i class="bi bi-kanban"></i>
<span class="nav-link-text">Pulpit procesów</span> <span class="nav-link-text"><?= t('menu.process_dashboard', 'Pulpit procesów') ?></span>
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link <?= ($current_page == 'calendar.php') ? 'active' : '' ?>" href="calendar.php"> <a class="nav-link <?= ($current_page == 'calendar.php') ? 'active' : '' ?>" href="calendar.php">
<i class="bi bi-calendar-event"></i> <i class="bi bi-calendar-event"></i>
<span class="nav-link-text">Kalendarz</span> <span class="nav-link-text"><?= t('menu.calendar', 'Kalendarz') ?></span>
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link collapsed" href="#settings-submenu" data-bs-toggle="collapse" aria-expanded="false"> <a class="nav-link collapsed" href="#settings-submenu" data-bs-toggle="collapse" aria-expanded="false">
<i class="bi bi-gear"></i> <i class="bi bi-gear"></i>
<span class="nav-link-text">Ustawienia</span> <span class="nav-link-text"><?= t('menu.settings', 'Ustawienia') ?></span>
</a> </a>
<ul class="nav flex-column collapse" id="settings-submenu" data-bs-parent="#sidebar"> <ul class="nav flex-column collapse" id="settings-submenu" data-bs-parent="#sidebar">
<li class="nav-item submenu-item"> <li class="nav-item submenu-item">
<a class="nav-link <?= ($current_page == 'event_types.php') ? 'active' : '' ?>" href="event_types.php"> <a class="nav-link <?= ($current_page == 'event_types.php') ? 'active' : '' ?>" href="event_types.php">
<i class="bi bi-tags"></i> <i class="bi bi-tags"></i>
<span class="nav-link-text">Typy zdarzeń</span> <span class="nav-link-text"><?= t('menu.event_types', 'Typy zdarzeń') ?></span>
</a> </a>
</li> </li>
<li class="nav-item submenu-item"> <li class="nav-item submenu-item">
<a class="nav-link <?= ($current_page == 'bni_groups.php') ? 'active' : '' ?>" href="bni_groups.php"> <a class="nav-link <?= ($current_page == 'bni_groups.php') ? 'active' : '' ?>" href="bni_groups.php">
<i class="bi bi-people"></i> <i class="bi bi-people"></i>
<span class="nav-link-text">Grupy BNI</span> <span class="nav-link-text"><?= t('menu.bni_groups', 'Grupy BNI') ?></span>
</a> </a>
</li> </li>
<li class="nav-item submenu-item"> <li class="nav-item submenu-item">
<a class="nav-link <?= ($current_page == 'functions.php') ? 'active' : '' ?>" href="functions.php"> <a class="nav-link <?= ($current_page == 'functions.php') ? 'active' : '' ?>" href="functions.php">
<i class="bi bi-person-rolodex"></i> <i class="bi bi-person-rolodex"></i>
<span class="nav-link-text">Funkcje</span> <span class="nav-link-text"><?= t('menu.functions', 'Funkcje') ?></span>
</a> </a>
</li> </li>
</ul> </ul>
@ -46,7 +46,7 @@
<li class="nav-item"> <li class="nav-item">
<a class="nav-link <?= ($current_page == 'process_definitions.php') ? 'active' : '' ?>" href="process_definitions.php"> <a class="nav-link <?= ($current_page == 'process_definitions.php') ? 'active' : '' ?>" href="process_definitions.php">
<i class="bi bi-diagram-3"></i> <i class="bi bi-diagram-3"></i>
<span class="nav-link-text">Definicje procesów</span> <span class="nav-link-text"><?= t('menu.process_definitions', 'Definicje procesów') ?></span>
</a> </a>
</li> </li>
<?php endif; ?> <?php endif; ?>

View File

@ -1,6 +1,7 @@
<?php <?php
require_once 'db/config.php'; require_once 'db/config.php';
session_start(); session_start();
require_once 'lib/i18n.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST') { if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$personId = $_POST['id']; $personId = $_POST['id'];
@ -22,7 +23,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (empty($first_name) || empty($last_name) || empty($email)) { if (empty($first_name) || empty($last_name) || empty($email)) {
http_response_code(422); http_response_code(422);
echo json_encode(['error' => ['message' => 'First name, last name, and email are required.'], 'correlation_id' => uniqid()]); echo json_encode(['error' => ['message' => t('error.missing_update_fields', 'Imię, nazwisko i email są wymagane.')], 'correlation_id' => uniqid()]);
exit; exit;
} }

View File

@ -13,7 +13,7 @@ $bni_groups = $stmt->fetchAll(PDO::FETCH_ASSOC);
<div class="row"> <div class="row">
<?php include '_sidebar.php'; ?> <?php include '_sidebar.php'; ?>
<main class="col-md-9 ms-sm-auto col-lg-10 px-md-4"> <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
<h1 class="h2 pt-3 pb-2 mb-3 border-bottom">BNI Groups</h1> <h1 class="h2 pt-3 pb-2 mb-3 border-bottom"><?php echo t('bni_groups.title', 'BNI Groups'); ?></h1>
<?php if (isset($_SESSION['success_message'])): ?> <?php if (isset($_SESSION['success_message'])): ?>
<div class="alert alert-success alert-dismissible fade show mt-3" role="alert"> <div class="alert alert-success alert-dismissible fade show mt-3" role="alert">
@ -25,7 +25,7 @@ $bni_groups = $stmt->fetchAll(PDO::FETCH_ASSOC);
<div class="d-flex justify-content-end mb-3"> <div class="d-flex justify-content-end mb-3">
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addModal"> <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addModal">
Add New BNI Group <?php echo t('bni_groups.add_new', 'Add New BNI Group'); ?>
</button> </button>
</div> </div>
@ -34,10 +34,10 @@ $bni_groups = $stmt->fetchAll(PDO::FETCH_ASSOC);
<thead> <thead>
<tr> <tr>
<th style="width: 30px;"></th> <th style="width: 30px;"></th>
<th>Name</th> <th><?php echo t('bni_groups.name', 'Name'); ?></th>
<th>City</th> <th><?php echo t('bni_groups.city', 'City'); ?></th>
<th>Active</th> <th><?php echo t('bni_groups.active', 'Active'); ?></th>
<th>Actions</th> <th><?php echo t('bni_groups.actions', 'Actions'); ?></th>
</tr> </tr>
</thead> </thead>
<tbody id="sortable-list"> <tbody id="sortable-list">
@ -46,17 +46,17 @@ $bni_groups = $stmt->fetchAll(PDO::FETCH_ASSOC);
<td class="handle"><i class="bi bi-grip-vertical"></i></td> <td class="handle"><i class="bi bi-grip-vertical"></i></td>
<td><?= htmlspecialchars($group['name']) ?></td> <td><?= htmlspecialchars($group['name']) ?></td>
<td><?= htmlspecialchars($group['city']) ?></td> <td><?= htmlspecialchars($group['city']) ?></td>
<td><?= $group['active'] ? 'Yes' : 'No' ?></td> <td><?= $group['active'] ? t('bni_groups.yes', 'Yes') : t('bni_groups.no', 'No') ?></td>
<td> <td>
<button type="button" class="btn btn-warning btn-sm" data-bs-toggle="modal" data-bs-target="#editModal" <button type="button" class="btn btn-warning btn-sm" data-bs-toggle="modal" data-bs-target="#editModal"
data-id="<?= $group['id'] ?>" data-id="<?= $group['id'] ?>"
data-name="<?= htmlspecialchars($group['name']) ?>" data-name="<?= htmlspecialchars($group['name']) ?>"
data-city="<?= htmlspecialchars($group['city']) ?>" data-city="<?= htmlspecialchars($group['city']) ?>"
data-active="<?= $group['active'] ?>"> data-active="<?= $group['active'] ?>">
Edit <?php echo t('bni_groups.edit', 'Edit'); ?>
</button> </button>
<button type="button" class="btn btn-danger btn-sm" data-bs-toggle="modal" data-bs-target="#deleteModal" data-id="<?= $group['id'] ?>"> <button type="button" class="btn btn-danger btn-sm" data-bs-toggle="modal" data-bs-target="#deleteModal" data-id="<?= $group['id'] ?>">
Delete <?php echo t('bni_groups.delete', 'Delete'); ?>
</button> </button>
</td> </td>
</tr> </tr>
@ -74,29 +74,29 @@ $bni_groups = $stmt->fetchAll(PDO::FETCH_ASSOC);
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="addModalLabel">Add BNI Group</h5> <h5 class="modal-title" id="addModalLabel"><?php echo t('bni_groups.add_title', 'Add BNI Group'); ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<form action="_add_bni_group.php" method="post"> <form action="_add_bni_group.php" method="post">
<div class="modal-body"> <div class="modal-body">
<div class="mb-3"> <div class="mb-3">
<label for="addName" class="form-label">Name</label> <label for="addName" class="form-label"><?php echo t('bni_groups.name', 'Name'); ?></label>
<input type="text" class="form-control" id="addName" name="name" required> <input type="text" class="form-control" id="addName" name="name" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="addCity" class="form-label">City</label> <label for="addCity" class="form-label"><?php echo t('bni_groups.city', 'City'); ?></label>
<input type="text" class="form-control" id="addCity" name="city"> <input type="text" class="form-control" id="addCity" name="city">
</div> </div>
<div class="form-check mb-3"> <div class="form-check mb-3">
<input class="form-check-input" type="checkbox" value="1" id="addActive" name="active" checked> <input class="form-check-input" type="checkbox" value="1" id="addActive" name="active" checked>
<label class="form-check-label" for="addActive"> <label class="form-check-label" for="addActive">
Active <?php echo t('bni_groups.active', 'Active'); ?>
</label> </label>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo t('modal.close', 'Close'); ?></button>
<button type="submit" name="add" class="btn btn-primary">Add</button> <button type="submit" name="add" class="btn btn-primary"><?php echo t('bni_groups.add_button', 'Add'); ?></button>
</div> </div>
</form> </form>
</div> </div>
@ -108,30 +108,30 @@ $bni_groups = $stmt->fetchAll(PDO::FETCH_ASSOC);
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="editModalLabel">Edit BNI Group</h5> <h5 class="modal-title" id="editModalLabel"><?php echo t('bni_groups.edit_title', 'Edit BNI Group'); ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<form action="_update_bni_group.php" method="post"> <form action="_update_bni_group.php" method="post">
<div class="modal-body"> <div class="modal-body">
<input type="hidden" id="editId" name="id"> <input type="hidden" id="editId" name="id">
<div class="mb-3"> <div class="mb-3">
<label for="editName" class="form-label">Name</label> <label for="editName" class="form-label"><?php echo t('bni_groups.name', 'Name'); ?></label>
<input type="text" class="form-control" id="editName" name="name" required> <input type="text" class="form-control" id="editName" name="name" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="editCity" class="form-label">City</label> <label for="editCity" class="form-label"><?php echo t('bni_groups.city', 'City'); ?></label>
<input type="text" class="form-control" id="editCity" name="city"> <input type="text" class="form-control" id="editCity" name="city">
</div> </div>
<div class="form-check mb-3"> <div class="form-check mb-3">
<input class="form-check-input" type="checkbox" value="1" id="editActive" name="active"> <input class="form-check-input" type="checkbox" value="1" id="editActive" name="active">
<label class="form-check-label" for="editActive"> <label class="form-check-label" for="editActive">
Active <?php echo t('bni_groups.active', 'Active'); ?>
</label> </label>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo t('modal.close', 'Close'); ?></button>
<button type="submit" name="edit" class="btn btn-primary">Save changes</button> <button type="submit" name="edit" class="btn btn-primary"><?php echo t('modal.save_changes', 'Save changes'); ?></button>
</div> </div>
</form> </form>
</div> </div>
@ -143,15 +143,15 @@ $bni_groups = $stmt->fetchAll(PDO::FETCH_ASSOC);
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="deleteModalLabel">Delete BNI Group</h5> <h5 class="modal-title" id="deleteModalLabel"><?php echo t('bni_groups.delete_title', 'Delete BNI Group'); ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
Are you sure you want to delete this BNI group? <?php echo t('bni_groups.delete_confirm', 'Are you sure you want to delete this BNI group?'); ?>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo t('modal.cancel', 'Cancel'); ?></button>
<a href="#" id="deleteLink" class="btn btn-danger">Delete</a> <a href="#" id="deleteLink" class="btn btn-danger"><?php echo t('bni_groups.delete', 'Delete'); ?></a>
</div> </div>
</div> </div>
</div> </div>
@ -198,4 +198,4 @@ document.addEventListener('DOMContentLoaded', function () {
}).disableSelection(); }).disableSelection();
}); });
}); });
</script> </script>

View File

@ -47,24 +47,24 @@ $nextYear = $month == 12 ? $year + 1 : $year;
<?php include '_sidebar.php'; ?> <?php include '_sidebar.php'; ?>
<main class="col-md-9 ms-sm-auto col-lg-10 px-md-4"> <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
<h2 class="text-center"><?php echo $firstDayOfMonth->format('F Y'); ?></h2> <h2 class="text-center"><?php echo t('calendar.' . strtolower($firstDayOfMonth->format('F')), $firstDayOfMonth->format('F')) . ' ' . $firstDayOfMonth->format('Y'); ?></h2>
<div class="d-flex justify-content-between mb-3"> <div class="d-flex justify-content-between mb-3">
<a href="?month=<?php echo $prevMonth; ?>&year=<?php echo $prevYear; ?>" class="btn btn-primary">&lt; Previous</a> <a href="?month=<?php echo $prevMonth; ?>&year=<?php echo $prevYear; ?>" class="btn btn-primary">&lt; <?php echo t('calendar.previous', 'Previous'); ?></a>
<a href="?month=<?php echo $nextMonth; ?>&year=<?php echo $nextYear; ?>" class="btn btn-primary">Next &gt;</a> <a href="?month=<?php echo $nextMonth; ?>&year=<?php echo $nextYear; ?>" class="btn btn-primary"><?php echo t('calendar.next', 'Next'); ?> &gt;</a>
<button type="button" class="btn btn-success" data-bs-toggle="modal" data-bs-target="#addEventModal"> <button type="button" class="btn btn-success" data-bs-toggle="modal" data-bs-target="#addEventModal">
Add Event <?php echo t('calendar.add_event', 'Add Event'); ?>
</button> </button>
</div> </div>
<table class="table table-bordered"> <table class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th>Monday</th> <th><?php echo t('calendar.monday', 'Monday'); ?></th>
<th>Tuesday</th> <th><?php echo t('calendar.tuesday', 'Tuesday'); ?></th>
<th>Wednesday</th> <th><?php echo t('calendar.wednesday', 'Wednesday'); ?></th>
<th>Thursday</th> <th><?php echo t('calendar.thursday', 'Thursday'); ?></th>
<th>Friday</th> <th><?php echo t('calendar.friday', 'Friday'); ?></th>
<th>Saturday</th> <th><?php echo t('calendar.saturday', 'Saturday'); ?></th>
<th>Sunday</th> <th><?php echo t('calendar.sunday', 'Sunday'); ?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -119,20 +119,20 @@ $nextYear = $month == 12 ? $year + 1 : $year;
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="eventDetailsModalLabel">Event Details</h5> <h5 class="modal-title" id="eventDetailsModalLabel"><?php echo t('calendar.event_details', 'Event Details'); ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<h5 id="event-title"></h5> <h5 id="event-title"></h5>
<p id="event-description"></p> <p id="event-description"></p>
<p><strong>Starts:</strong> <span id="event-start"></span></p> <p><strong><?php echo t('calendar.starts', 'Starts:'); ?></strong> <span id="event-start"></span></p>
<p><strong>Ends:</strong> <span id="event-end"></span></p> <p><strong><?php echo t('calendar.ends', 'Ends:'); ?></strong> <span id="event-end"></span></p>
<p><strong>Type:</strong> <span id="event-type"></span></p> <p><strong><?php echo t('calendar.type', 'Type:'); ?></strong> <span id="event-type"></span></p>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo t('modal.close', 'Close'); ?></button>
<button type="button" class="btn btn-primary" id="edit-event-btn">Edit</button> <button type="button" class="btn btn-primary" id="edit-event-btn"><?php echo t('calendar.edit', 'Edit'); ?></button>
<a href="#" id="delete-event-btn" class="btn btn-danger">Delete</a> <a href="#" id="delete-event-btn" class="btn btn-danger"><?php echo t('calendar.delete', 'Delete'); ?></a>
</div> </div>
</div> </div>
</div> </div>
@ -142,29 +142,29 @@ $nextYear = $month == 12 ? $year + 1 : $year;
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="addEventModalLabel">Add Calendar Event</h5> <h5 class="modal-title" id="addEventModalLabel"><?php echo t('calendar.add_event_title', 'Add Calendar Event'); ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form action="_add_calendar_event.php" method="post"> <form action="_add_calendar_event.php" method="post">
<div class="mb-3"> <div class="mb-3">
<label for="title" class="form-label">Title</label> <label for="title" class="form-label"><?php echo t('calendar.title', 'Title'); ?></label>
<input type="text" class="form-control" id="title" name="title" required> <input type="text" class="form-control" id="title" name="title" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="description" class="form-label">Description</label> <label for="description" class="form-label"><?php echo t('form.description', 'Description'); ?></label>
<textarea class="form-control" id="description" name="description"></textarea> <textarea class="form-control" id="description" name="description"></textarea>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="start_datetime" class="form-label">Start Time</label> <label for="start_datetime" class="form-label"><?php echo t('calendar.start_time', 'Start Time'); ?></label>
<input type="datetime-local" class="form-control" id="start_datetime" name="start_datetime" required> <input type="datetime-local" class="form-control" id="start_datetime" name="start_datetime" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="end_datetime" class="form-label">End Time</label> <label for="end_datetime" class="form-label"><?php echo t('calendar.end_time', 'End Time'); ?></label>
<input type="datetime-local" class="form-control" id="end_datetime" name="end_datetime" required> <input type="datetime-local" class="form-control" id="end_datetime" name="end_datetime" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="event_type_id" class="form-label">Type</label> <label for="event_type_id" class="form-label"><?php echo t('form.type', 'Type'); ?></label>
<select class="form-select" id="event_type_id" name="event_type_id"> <select class="form-select" id="event_type_id" name="event_type_id">
<?php foreach ($event_types as $type): ?> <?php foreach ($event_types as $type): ?>
<option value="<?= $type['id'] ?>"><?= htmlspecialchars($type['name']) ?></option> <option value="<?= $type['id'] ?>"><?= htmlspecialchars($type['name']) ?></option>
@ -172,7 +172,7 @@ $nextYear = $month == 12 ? $year + 1 : $year;
</select> </select>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="group_ids" class="form-label">Group(s)</label> <label for="group_ids" class="form-label"><?php echo t('calendar.groups', 'Group(s)'); ?></label>
<select class="form-select" id="group_ids" name="group_ids[]" multiple required> <select class="form-select" id="group_ids" name="group_ids[]" multiple required>
<?php foreach ($bni_groups as $group): ?> <?php foreach ($bni_groups as $group): ?>
<option value="<?= $group['id'] ?>"><?= htmlspecialchars($group['name']) ?></option> <option value="<?= $group['id'] ?>"><?= htmlspecialchars($group['name']) ?></option>
@ -180,19 +180,19 @@ $nextYear = $month == 12 ? $year + 1 : $year;
</select> </select>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="recurrence" class="form-label">Recurrence</label> <label for="recurrence" class="form-label"><?php echo t('calendar.recurrence', 'Recurrence'); ?></label>
<select class="form-select" id="recurrence" name="recurrence"> <select class="form-select" id="recurrence" name="recurrence">
<option value="">Does not repeat</option> <option value=""><?php echo t('calendar.no_repeat', 'Does not repeat'); ?></option>
<option value="daily">Daily</option> <option value="daily"><?php echo t('calendar.daily', 'Daily'); ?></option>
<option value="weekly">Weekly</option> <option value="weekly"><?php echo t('calendar.weekly', 'Weekly'); ?></option>
<option value="monthly">Monthly</option> <option value="monthly"><?php echo t('calendar.monthly', 'Monthly'); ?></option>
</select> </select>
</div> </div>
<div class="mb-3" id="recurrence_end_date_container" style="display: none;"> <div class="mb-3" id="recurrence_end_date_container" style="display: none;">
<label for="recurrence_end_date" class="form-label">Recurrence End Date</label> <label for="recurrence_end_date" class="form-label"><?php echo t('calendar.recurrence_end_date', 'Recurrence End Date'); ?></label>
<input type="date" class="form-control" id="recurrence_end_date" name="recurrence_end_date"> <input type="date" class="form-control" id="recurrence_end_date" name="recurrence_end_date">
</div> </div>
<button type="submit" class="btn btn-primary">Save Event</button> <button type="submit" class="btn btn-primary"><?php echo t('calendar.save_event', 'Save Event'); ?></button>
</form> </form>
</div> </div>
</div> </div>
@ -203,30 +203,30 @@ $nextYear = $month == 12 ? $year + 1 : $year;
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="editEventModalLabel">Edit Calendar Event</h5> <h5 class="modal-title" id="editEventModalLabel"><?php echo t('calendar.edit_event_title', 'Edit Calendar Event'); ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form action="_update_calendar_event.php" method="post"> <form action="_update_calendar_event.php" method="post">
<input type="hidden" id="edit_event_id" name="event_id"> <input type="hidden" id="edit_event_id" name="event_id">
<div class="mb-3"> <div class="mb-3">
<label for="edit_title" class="form-label">Title</label> <label for="edit_title" class="form-label"><?php echo t('calendar.title', 'Title'); ?></label>
<input type="text" class="form-control" id="edit_title" name="title" required> <input type="text" class="form-control" id="edit_title" name="title" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="edit_description" class="form-label">Description</label> <label for="edit_description" class="form-label"><?php echo t('form.description', 'Description'); ?></label>
<textarea class="form-control" id="edit_description" name="description"></textarea> <textarea class="form-control" id="edit_description" name="description"></textarea>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="edit_start_datetime" class="form-label">Start Time</label> <label for="edit_start_datetime" class="form-label"><?php echo t('calendar.start_time', 'Start Time'); ?></label>
<input type="datetime-local" class="form-control" id="edit_start_datetime" name="start_datetime" required> <input type="datetime-local" class="form-control" id="edit_start_datetime" name="start_datetime" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="edit_end_datetime" class="form-label">End Time</label> <label for="edit_end_datetime" class="form-label"><?php echo t('calendar.end_time', 'End Time'); ?></label>
<input type="datetime-local" class="form-control" id="edit_end_datetime" name="end_datetime" required> <input type="datetime-local" class="form-control" id="edit_end_datetime" name="end_datetime" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="edit_event_type_id" class="form-label">Type</label> <label for="edit_event_type_id" class="form-label"><?php echo t('form.type', 'Type'); ?></label>
<select class="form-select" id="edit_event_type_id" name="event_type_id"> <select class="form-select" id="edit_event_type_id" name="event_type_id">
<?php foreach ($event_types as $type): ?> <?php foreach ($event_types as $type): ?>
<option value="<?= $type['id'] ?>"><?= htmlspecialchars($type['name']) ?></option> <option value="<?= $type['id'] ?>"><?= htmlspecialchars($type['name']) ?></option>
@ -234,7 +234,7 @@ $nextYear = $month == 12 ? $year + 1 : $year;
</select> </select>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="edit_group_ids" class="form-label">Group(s)</label> <label for="edit_group_ids" class="form-label"><?php echo t('calendar.groups', 'Group(s)'); ?></label>
<select class="form-select" id="edit_group_ids" name="group_ids[]" multiple required> <select class="form-select" id="edit_group_ids" name="group_ids[]" multiple required>
<?php foreach ($bni_groups as $group): ?> <?php foreach ($bni_groups as $group): ?>
<option value="<?= $group['id'] ?>"><?= htmlspecialchars($group['name']) ?></option> <option value="<?= $group['id'] ?>"><?= htmlspecialchars($group['name']) ?></option>
@ -242,21 +242,21 @@ $nextYear = $month == 12 ? $year + 1 : $year;
</select> </select>
</div> </div>
<div id="edit-recurrence-options" class="mb-3" style="display: none;"> <div id="edit-recurrence-options" class="mb-3" style="display: none;">
<strong>This is a recurring event.</strong><br> <strong><?php echo t('calendar.recurring_notice', 'This is a recurring event.'); ?></strong><br>
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="radio" name="update_scope" id="update_scope_one" value="one" checked> <input class="form-check-input" type="radio" name="update_scope" id="update_scope_one" value="one" checked>
<label class="form-check-label" for="update_scope_one"> <label class="form-check-label" for="update_scope_one">
Update this event only <?php echo t('calendar.update_scope_one', 'Update this event only'); ?>
</label> </label>
</div> </div>
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="radio" name="update_scope" id="update_scope_all" value="all"> <input class="form-check-input" type="radio" name="update_scope" id="update_scope_all" value="all">
<label class="form-check-label" for="update_scope_all"> <label class="form-check-label" for="update_scope_all">
Update all events in the series <?php echo t('calendar.update_scope_all', 'Update all events in the series'); ?>
</label> </label>
</div> </div>
</div> </div>
<button type="submit" class="btn btn-primary">Save Changes</button> <button type="submit" class="btn btn-primary"><?php echo t('modal.save_changes', 'Save Changes'); ?></button>
</form> </form>
</div> </div>
</div> </div>
@ -349,4 +349,4 @@ document.addEventListener('DOMContentLoaded', function() {
<?php <?php
include '_footer.php'; include '_footer.php';
?> ?>

View File

@ -13,7 +13,7 @@ $event_types = $stmt->fetchAll(PDO::FETCH_ASSOC);
<div class="row"> <div class="row">
<?php include '_sidebar.php'; ?> <?php include '_sidebar.php'; ?>
<main class="col-md-9 ms-sm-auto col-lg-10 px-md-4"> <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
<h1 class="h2 pt-3 pb-2 mb-3 border-bottom">Event Types</h1> <h1 class="h2 pt-3 pb-2 mb-3 border-bottom"><?php echo t('event_types.title', 'Event Types'); ?></h1>
<?php if (isset($_SESSION['success_message'])): ?> <?php if (isset($_SESSION['success_message'])): ?>
<div class="alert alert-success alert-dismissible fade show mt-3" role="alert"> <div class="alert alert-success alert-dismissible fade show mt-3" role="alert">
@ -25,7 +25,7 @@ $event_types = $stmt->fetchAll(PDO::FETCH_ASSOC);
<div class="d-flex justify-content-end mb-3"> <div class="d-flex justify-content-end mb-3">
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addModal"> <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addModal">
Add New Event Type <?php echo t('event_types.add_new', 'Add New Event Type'); ?>
</button> </button>
</div> </div>
@ -34,9 +34,9 @@ $event_types = $stmt->fetchAll(PDO::FETCH_ASSOC);
<thead> <thead>
<tr> <tr>
<th style="width: 30px;"></th> <th style="width: 30px;"></th>
<th>Name</th> <th><?php echo t('event_types.name', 'Name'); ?></th>
<th>Color</th> <th><?php echo t('event_types.color', 'Color'); ?></th>
<th>Actions</th> <th><?php echo t('event_types.actions', 'Actions'); ?></th>
</tr> </tr>
</thead> </thead>
<tbody id="sortable-list"> <tbody id="sortable-list">
@ -47,10 +47,10 @@ $event_types = $stmt->fetchAll(PDO::FETCH_ASSOC);
<td><span class="badge" style="background-color: <?= htmlspecialchars($type['color']) ?>"><?= htmlspecialchars($type['color']) ?></span></td> <td><span class="badge" style="background-color: <?= htmlspecialchars($type['color']) ?>"><?= htmlspecialchars($type['color']) ?></span></td>
<td> <td>
<button type="button" class="btn btn-warning btn-sm" data-bs-toggle="modal" data-bs-target="#editModal" data-id="<?= $type['id'] ?>" data-name="<?= htmlspecialchars($type['name']) ?>" data-color="<?= htmlspecialchars($type['color']) ?>" data-display-order="<?= htmlspecialchars($type['display_order']) ?>"> <button type="button" class="btn btn-warning btn-sm" data-bs-toggle="modal" data-bs-target="#editModal" data-id="<?= $type['id'] ?>" data-name="<?= htmlspecialchars($type['name']) ?>" data-color="<?= htmlspecialchars($type['color']) ?>" data-display-order="<?= htmlspecialchars($type['display_order']) ?>">
Edit <?php echo t('event_types.edit', 'Edit'); ?>
</button> </button>
<button type="button" class="btn btn-danger btn-sm" data-bs-toggle="modal" data-bs-target="#deleteModal" data-id="<?= $type['id'] ?>"> <button type="button" class="btn btn-danger btn-sm" data-bs-toggle="modal" data-bs-target="#deleteModal" data-id="<?= $type['id'] ?>">
Delete <?php echo t('event_types.delete', 'Delete'); ?>
</button> </button>
</td> </td>
</tr> </tr>
@ -68,23 +68,23 @@ $event_types = $stmt->fetchAll(PDO::FETCH_ASSOC);
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="addModalLabel">Add Event Type</h5> <h5 class="modal-title" id="addModalLabel"><?php echo t('event_types.add_title', 'Add Event Type'); ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<form action="_add_event_type.php" method="post"> <form action="_add_event_type.php" method="post">
<div class="modal-body"> <div class="modal-body">
<div class="mb-3"> <div class="mb-3">
<label for="addName" class="form-label">Name</label> <label for="addName" class="form-label"><?php echo t('event_types.name', 'Name'); ?></label>
<input type="text" class="form-control" id="addName" name="name" required> <input type="text" class="form-control" id="addName" name="name" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="addColor" class="form-label">Color</label> <label for="addColor" class="form-label"><?php echo t('event_types.color', 'Color'); ?></label>
<input type="color" class="form-control" id="addColor" name="color" value="#007bff" required> <input type="color" class="form-control" id="addColor" name="color" value="#007bff" required>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo t('modal.close', 'Close'); ?></button>
<button type="submit" name="add" class="btn btn-primary">Add</button> <button type="submit" name="add" class="btn btn-primary"><?php echo t('event_types.add_button', 'Add'); ?></button>
</div> </div>
</form> </form>
</div> </div>
@ -96,7 +96,7 @@ $event_types = $stmt->fetchAll(PDO::FETCH_ASSOC);
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="editModalLabel">Edit Event Type</h5> <h5 class="modal-title" id="editModalLabel"><?php echo t('event_types.edit_title', 'Edit Event Type'); ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<form action="_update_event_type.php" method="post"> <form action="_update_event_type.php" method="post">
@ -104,17 +104,17 @@ $event_types = $stmt->fetchAll(PDO::FETCH_ASSOC);
<input type="hidden" id="editId" name="id"> <input type="hidden" id="editId" name="id">
<input type="hidden" id="editDisplayOrder" name="display_order"> <input type="hidden" id="editDisplayOrder" name="display_order">
<div class="mb-3"> <div class="mb-3">
<label for="editName" class="form-label">Name</label> <label for="editName" class="form-label"><?php echo t('event_types.name', 'Name'); ?></label>
<input type="text" class="form-control" id="editName" name="name" required> <input type="text" class="form-control" id="editName" name="name" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="editColor" class="form-label">Color</label> <label for="editColor" class="form-label"><?php echo t('event_types.color', 'Color'); ?></label>
<input type="color" class="form-control" id="editColor" name="color" required> <input type="color" class="form-control" id="editColor" name="color" required>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo t('modal.close', 'Close'); ?></button>
<button type="submit" name="edit" class="btn btn-primary">Save changes</button> <button type="submit" name="edit" class="btn btn-primary"><?php echo t('modal.save_changes', 'Save changes'); ?></button>
</div> </div>
</form> </form>
</div> </div>
@ -126,15 +126,15 @@ $event_types = $stmt->fetchAll(PDO::FETCH_ASSOC);
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="deleteModalLabel">Delete Event Type</h5> <h5 class="modal-title" id="deleteModalLabel"><?php echo t('event_types.delete_title', 'Delete Event Type'); ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
Are you sure you want to delete this event type? <?php echo t('event_types.delete_confirm', 'Are you sure you want to delete this event type?'); ?>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo t('modal.cancel', 'Cancel'); ?></button>
<a href="#" id="deleteLink" class="btn btn-danger">Delete</a> <a href="#" id="deleteLink" class="btn btn-danger"><?php echo t('event_types.delete', 'Delete'); ?></a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -17,7 +17,7 @@ $bni_groups = $group_stmt->fetchAll(PDO::FETCH_ASSOC);
<div class="row"> <div class="row">
<?php include '_sidebar.php'; ?> <?php include '_sidebar.php'; ?>
<main class="col-md-9 ms-sm-auto col-lg-10 px-md-4"> <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
<h1 class="h2 pt-3 pb-2 mb-3 border-bottom">Functions</h1> <h1 class="h2 pt-3 pb-2 mb-3 border-bottom"><?php echo t('functions.title', 'Functions'); ?></h1>
<?php if (isset($_SESSION['success_message'])): ?> <?php if (isset($_SESSION['success_message'])): ?>
<div class="alert alert-success alert-dismissible fade show mt-3" function="alert"> <div class="alert alert-success alert-dismissible fade show mt-3" function="alert">
@ -29,7 +29,7 @@ $bni_groups = $group_stmt->fetchAll(PDO::FETCH_ASSOC);
<div class="d-flex justify-content-end mb-3"> <div class="d-flex justify-content-end mb-3">
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addModal"> <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addModal">
Add New Function <?php echo t('functions.add_new', 'Add New Function'); ?>
</button> </button>
</div> </div>
@ -38,9 +38,9 @@ $bni_groups = $group_stmt->fetchAll(PDO::FETCH_ASSOC);
<thead> <thead>
<tr> <tr>
<th style="width: 30px;"></th> <th style="width: 30px;"></th>
<th>Name</th> <th><?php echo t('functions.name', 'Name'); ?></th>
<th>Group</th> <th><?php echo t('functions.group', 'Group'); ?></th>
<th>Actions</th> <th><?php echo t('functions.actions', 'Actions'); ?></th>
</tr> </tr>
</thead> </thead>
<tbody id="sortable-list"> <tbody id="sortable-list">
@ -51,10 +51,10 @@ $bni_groups = $group_stmt->fetchAll(PDO::FETCH_ASSOC);
<td><?= htmlspecialchars($function['group_name']) ?></td> <td><?= htmlspecialchars($function['group_name']) ?></td>
<td> <td>
<button type="button" class="btn btn-warning btn-sm" data-bs-toggle="modal" data-bs-target="#editModal" data-id="<?= $function['id'] ?>" data-name="<?= htmlspecialchars($function['name']) ?>" data-bni_group_id="<?= $function['bni_group_id'] ?>"> <button type="button" class="btn btn-warning btn-sm" data-bs-toggle="modal" data-bs-target="#editModal" data-id="<?= $function['id'] ?>" data-name="<?= htmlspecialchars($function['name']) ?>" data-bni_group_id="<?= $function['bni_group_id'] ?>">
Edit <?php echo t('functions.edit', 'Edit'); ?>
</button> </button>
<button type="button" class="btn btn-danger btn-sm" data-bs-toggle="modal" data-bs-target="#deleteModal" data-id="<?= $function['id'] ?>"> <button type="button" class="btn btn-danger btn-sm" data-bs-toggle="modal" data-bs-target="#deleteModal" data-id="<?= $function['id'] ?>">
Delete <?php echo t('functions.delete', 'Delete'); ?>
</button> </button>
</td> </td>
</tr> </tr>
@ -72,19 +72,19 @@ $bni_groups = $group_stmt->fetchAll(PDO::FETCH_ASSOC);
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="addModalLabel">Add Function</h5> <h5 class="modal-title" id="addModalLabel"><?php echo t('functions.add_title', 'Add Function'); ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<form action="_add_function.php" method="post"> <form action="_add_function.php" method="post">
<div class="modal-body"> <div class="modal-body">
<div class="mb-3"> <div class="mb-3">
<label for="addName" class="form-label">Name</label> <label for="addName" class="form-label"><?php echo t('functions.name', 'Name'); ?></label>
<input type="text" class="form-control" id="addName" name="name" required> <input type="text" class="form-control" id="addName" name="name" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="addBniGroup" class="form-label">Group</label> <label for="addBniGroup" class="form-label"><?php echo t('functions.group', 'Group'); ?></label>
<select class="form-select" id="addBniGroup" name="bni_group_id" required> <select class="form-select" id="addBniGroup" name="bni_group_id" required>
<option value="">Select a group</option> <option value=""><?php echo t('functions.select_group', 'Select a group'); ?></option>
<?php foreach ($bni_groups as $group): ?> <?php foreach ($bni_groups as $group): ?>
<option value="<?= $group['id'] ?>"><?= htmlspecialchars($group['name']) ?></option> <option value="<?= $group['id'] ?>"><?= htmlspecialchars($group['name']) ?></option>
<?php endforeach; ?> <?php endforeach; ?>
@ -92,8 +92,8 @@ $bni_groups = $group_stmt->fetchAll(PDO::FETCH_ASSOC);
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo t('modal.close', 'Close'); ?></button>
<button type="submit" name="add" class="btn btn-primary">Add</button> <button type="submit" name="add" class="btn btn-primary"><?php echo t('functions.add_button', 'Add'); ?></button>
</div> </div>
</form> </form>
</div> </div>
@ -105,20 +105,20 @@ $bni_groups = $group_stmt->fetchAll(PDO::FETCH_ASSOC);
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="editModalLabel">Edit Function</h5> <h5 class="modal-title" id="editModalLabel"><?php echo t('functions.edit_title', 'Edit Function'); ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<form action="_update_function.php" method="post"> <form action="_update_function.php" method="post">
<div class="modal-body"> <div class="modal-body">
<input type="hidden" id="editId" name="id"> <input type="hidden" id="editId" name="id">
<div class="mb-3"> <div class="mb-3">
<label for="editName" class="form-label">Name</label> <label for="editName" class="form-label"><?php echo t('functions.name', 'Name'); ?></label>
<input type="text" class="form-control" id="editName" name="name" required> <input type="text" class="form-control" id="editName" name="name" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="editBniGroup" class="form-label">Group</label> <label for="editBniGroup" class="form-label"><?php echo t('functions.group', 'Group'); ?></label>
<select class="form-select" id="editBniGroup" name="bni_group_id" required> <select class="form-select" id="editBniGroup" name="bni_group_id" required>
<option value="">Select a group</option> <option value=""><?php echo t('functions.select_group', 'Select a group'); ?></option>
<?php foreach ($bni_groups as $group): ?> <?php foreach ($bni_groups as $group): ?>
<option value="<?= $group['id'] ?>"><?= htmlspecialchars($group['name']) ?></option> <option value="<?= $group['id'] ?>"><?= htmlspecialchars($group['name']) ?></option>
<?php endforeach; ?> <?php endforeach; ?>
@ -126,8 +126,8 @@ $bni_groups = $group_stmt->fetchAll(PDO::FETCH_ASSOC);
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo t('modal.close', 'Close'); ?></button>
<button type="submit" name="edit" class="btn btn-primary">Save changes</button> <button type="submit" name="edit" class="btn btn-primary"><?php echo t('modal.save_changes', 'Save changes'); ?></button>
</div> </div>
</form> </form>
</div> </div>
@ -139,15 +139,15 @@ $bni_groups = $group_stmt->fetchAll(PDO::FETCH_ASSOC);
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="deleteModalLabel">Delete Function</h5> <h5 class="modal-title" id="deleteModalLabel"><?php echo t('functions.delete_title', 'Delete Function'); ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
Are you sure you want to delete this function? <?php echo t('functions.delete_confirm', 'Are you sure you want to delete this function?'); ?>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo t('modal.cancel', 'Cancel'); ?></button>
<a href="#" id="deleteLink" class="btn btn-danger">Delete</a> <a href="#" id="deleteLink" class="btn btn-danger"><?php echo t('functions.delete', 'Delete'); ?></a>
</div> </div>
</div> </div>
</div> </div>
@ -192,4 +192,4 @@ document.addEventListener('DOMContentLoaded', function () {
}).disableSelection(); }).disableSelection();
}); });
}); });
</script> </script>

150
index.php
View File

@ -96,23 +96,23 @@ $status_colors = [
<?php endif; ?> <?php endif; ?>
<div class="d-flex justify-content-between align-items-center pt-3 pb-2 mb-3 border-bottom"> <div class="d-flex justify-content-between align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">Dashboard</h1> <h1 class="h2"><?= t('dashboard.title', 'Pulpit nawigacyjny') ?></h1>
<div class="btn-toolbar mb-2 mb-md-0"> <div class="btn-toolbar mb-2 mb-md-0">
<div class="btn-group me-2" id="bulk-actions-group" style="display: none;"> <div class="btn-group me-2" id="bulk-actions-group" style="display: none;">
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
Bulk Actions <?= t('dashboard.bulk_actions', 'Akcje zbiorcze') ?>
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#bulkStatusModal">Bulk Status Update</a></li> <li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#bulkStatusModal"><?= t('dashboard.bulk_status_update', 'Zbiorcza aktualizacja statusu') ?></a></li>
<li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#bulkEventModal">Bulk Add Event</a></li> <li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#bulkEventModal"><?= t('dashboard.bulk_add_event', 'Zbiorcze dodawanie zdarzenia') ?></a></li>
<li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#bulkInitModal">Bulk Initialize Instances</a></li> <li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#bulkInitModal"><?= t('dashboard.bulk_init_instances', 'Zbiorcza inicjalizacja instancji') ?></a></li>
<li><hr class="dropdown-divider"></li> <li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#" id="bulkPrintBadge">Drukuj badge</a></li> <li><a class="dropdown-item" href="#" id="bulkPrintBadge"><?= t('dashboard.bulk_print_badge', 'Drukuj identyfikatory') ?></a></li>
<li><a class="dropdown-item" href="#" id="bulkPrintAttendance">Drukuj listę obecności</a></li> <li><a class="dropdown-item" href="#" id="bulkPrintAttendance"><?= t('dashboard.bulk_print_attendance', 'Drukuj listę obecności') ?></a></li>
</ul> </ul>
</div> </div>
<button type="button" class="btn btn-success" data-bs-toggle="modal" data-bs-target="#createPersonModal"> <button type="button" class="btn btn-success" data-bs-toggle="modal" data-bs-target="#createPersonModal">
Create Person <?= t('dashboard.create_person', 'Dodaj osobę') ?>
</button> </button>
</div> </div>
</div> </div>
@ -126,9 +126,9 @@ $status_colors = [
?> ?>
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Filter by Group:</label> <label class="form-label"><?= t('dashboard.filter_by_group', 'Filtruj wg grupy:') ?></label>
<div class="btn-group" role="group" aria-label="Group Filter"> <div class="btn-group" role="group" aria-label="Group Filter">
<a href="index.php?<?= http_build_query(array_merge($_GET, ['group_id' => ''])) ?>" class="btn btn-outline-primary <?= !$groupId ? 'active-filter' : '' ?>">All Groups</a> <a href="index.php?<?= http_build_query(array_merge($_GET, ['group_id' => ''])) ?>" class="btn btn-outline-primary <?= !$groupId ? 'active-filter' : '' ?>"><?= t('dashboard.all_groups', 'Wszystkie grupy') ?></a>
<?php foreach ($bni_groups as $group): ?> <?php foreach ($bni_groups as $group): ?>
<a href="index.php?<?= http_build_query(array_merge($_GET, ['group_id' => $group['id']])) ?>" class="btn btn-outline-primary <?= ($groupId == $group['id']) ? 'active-filter' : '' ?>"> <a href="index.php?<?= http_build_query(array_merge($_GET, ['group_id' => $group['id']])) ?>" class="btn btn-outline-primary <?= ($groupId == $group['id']) ? 'active-filter' : '' ?>">
<?= htmlspecialchars($group['name']) ?> <?= htmlspecialchars($group['name']) ?>
@ -142,12 +142,12 @@ $status_colors = [
<thead class="table-light"> <thead class="table-light">
<tr class="text-center"> <tr class="text-center">
<th rowspan="2" class="align-middle"><input type="checkbox" id="selectAll"></th> <th rowspan="2" class="align-middle"><input type="checkbox" id="selectAll"></th>
<th rowspan="2" class="align-middle">Person</th> <th rowspan="2" class="align-middle"><?= t('dashboard.person', 'Osoba') ?></th>
<?php if (!empty($spotkania_cols)): ?> <?php if (!empty($spotkania_cols)): ?>
<th colspan="<?= count($spotkania_cols) ?>">Spotkania</th> <th colspan="<?= count($spotkania_cols) ?>"><?= t('dashboard.meetings', 'Spotkania') ?></th>
<?php endif; ?> <?php endif; ?>
<?php if (!empty($inne_procesy_cols)): ?> <?php if (!empty($inne_procesy_cols)): ?>
<th colspan="<?= count($processes) ?>">Inne procesy</th> <th colspan="<?= count($processes) ?>"><?= t('dashboard.other_processes', 'Inne procesy') ?></th>
<?php endif; ?> <?php endif; ?>
</tr> </tr>
<tr class="text-center"> <tr class="text-center">
@ -264,7 +264,7 @@ $status_colors = [
<div class="modal-content"> <div class="modal-content">
<form id="editPersonForm" action="_update_person.php" method="post" enctype="multipart/form-data"> <form id="editPersonForm" action="_update_person.php" method="post" enctype="multipart/form-data">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="editPersonModalLabel">Edytuj osobę</h5> <h5 class="modal-title" id="editPersonModalLabel"><?= t('modal.edit_person', 'Edytuj osobę') ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Zamknij"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Zamknij"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
@ -272,30 +272,30 @@ $status_colors = [
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="mb-3"> <div class="mb-3">
<label for="editFirstName" class="form-label">Imię</label> <label for="editFirstName" class="form-label"><?= t('form.first_name', 'Imię') ?></label>
<input type="text" class="form-control" id="editFirstName" name="first_name" required> <input type="text" class="form-control" id="editFirstName" name="first_name" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="editLastName" class="form-label">Nazwisko</label> <label for="editLastName" class="form-label"><?= t('form.last_name', 'Nazwisko') ?></label>
<input type="text" class="form-control" id="editLastName" name="last_name" required> <input type="text" class="form-control" id="editLastName" name="last_name" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="editPhone" class="form-label">Numer telefonu</label> <label for="editPhone" class="form-label"><?= t('form.phone', 'Numer telefonu') ?></label>
<input type="text" class="form-control" id="editPhone" name="phone"> <input type="text" class="form-control" id="editPhone" name="phone">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="editEmail" class="form-label">Email (login)</label> <label for="editEmail" class="form-label"><?= t('form.email', 'Email (login)') ?></label>
<input type="email" class="form-control" id="editEmail" name="email"> <input type="email" class="form-control" id="editEmail" name="email">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="editPassword" class="form-label">Nowe hasło</label> <label for="editPassword" class="form-label"><?= t('form.new_password', 'Nowe hasło') ?></label>
<input type="password" class="form-control" id="editPassword" name="password"> <input type="password" class="form-control" id="editPassword" name="password">
<small class="form-text text-muted">Pozostaw puste, jeśli nie chcesz zmieniać hasła.</small> <small class="form-text text-muted">Pozostaw puste, jeśli nie chcesz zmieniać hasła.</small>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="mb-3"> <div class="mb-3">
<label for="editRole" class="form-label">Rola</label> <label for="editRole" class="form-label"><?= t('form.role', 'Rola') ?></label>
<select class="form-select" id="editRole" name="role" required> <select class="form-select" id="editRole" name="role" required>
<option value="admin">Admin</option> <option value="admin">Admin</option>
<option value="member">Członek</option> <option value="member">Członek</option>
@ -304,7 +304,7 @@ $status_colors = [
</select> </select>
</div> </div>
<div class="mb-3" id="edit-group-selection-div" style="display: none;"> <div class="mb-3" id="edit-group-selection-div" style="display: none;">
<label for="editBniGroup" class="form-label">Grupa</label> <label for="editBniGroup" class="form-label"><?= t('form.group', 'Grupa') ?></label>
<select class="form-select" id="editBniGroup" name="bni_group_id"> <select class="form-select" id="editBniGroup" name="bni_group_id">
<option value="">Wybierz grupę...</option> <option value="">Wybierz grupę...</option>
<?php foreach ($bni_groups as $group): ?> <?php foreach ($bni_groups as $group): ?>
@ -313,31 +313,31 @@ $status_colors = [
</select> </select>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="editRoles" class="form-label">Funkcje</label> <label for="editRoles" class="form-label"><?= t('form.functions', 'Funkcje') ?></label>
<select class="form-select" id="editRoles" name="functions[]" multiple size="5"> <select class="form-select" id="editRoles" name="functions[]" multiple size="5">
<!-- Opcje zostaną wstawione przez JavaScript --> <!-- Opcje zostaną wstawione przez JavaScript -->
</select> </select>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="editCompanyName" class="form-label">Nazwa firmy</label> <label for="editCompanyName" class="form-label"><?= t('form.company_name', 'Nazwa firmy') ?></label>
<input type="text" class="form-control" id="editCompanyName" name="company_name"> <input type="text" class="form-control" id="editCompanyName" name="company_name">
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="mb-3"> <div class="mb-3">
<label for="editNip" class="form-label">NIP</label> <label for="editNip" class="form-label"><?= t('form.nip', 'NIP') ?></label>
<input type="text" class="form-control" id="editNip" name="nip"> <input type="text" class="form-control" id="editNip" name="nip">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="editIndustry" class="form-label">Branża</label> <label for="editIndustry" class="form-label"><?= t('form.industry', 'Branża') ?></label>
<input type="text" class="form-control" id="editIndustry" name="industry"> <input type="text" class="form-control" id="editIndustry" name="industry">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="editCompanySize" class="form-label">Wielkość firmy / Przychody</label> <label for="editCompanySize" class="form-label"><?= t('form.company_size', 'Wielkość firmy / Przychody') ?></label>
<input type="text" class="form-control" id="editCompanySize" name="company_size_revenue"> <input type="text" class="form-control" id="editCompanySize" name="company_size_revenue">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="editBusinessDescription" class="form-label">Opis działalności</label> <label for="editBusinessDescription" class="form-label"><?= t('form.business_description', 'Opis działalności') ?></label>
<textarea class="form-control" id="editBusinessDescription" name="business_description" rows="3"></textarea> <textarea class="form-control" id="editBusinessDescription" name="business_description" rows="3"></textarea>
</div> </div>
</div> </div>
@ -347,12 +347,12 @@ $status_colors = [
<div class="col-md-6"> <div class="col-md-6">
<h5>Pliki firmowe</h5> <h5>Pliki firmowe</h5>
<div class="mb-3"> <div class="mb-3">
<label for="editCompanyLogo" class="form-label">Logo firmy</label> <label for="editCompanyLogo" class="form-label"><?= t('form.company_logo', 'Logo firmy') ?></label>
<input class="form-control" type="file" id="editCompanyLogo" name="company_logo"> <input class="form-control" type="file" id="editCompanyLogo" name="company_logo">
<small id="editCompanyLogoPath" class="form-text text-muted"></small> <small id="editCompanyLogoPath" class="form-text text-muted"></small>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="editPersonPhoto" class="form-label">Zdjęcie osoby</label> <label for="editPersonPhoto" class="form-label"><?= t('form.person_photo', 'Zdjęcie osoby') ?></label>
<input class="form-control" type="file" id="editPersonPhoto" name="person_photo"> <input class="form-control" type="file" id="editPersonPhoto" name="person_photo">
<small id="editPersonPhotoPath" class="form-text text-muted"></small> <small id="editPersonPhotoPath" class="form-text text-muted"></small>
</div> </div>
@ -360,17 +360,17 @@ $status_colors = [
<div class="col-md-6"> <div class="col-md-6">
<h5>Dokumenty członkowskie</h5> <h5>Dokumenty członkowskie</h5>
<div class="mb-3"> <div class="mb-3">
<label for="editGainsSheet" class="form-label">Arkusz GAINS</label> <label for="editGainsSheet" class="form-label"><?= t('form.gains_sheet', 'Arkusz GAINS') ?></label>
<input class="form-control" type="file" id="editGainsSheet" name="gains_sheet"> <input class="form-control" type="file" id="editGainsSheet" name="gains_sheet">
<small id="editGainsSheetPath" class="form-text text-muted"></small> <small id="editGainsSheetPath" class="form-text text-muted"></small>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="editTopWanted" class="form-label">Lista TOP poszukiwanych kontaktów</label> <label for="editTopWanted" class="form-label"><?= t('form.top_wanted', 'Lista TOP poszukiwanych kontaktów') ?></label>
<input class="form-control" type="file" id="editTopWanted" name="top_wanted_contacts"> <input class="form-control" type="file" id="editTopWanted" name="top_wanted_contacts">
<small id="editTopWantedPath" class="form-text text-muted"></small> <small id="editTopWantedPath" class="form-text text-muted"></small>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="editTopOwned" class="form-label">Lista TOP posiadanych kontaktów</label> <label for="editTopOwned" class="form-label"><?= t('form.top_owned', 'Lista TOP posiadanych kontaktów') ?></label>
<input class="form-control" type="file" id="editTopOwned" name="top_owned_contacts"> <input class="form-control" type="file" id="editTopOwned" name="top_owned_contacts">
<small id="editTopOwnedPath" class="form-text text-muted"></small> <small id="editTopOwnedPath" class="form-text text-muted"></small>
</div> </div>
@ -378,8 +378,8 @@ $status_colors = [
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Zamknij</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?= t('modal.close', 'Zamknij') ?></button>
<button type="submit" class="btn btn-primary">Zapisz zmiany</button> <button type="submit" class="btn btn-primary"><?= t('modal.save_changes', 'Zapisz zmiany') ?></button>
<button type="button" class="btn btn-danger ms-auto" id="deleteUserBtn" data-bs-toggle="modal" data-bs-target="#deletePersonModal">Usuń</button> <button type="button" class="btn btn-danger ms-auto" id="deleteUserBtn" data-bs-toggle="modal" data-bs-target="#deletePersonModal">Usuń</button>
</div> </div>
</form> </form>
@ -387,12 +387,12 @@ $status_colors = [
</div> </div>
</div> </div>
<!-- Create Person Modal --> <!-- <?= t('dashboard.create_person', 'Dodaj osobę') ?> Modal -->
<div class="modal fade" id="createPersonModal" tabindex="-1" aria-labelledby="createPersonModalLabel" aria-hidden="true"> <div class="modal fade" id="createPersonModal" tabindex="-1" aria-labelledby="createPersonModalLabel" aria-hidden="true">
<div class="modal-dialog modal-fullscreen-xl"> <div class="modal-dialog modal-fullscreen-xl">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="createPersonModalLabel">Create Person</h5> <h5 class="modal-title" id="createPersonModalLabel"><?= t('dashboard.create_person', 'Dodaj osobę') ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
@ -400,29 +400,29 @@ $status_colors = [
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="mb-3"> <div class="mb-3">
<label for="createFirstName" class="form-label">First Name <span class="text-danger">*</span></label> <label for="createFirstName" class="form-label"><?= t('form.first_name', 'Imię') ?> <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="createFirstName" name="first_name" required> <input type="text" class="form-control" id="createFirstName" name="first_name" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="createLastName" class="form-label">Last Name <span class="text-danger">*</span></label> <label for="createLastName" class="form-label"><?= t('form.last_name', 'Nazwisko') ?> <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="createLastName" name="last_name" required> <input type="text" class="form-control" id="createLastName" name="last_name" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="createPhone" class="form-label">Phone Number</label> <label for="createPhone" class="form-label"><?= t('form.phone', 'Numer telefonu') ?></label>
<input type="text" class="form-control" id="createPhone" name="phone"> <input type="text" class="form-control" id="createPhone" name="phone">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="createEmail" class="form-label">Email (Login) <span class="text-danger">*</span></label> <label for="createEmail" class="form-label"><?= t('form.email', 'Email (login)') ?> <span class="text-danger">*</span></label>
<input type="email" class="form-control" id="createEmail" name="email" required> <input type="email" class="form-control" id="createEmail" name="email" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="createPassword" class="form-label">Password <span class="text-danger">*</span></label> <label for="createPassword" class="form-label"><?= t('form.password', 'Hasło') ?> <span class="text-danger">*</span></label>
<input type="password" class="form-control" id="createPassword" name="password" required> <input type="password" class="form-control" id="createPassword" name="password" required>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="mb-3"> <div class="mb-3">
<label for="createRole" class="form-label">Rola</label> <label for="createRole" class="form-label"><?= t('form.role', 'Rola') ?></label>
<select class="form-select" id="createRole" name="role" required> <select class="form-select" id="createRole" name="role" required>
<option value="admin">Admin</option> <option value="admin">Admin</option>
<option value="member" selected>Członek</option> <option value="member" selected>Członek</option>
@ -431,7 +431,7 @@ $status_colors = [
</select> </select>
</div> </div>
<div class="mb-3" id="create-group-selection-div"> <div class="mb-3" id="create-group-selection-div">
<label for="createBniGroup" class="form-label">Grupa</label> <label for="createBniGroup" class="form-label"><?= t('form.group', 'Grupa') ?></label>
<select class="form-select" id="createBniGroup" name="bni_group_id"> <select class="form-select" id="createBniGroup" name="bni_group_id">
<option value="">Wybierz grupę...</option> <option value="">Wybierz grupę...</option>
<?php foreach ($bni_groups as $group): ?> <?php foreach ($bni_groups as $group): ?>
@ -440,7 +440,7 @@ $status_colors = [
</select> </select>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="createRoles" class="form-label">Funkcje</label> <label for="createRoles" class="form-label"><?= t('form.functions', 'Funkcje') ?></label>
<select class="form-select" id="createRoles" name="functions[]" multiple size="5"> <select class="form-select" id="createRoles" name="functions[]" multiple size="5">
<?php foreach ($all_functions as $function): ?> <?php foreach ($all_functions as $function): ?>
<option value="<?= $function['id'] ?>"><?= htmlspecialchars($function['name']) ?></option> <option value="<?= $function['id'] ?>"><?= htmlspecialchars($function['name']) ?></option>
@ -448,25 +448,25 @@ $status_colors = [
</select> </select>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="createCompanyName" class="form-label">Company Name</label> <label for="createCompanyName" class="form-label"><?= t('form.company_name', 'Nazwa firmy') ?></label>
<input type="text" class="form-control" id="createCompanyName" name="company_name"> <input type="text" class="form-control" id="createCompanyName" name="company_name">
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="mb-3"> <div class="mb-3">
<label for="createNip" class="form-label">NIP</label> <label for="createNip" class="form-label"><?= t('form.nip', 'NIP') ?></label>
<input type="text" class="form-control" id="createNip" name="nip"> <input type="text" class="form-control" id="createNip" name="nip">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="createIndustry" class="form-label">Branża</label> <label for="createIndustry" class="form-label"><?= t('form.industry', 'Branża') ?></label>
<input type="text" class="form-control" id="createIndustry" name="industry"> <input type="text" class="form-control" id="createIndustry" name="industry">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="createCompanySize" class="form-label">Wielkość firmy / Przychody</label> <label for="createCompanySize" class="form-label"><?= t('form.company_size', 'Wielkość firmy / Przychody') ?></label>
<input type="text" class="form-control" id="createCompanySize" name="company_size_revenue"> <input type="text" class="form-control" id="createCompanySize" name="company_size_revenue">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="createBusinessDescription" class="form-label">Opis działalności</label> <label for="createBusinessDescription" class="form-label"><?= t('form.business_description', 'Opis działalności') ?></label>
<textarea class="form-control" id="createBusinessDescription" name="business_description" rows="3"></textarea> <textarea class="form-control" id="createBusinessDescription" name="business_description" rows="3"></textarea>
</div> </div>
</div> </div>
@ -477,31 +477,31 @@ $status_colors = [
<div class="col-md-6"> <div class="col-md-6">
<h5>Pliki firmowe</h5> <h5>Pliki firmowe</h5>
<div class="mb-3"> <div class="mb-3">
<label for="createCompanyLogo" class="form-label">Logo firmy</label> <label for="createCompanyLogo" class="form-label"><?= t('form.company_logo', 'Logo firmy') ?></label>
<input class="form-control" type="file" id="createCompanyLogo" name="company_logo"> <input class="form-control" type="file" id="createCompanyLogo" name="company_logo">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="createPersonPhoto" class="form-label">Zdjęcie osoby</label> <label for="createPersonPhoto" class="form-label"><?= t('form.person_photo', 'Zdjęcie osoby') ?></label>
<input class="form-control" type="file" id="createPersonPhoto" name="person_photo"> <input class="form-control" type="file" id="createPersonPhoto" name="person_photo">
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<h5>Dokumenty członkowskie</h5> <h5>Dokumenty członkowskie</h5>
<div class="mb-3"> <div class="mb-3">
<label for="createGainsSheet" class="form-label">Arkusz GAINS</label> <label for="createGainsSheet" class="form-label"><?= t('form.gains_sheet', 'Arkusz GAINS') ?></label>
<input class="form-control" type="file" id="createGainsSheet" name="gains_sheet"> <input class="form-control" type="file" id="createGainsSheet" name="gains_sheet">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="createTopWanted" class="form-label">Lista TOP poszukiwanych kontaktów</label> <label for="createTopWanted" class="form-label"><?= t('form.top_wanted', 'Lista TOP poszukiwanych kontaktów') ?></label>
<input class="form-control" type="file" id="createTopWanted" name="top_wanted_contacts"> <input class="form-control" type="file" id="createTopWanted" name="top_wanted_contacts">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="createTopOwned" class="form-label">Lista TOP posiadanych kontaktów</label> <label for="createTopOwned" class="form-label"><?= t('form.top_owned', 'Lista TOP posiadanych kontaktów') ?></label>
<input class="form-control" type="file" id="createTopOwned" name="top_owned_contacts"> <input class="form-control" type="file" id="createTopOwned" name="top_owned_contacts">
</div> </div>
</div> </div>
</div> </div>
<button type="submit" class="btn btn-primary mt-3">Create Person</button> <button type="submit" class="btn btn-primary mt-3"><?= t('dashboard.create_person', 'Dodaj osobę') ?></button>
</form> </form>
</div> </div>
</div> </div>
@ -513,14 +513,14 @@ $status_colors = [
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="deletePersonModalLabel">Potwierdź usunięcie</h5> <h5 class="modal-title" id="deletePersonModalLabel"><?= t('modal.confirm_delete', 'Potwierdź usunięcie') ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Zamknij"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Zamknij"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
Czy na pewno chcesz usunąć użytkownika <strong id="personNameToDelete"></strong>? Tej operacji nie można cofnąć. Czy na pewno chcesz usunąć użytkownika <strong id="personNameToDelete"></strong>? Tej operacji nie można cofnąć.
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Anuluj</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?= t('modal.cancel', 'Anuluj') ?></button>
<button type="button" class="btn btn-danger" id="confirmDeleteBtn">Tak, usuń</button> <button type="button" class="btn btn-danger" id="confirmDeleteBtn">Tak, usuń</button>
</div> </div>
</div> </div>
@ -534,7 +534,7 @@ $status_colors = [
<div class="modal-content"> <div class="modal-content">
<form id="meetingAttendanceForm"> <form id="meetingAttendanceForm">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="meetingAttendanceModalLabel">Update Attendance</h5> <h5 class="modal-title" id="meetingAttendanceModalLabel"><?= t('modal.update_attendance', 'Aktualizuj obecność') ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
@ -543,7 +543,7 @@ $status_colors = [
<input type="hidden" name="meeting_date" id="meetingDate"> <input type="hidden" name="meeting_date" id="meetingDate">
<p><strong>Person:</strong> <span id="meetingPersonName"></span></p> <p><strong>Person:</strong> <span id="meetingPersonName"></span></p>
<div class="mb-3"> <div class="mb-3">
<label for="attendanceStatus" class="form-label">Status</label> <label for="attendanceStatus" class="form-label"><?= t('form.status', 'Status') ?></label>
<select class="form-select" id="attendanceStatus" name="attendance_status"> <select class="form-select" id="attendanceStatus" name="attendance_status">
<option value="present">Present</option> <option value="present">Present</option>
<option value="absent">Absent</option> <option value="absent">Absent</option>
@ -552,7 +552,7 @@ $status_colors = [
</select> </select>
</div> </div>
<div class="mb-3" id="guestSurveySection" style="display: none;"> <div class="mb-3" id="guestSurveySection" style="display: none;">
<label class="form-label">Guest Survey</label> <label class="form-label"><?= t('form.guest_survey', 'Ankieta gościa') ?></label>
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="radio" name="guest_survey" id="guestSurvey1" value="1"> <input class="form-check-input" type="radio" name="guest_survey" id="guestSurvey1" value="1">
<label class="form-check-label" for="guestSurvey1">1 (Positive)</label> <label class="form-check-label" for="guestSurvey1">1 (Positive)</label>
@ -568,8 +568,8 @@ $status_colors = [
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?= t('modal.close', 'Zamknij') ?></button>
<button type="submit" class="btn btn-primary">Save Changes</button> <button type="submit" class="btn btn-primary"><?= t('modal.save_changes', 'Zapisz zmiany') ?></button>
</div> </div>
</form> </form>
</div> </div>
@ -811,14 +811,14 @@ document.addEventListener('DOMContentLoaded', function () {
<div class="modal-dialog modal-lg"> <div class="modal-dialog modal-lg">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="instanceModalLabel">Process Details</h5> <h5 class="modal-title" id="instanceModalLabel"><?= t('modal.process_details', 'Szczegóły procesu') ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<!-- Content will be loaded here via AJAX --> <!-- Content will be loaded here via AJAX -->
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?= t('modal.close', 'Zamknij') ?></button>
</div> </div>
</div> </div>
</div> </div>
@ -1097,14 +1097,14 @@ document.addEventListener('DOMContentLoaded', function () {
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title">Bulk Status Update</h5> <h5 class="modal-title"><?= t('dashboard.bulk_status_update', 'Zbiorcza aktualizacja statusu') ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button> <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form action="_bulk_update_status.php" method="post"> <form action="_bulk_update_status.php" method="post">
<input type="hidden" name="person_ids" id="bulkStatusPersonIds"> <input type="hidden" name="person_ids" id="bulkStatusPersonIds">
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Process</label> <label class="form-label"><?= t('form.process', 'Proces') ?></label>
<select name="process_id" class="form-select" required> <select name="process_id" class="form-select" required>
<?php foreach($processes as $process): ?> <?php foreach($processes as $process): ?>
<option value="<?= $process['id'] ?>"><?= htmlspecialchars($process['name']) ?></option> <option value="<?= $process['id'] ?>"><?= htmlspecialchars($process['name']) ?></option>
@ -1112,7 +1112,7 @@ document.addEventListener('DOMContentLoaded', function () {
</select> </select>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label">New Status</label> <label class="form-label"><?= t('form.new_status', 'Nowy status') ?></label>
<select name="status" class="form-select" required> <select name="status" class="form-select" required>
<option value="none">None</option> <option value="none">None</option>
<option value="negative">Negative</option> <option value="negative">Negative</option>
@ -1120,7 +1120,7 @@ document.addEventListener('DOMContentLoaded', function () {
<option value="positive">Positive</option> <option value="positive">Positive</option>
</select> </select>
</div> </div>
<button type="submit" class="btn btn-primary">Update Status</button> <button type="submit" class="btn btn-primary"><?= t('dashboard.update_status', 'Zaktualizuj status') ?></button>
</form> </form>
</div> </div>
</div> </div>
@ -1132,14 +1132,14 @@ document.addEventListener('DOMContentLoaded', function () {
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title">Bulk Add Event</h5> <h5 class="modal-title"><?= t('dashboard.bulk_add_event', 'Zbiorcze dodawanie zdarzenia') ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button> <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form action="_bulk_add_event.php" method="post"> <form action="_bulk_add_event.php" method="post">
<input type="hidden" name="person_ids" id="bulkEventPersonIds"> <input type="hidden" name="person_ids" id="bulkEventPersonIds">
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Process</label> <label class="form-label"><?= t('form.process', 'Proces') ?></label>
<select name="process_id" class="form-select" required> <select name="process_id" class="form-select" required>
<?php foreach($processes as $process): ?> <?php foreach($processes as $process): ?>
<option value="<?= $process['id'] ?>"><?= htmlspecialchars($process['name']) ?></option> <option value="<?= $process['id'] ?>"><?= htmlspecialchars($process['name']) ?></option>
@ -1147,10 +1147,10 @@ document.addEventListener('DOMContentLoaded', function () {
</select> </select>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Event Description</label> <label class="form-label"><?= t('form.event_description', 'Opis zdarzenia') ?></label>
<textarea name="description" class="form-control" required></textarea> <textarea name="description" class="form-control" required></textarea>
</div> </div>
<button type="submit" class="btn btn-primary">Add Event</button> <button type="submit" class="btn btn-primary"><?= t('dashboard.add_event', 'Dodaj zdarzenie') ?></button>
</form> </form>
</div> </div>
</div> </div>
@ -1162,21 +1162,21 @@ document.addEventListener('DOMContentLoaded', function () {
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title">Bulk Initialize Instances</h5> <h5 class="modal-title"><?= t('dashboard.bulk_init_instances', 'Zbiorcza inicjalizacja instancji') ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button> <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form action="_bulk_init_instances.php" method="post"> <form action="_bulk_init_instances.php" method="post">
<input type="hidden" name="person_ids" id="bulkInitPersonIds"> <input type="hidden" name="person_ids" id="bulkInitPersonIds">
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Process</label> <select name="process_id" class="form-select" required> <label class="form-label"><?= t('form.process', 'Proces') ?></label> <select name="process_id" class="form-select" required>
<?php foreach($processes as $process): ?> <?php foreach($processes as $process): ?>
<option value="<?= $process['id'] ?>"><?= htmlspecialchars($process['name']) ?></option> <option value="<?= $process['id'] ?>"><?= htmlspecialchars($process['name']) ?></option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
</div> </div>
<p>This will initialize this process for all selected people if it is not already initialized.</p> <p>This will initialize this process for all selected people if it is not already initialized.</p>
<button type="submit" class="btn btn-primary">Initialize</button> <button type="submit" class="btn btn-primary"><?= t('dashboard.initialize', 'Inicjalizuj') ?></button>
</form> </form>
</div> </div>
</div> </div>

146
lang/pl.php Normal file
View File

@ -0,0 +1,146 @@
<?php
// lang/pl.php
return [
// Menu Sidebar
'menu.process_dashboard' => 'Pulpit procesów',
'menu.calendar' => 'Kalendarz',
'menu.settings' => 'Ustawienia',
'menu.event_types' => 'Typy zdarzeń',
'menu.bni_groups' => 'Grupy BNI',
'menu.functions' => 'Funkcje',
'menu.process_definitions' => 'Definicje procesów',
// Dashboard Headers
'dashboard.title' => 'Pulpit nawigacyjny',
'dashboard.meetings' => 'Spotkania',
'dashboard.other_processes' => 'Inne procesy',
'dashboard.bulk_actions' => 'Akcje zbiorcze',
'dashboard.bulk_status_update' => 'Zbiorcza aktualizacja statusu',
'dashboard.bulk_add_event' => 'Zbiorcze dodawanie zdarzenia',
'dashboard.bulk_init_instances' => 'Zbiorcza inicjalizacja instancji',
'dashboard.bulk_print_badge' => 'Drukuj identyfikatory',
'dashboard.bulk_print_attendance' => 'Drukuj listę obecności',
'dashboard.create_person' => 'Dodaj osobę',
'dashboard.filter_by_group' => 'Filtruj wg grupy:',
'dashboard.all_groups' => 'Wszystkie grupy',
'dashboard.search' => 'Szukaj',
'dashboard.search_placeholder' => 'Szukaj osoby, procesu, firmy...',
// Modals
'modal.start_process' => 'Uruchom proces',
'modal.process_not_started' => 'Proces nie został uruchomiony',
'modal.available_actions' => 'Dostępne akcje',
'modal.history' => 'Historia',
'modal.add_note' => 'Dodaj notatkę',
'modal.close' => 'Zamknij',
'modal.save_changes' => 'Zapisz zmiany',
'modal.cancel' => 'Anuluj',
// Form labels
'form.first_name' => 'Imię',
'form.last_name' => 'Nazwisko',
'form.phone' => 'Telefon',
'form.email' => 'E-mail',
'form.company_name' => 'Nazwa firmy',
'form.industry' => 'Branża',
'form.bni_group' => 'Grupa BNI',
'form.role' => 'Funkcja',
'form.details' => 'Szczegóły',
'form.type' => 'Typ',
'form.status' => 'Status',
'form.description' => 'Opis',
'form.date' => 'Data',
'form.time' => 'Czas',
// Calendar
'calendar.previous' => 'Poprzedni',
'calendar.next' => 'Następny',
'calendar.add_event' => 'Dodaj wydarzenie',
'calendar.monday' => 'Poniedziałek',
'calendar.tuesday' => 'Wtorek',
'calendar.wednesday' => 'Środa',
'calendar.thursday' => 'Czwartek',
'calendar.friday' => 'Piątek',
'calendar.saturday' => 'Sobota',
'calendar.sunday' => 'Niedziela',
'calendar.event_details' => 'Szczegóły wydarzenia',
'calendar.starts' => 'Rozpoczęcie:',
'calendar.ends' => 'Zakończenie:',
'calendar.type' => 'Typ:',
'calendar.edit' => 'Edytuj',
'calendar.delete' => 'Usuń',
'calendar.add_event_title' => 'Dodaj wydarzenie',
'calendar.title' => 'Tytuł',
'calendar.start_time' => 'Czas rozpoczęcia',
'calendar.end_time' => 'Czas zakończenia',
'calendar.groups' => 'Grupa(y)',
'calendar.recurrence' => 'Powtarzalność',
'calendar.no_repeat' => 'Nie powtarza się',
'calendar.daily' => 'Codziennie',
'calendar.weekly' => 'Co tydzień',
'calendar.monthly' => 'Co miesiąc',
'calendar.recurrence_end_date' => 'Data zakończenia powtarzalności',
'calendar.save_event' => 'Zapisz wydarzenie',
'calendar.edit_event_title' => 'Edytuj wydarzenie',
'calendar.recurring_notice' => 'To jest wydarzenie cykliczne.',
'calendar.update_scope_one' => 'Aktualizuj tylko to wydarzenie',
'calendar.update_scope_all' => 'Aktualizuj wszystkie wydarzenia w serii',
'calendar.january' => 'Styczeń',
'calendar.february' => 'Luty',
'calendar.march' => 'Marzec',
'calendar.april' => 'Kwiecień',
'calendar.may' => 'Maj',
'calendar.june' => 'Czerwiec',
'calendar.july' => 'Lipiec',
'calendar.august' => 'Sierpień',
'calendar.september' => 'Wrzesień',
'calendar.october' => 'Październik',
'calendar.november' => 'Listopad',
'calendar.december' => 'Grudzień',
// BNI Groups
'bni_groups.title' => 'Grupy BNI',
'bni_groups.add_new' => 'Dodaj nową grupę BNI',
'bni_groups.name' => 'Nazwa',
'bni_groups.city' => 'Miasto',
'bni_groups.active' => 'Aktywna',
'bni_groups.actions' => 'Akcje',
'bni_groups.yes' => 'Tak',
'bni_groups.no' => 'Nie',
'bni_groups.edit' => 'Edytuj',
'bni_groups.delete' => 'Usuń',
'bni_groups.add_title' => 'Dodaj grupę BNI',
'bni_groups.add_button' => 'Dodaj',
'bni_groups.edit_title' => 'Edytuj grupę BNI',
'bni_groups.delete_title' => 'Usuń grupę BNI',
'bni_groups.delete_confirm' => 'Czy na pewno chcesz usunąć tę grupę BNI?',
// Event Types
'event_types.title' => 'Typy zdarzeń',
'event_types.add_new' => 'Dodaj nowy typ zdarzenia',
'event_types.name' => 'Nazwa',
'event_types.color' => 'Kolor',
'event_types.actions' => 'Akcje',
'event_types.edit' => 'Edytuj',
'event_types.delete' => 'Usuń',
'event_types.add_title' => 'Dodaj typ zdarzenia',
'event_types.add_button' => 'Dodaj',
'event_types.edit_title' => 'Edytuj typ zdarzenia',
'event_types.delete_title' => 'Usuń typ zdarzenia',
'event_types.delete_confirm' => 'Czy na pewno chcesz usunąć ten typ zdarzenia?',
// Functions
'functions.title' => 'Funkcje',
'functions.add_new' => 'Dodaj nową funkcję',
'functions.name' => 'Nazwa',
'functions.group' => 'Grupa',
'functions.actions' => 'Akcje',
'functions.edit' => 'Edytuj',
'functions.delete' => 'Usuń',
'functions.add_title' => 'Dodaj funkcję',
'functions.select_group' => 'Wybierz grupę',
'functions.add_button' => 'Dodaj',
'functions.edit_title' => 'Edytuj funkcję',
'functions.delete_title' => 'Usuń funkcję',
'functions.delete_confirm' => 'Czy na pewno chcesz usunąć tę funkcję?',
];

View File

@ -47,3 +47,4 @@ function register_error_handler() {
// Don't output anything to the user for non-fatal errors, just log them // Don't output anything to the user for non-fatal errors, just log them
}); });
} }
register_error_handler();

View File

@ -1,5 +1,24 @@
<?php <?php
class WorkflowException extends Exception {
protected $httpCode;
protected $details;
public function __construct($message = "", $httpCode = 500, $details = [], Throwable $previous = null) {
parent::__construct($message, 0, $previous);
$this->httpCode = $httpCode;
$this->details = $details;
}
public function getHttpCode() {
return $this->httpCode;
}
public function getDetails() {
return $this->details;
}
}
class WorkflowNotFoundException extends Exception {} class WorkflowNotFoundException extends Exception {}
class WorkflowNotAllowedException extends Exception {} class WorkflowNotAllowedException extends Exception {}
class WorkflowRuleFailedException extends Exception {} class WorkflowRuleFailedException extends Exception {}
@ -15,4 +34,4 @@ class WorkflowEligibilityException extends Exception {
public function getReasons() { public function getReasons() {
return $this->reasons; return $this->reasons;
} }
} }

32
lib/i18n.php Normal file
View File

@ -0,0 +1,32 @@
<?php
// lib/i18n.php
// Wymaga session_start() dla potencjalnego przechowywania języka w przyszłości,
// ale na razie ustalamy na sztywno PL.
function load_translations($lang = 'pl') {
$lang_file = __DIR__ . '/../lang/' . $lang . '.php';
if (file_exists($lang_file)) {
return require $lang_file;
}
return [];
}
$GLOBALS['i18n_translations'] = load_translations('pl');
/**
* Tłumaczy podany klucz. Zwraca wartość z pliku tłumaczeń lub fallback/klucz.
*
* @param string $key Klucz do przetłumaczenia
* @param string|null $fallback Opcjonalna wartość domyślna, jeśli klucz nie zostanie znaleziony
* @return string Przetłumaczony tekst
*/
function t($key, $fallback = null) {
global $i18n_translations;
if (isset($i18n_translations[$key])) {
return $i18n_translations[$key];
}
return $fallback !== null ? $fallback : $key;
}