re-check final

This commit is contained in:
2026-06-01 22:55:50 +02:00
parent 7bdbf4e077
commit 04ba48e87b
136 changed files with 1362 additions and 21579 deletions
BIN
View File
Binary file not shown.
-3
View File
@@ -1,3 +0,0 @@
ignore-scripts=true
audit=true
prefix=/home/inext/.npm-global
-1
View File
@@ -1 +0,0 @@
{"version":2,"defects":{"Tests\\Feature\\ExampleTest::test_the_application_returns_a_successful_response":8,"Tests\\Feature\\CalendarEventsTest::test_generate_settimanale_events_produces_weekly_occurrences":8,"Tests\\Feature\\StorageRepositoryTest::test_can_create_webdav_repository":8,"Tests\\Feature\\StorageRepositoryTest::test_can_create_google_drive_repository":8,"Tests\\Feature\\StorageRepositoryTest::test_requires_nome_and_tipo":8,"Tests\\Feature\\StorageRepositoryTest::test_can_list_repositories_in_settings":8,"Tests\\Feature\\StorageRepositoryTest::test_can_delete_repository_with_no_documents":8,"Tests\\Feature\\StorageRepositoryTest::test_encrypts_sensitive_config_fields":8,"Tests\\Feature\\StorageRepositoryTest::test_tipo_labels":8,"Tests\\Feature\\StorageRepositoryTest::test_tipo_icons":8,"Tests\\Feature\\StorageRepositoryTest::test_can_reorder_repositories":8,"Tests\\Unit\\StorageRepositoryServiceTest::test_encrypts_webdav_password":8,"Tests\\Unit\\StorageRepositoryServiceTest::test_encrypts_google_drive_secrets":8,"Tests\\Unit\\StorageRepositoryServiceTest::test_builds_null_filesystem_for_unknown_tipo":8,"Tests\\Feature\\CalendarEventsTest::test_find_first_sunday_of_june_2026":8,"Tests\\Feature\\CalendarEventsTest::test_find_second_saturday_of_june_2026":8,"Tests\\Feature\\CalendarEventsTest::test_find_fifth_sunday_returns_null_when_not_in_month":8,"Tests\\Feature\\CalendarEventsTest::test_generate_mensile_events_for_all_months":8,"Tests\\Feature\\CalendarEventsTest::test_generate_mensile_events_respects_selected_months":8,"Tests\\Feature\\CalendarEventsTest::test_generate_annuale_events_produces_correct_dates":8},"times":{"Tests\\Unit\\ExampleTest::test_that_true_is_true":0.001,"Tests\\Feature\\ExampleTest::test_the_application_returns_a_successful_response":0.029,"Tests\\Feature\\CalendarEventsTest::test_find_first_sunday_of_june_2026":0.003,"Tests\\Feature\\CalendarEventsTest::test_find_second_saturday_of_june_2026":0.001,"Tests\\Feature\\CalendarEventsTest::test_find_fifth_sunday_returns_null_when_not_in_month":0.001,"Tests\\Feature\\CalendarEventsTest::test_generate_mensile_events_for_all_months":0.014,"Tests\\Feature\\CalendarEventsTest::test_generate_mensile_events_respects_selected_months":0.001,"Tests\\Feature\\CalendarEventsTest::test_generate_annuale_events_produces_correct_dates":0.001,"Tests\\Feature\\CalendarEventsTest::test_generate_settimanale_events_produces_weekly_occurrences":0.005,"Tests\\Unit\\StorageRepositoryServiceTest::test_encrypts_webdav_password":0.016,"Tests\\Unit\\StorageRepositoryServiceTest::test_encrypts_google_drive_secrets":0.001,"Tests\\Unit\\StorageRepositoryServiceTest::test_builds_null_filesystem_for_unknown_tipo":0.015,"Tests\\Feature\\StorageRepositoryTest::test_can_create_webdav_repository":0.026,"Tests\\Feature\\StorageRepositoryTest::test_can_create_google_drive_repository":0.005,"Tests\\Feature\\StorageRepositoryTest::test_requires_nome_and_tipo":0.006,"Tests\\Feature\\StorageRepositoryTest::test_can_delete_repository_with_no_documents":0.009,"Tests\\Feature\\StorageRepositoryTest::test_tipo_labels":0.001,"Tests\\Feature\\StorageRepositoryTest::test_tipo_icons":0.001,"Tests\\Feature\\StorageRepositoryTest::test_can_reorder_repositories":0.007}}
-114
View File
@@ -1,114 +0,0 @@
-# AGENTS.md
## System Prompt Senior PHP 8.4 / Laravel 13 / AdminLTE / MySQL (Enterprise)
### 🎯 Ruolo
Sei un **Senior Software Engineer** specializzato in:
- PHP **8.4**
- Laravel **13**
- AdminLTE
- MySQL
- Architetture enterprise, scalabili e manutenibili
Il tuo compito è produrre codice completo, sicuro, scalabile e conforme agli standard professionali.
---
### 🧠 Gestione della memoria (`MEMORY.md`)
#Prima di **ogni azione**, devi:
#
#1. **Leggere `MEMORY.md`** per recuperare il contesto precedente.
#2. **Aggiornare `MEMORY.md`** con:
# - nuove scoperte tecniche,
# - decisioni architetturali,
# - file creati o modificati,
# - dipendenze aggiunte,
# - problemi risolti o aperti,
# - convenzioni adottate.
#
# `MEMORY.md` è la **fonte di verità** del progetto e garantisce continuità e coerenza.
### 🧠 Gestione della memoria (MEMORY.md)
Prima di ogni azione devi:
1. Leggere completamente il file `MEMORY.md` per recuperare il contesto precedente.
2. Utilizzare le informazioni contenute in `MEMORY.md` per garantire continuità, coerenza e allineamento del progetto.
---
### 📌 Regola obbligatoria di persistenza
Dopo ogni richiesta dellutente, lagente deve:
1. Rileggere completamente `MEMORY.md` prima di iniziare qualsiasi operazione.
2. Aggiornare `MEMORY.md` riscrivendolo per intero, includendo:
- nuove informazioni apprese,
- file creati o modificati,
- decisioni architetturali,
- dipendenze aggiunte,
- problemi aperti o risolti,
- stato corrente del progetto,
- qualsiasi contenuto rilevante generato nella risposta.
3. Salvare il nuovo contenuto di `MEMORY.md` nella root del repository.
4. Ogni risposta dellagente deve sempre contenere:
- loutput richiesto dallutente,
- la nuova versione completa e aggiornata di `MEMORY.md`.
Se una sezione di `MEMORY.md` non cambia, deve comunque essere mantenuta.
---
### 🧩 Stile di lavoro
- Produci **file completi**, mai snippet isolati.
- Rispetta **PSR12**, **SOLID**, **Clean Architecture**, **DDD** quando applicabile.
- Usa Laravel 13 con:
- Eloquent ORM,
- Form Request,
- Resource / ResourceCollection,
- Policy + Gate,
- Eventi + Listener,
- Modularizzazione del codice.
- Usa AdminLTE integrato con Blade e asset pipeline. Prendi a riferimento questa pagina per le viste: https://adminlte.io/themes/AdminLTE/index2.html
- Usa MySQL con:
- migrazioni complete,
- foreign key,
- indici ottimizzati,
- naming convention coerente.
---
### 🔐 Sicurezza e qualità
- Valida sempre input e output.
- Evita SQL injection, XSS, CSRF, mass assignment.
- Usa DTO o Resource per lesposizione dati.
- Scrivi test PHPUnit quando richiesto.
- Documenta con PHPDoc e README tecnici.
---
### ⚙️ Configurazione speciale
Imposta sempre:
OPENCODE_EXPERIMENTAL_LSP_TOOL=true
---
### 🧭 Modalità di risposta
Ogni volta che produci output:
1. **Controlla `MEMORY.md`**
2. Aggiorna `MEMORY.md`
3. Genera:
- file completi,
- struttura delle directory,
- istruzioni di installazione,
- comandi artisan,
- note architetturali,
- eventuali script di build.
---
### 🔗 Collegamenti utili
- [Laravel_architettura](ca://s?q=Laravel_architettura)
- [AdminLTE_integrazione](ca://s?q=AdminLTE_integrazione)
- [Pattern_enterprise_PHP](ca://s?q=Pattern_enterprise_PHP)
- [Gestione_MEMORIA_md](ca://s?q=Gestione_MEMORIA_md)
+37 -1078
View File
File diff suppressed because it is too large Load Diff
+59
View File
@@ -0,0 +1,59 @@
<?php
declare(strict_types=1);
namespace App\Console\Commands;
use App\Models\AppSetting;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\View;
use Illuminate\Support\Facades\Storage;
class ExportHelpPdf extends Command
{
protected $signature = 'help:export-pdf {--output= : Output path for the PDF file}';
protected $description = 'Genera il PDF della guida completa';
public function handle(): int
{
$appName = AppSetting::getAppName() ?? 'Glastree';
$this->components->info('Generazione HTML della guida...');
$html = View::make('help.pdf', ['appName' => $appName])->render();
$tmpHtml = tempnam(sys_get_temp_dir(), 'help_') . '.html';
file_put_contents($tmpHtml, $html);
$output = $this->option('output');
if (!$output) {
$output = storage_path('app/help-guida.pdf');
}
$this->components->info('Conversione in PDF via Chromium...');
$cmd = sprintf(
'/usr/bin/chromium --headless --no-sandbox --disable-gpu --print-to-pdf=%s %s 2>&1',
escapeshellarg($output),
escapeshellarg('file://' . $tmpHtml)
);
exec($cmd, $execOutput, $exitCode);
unlink($tmpHtml);
if ($exitCode !== 0) {
$this->components->error('Errore Chromium: ' . implode("\n", $execOutput));
return Command::FAILURE;
}
$size = filesize($output);
$this->components->success(sprintf(
'PDF generato: %s (%.2f MB)',
$output,
$size / 1024 / 1024
));
return Command::SUCCESS;
}
}
+57
View File
@@ -0,0 +1,57 @@
<?php
declare(strict_types=1);
namespace App\Http\Controllers;
use App\Models\AppSetting;
use Illuminate\View\View;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
class HelpController extends Controller
{
public function index(): View
{
return view('help.index', [
'appName' => AppSetting::getAppName() ?? 'Glastree',
]);
}
public function pdf(): View
{
return view('help.pdf', [
'appName' => AppSetting::getAppName() ?? 'Glastree',
]);
}
public function downloadPdf(): BinaryFileResponse
{
$pdfPath = storage_path('app/help-guida.pdf');
if (!file_exists($pdfPath)) {
$appName = AppSetting::getAppName() ?? 'Glastree';
$html = view('help.pdf', ['appName' => $appName])->render();
$tmpHtml = tempnam(sys_get_temp_dir(), 'help_') . '.html';
file_put_contents($tmpHtml, $html);
$cmd = sprintf(
'/usr/bin/chromium --headless --no-sandbox --disable-gpu --print-to-pdf=%s %s 2>&1',
escapeshellarg($pdfPath),
escapeshellarg('file://' . $tmpHtml)
);
exec($cmd, $execOutput, $exitCode);
unlink($tmpHtml);
if ($exitCode !== 0 || !file_exists($pdfPath)) {
abort(500, 'Errore generazione PDF. Assicurati che Chromium sia installato.');
}
}
return response()->download($pdfPath, 'guida-glastree.pdf', [
'Content-Type' => 'application/pdf',
]);
}
}
+7
View File
@@ -11,6 +11,7 @@ use App\Models\Individuo;
use App\Models\EmailMessage;
use App\Models\MailingList;
use App\Models\Notifica;
use App\Services\BackupService;
use Illuminate\Support\Facades\Auth;
class HomeController extends Controller
@@ -19,9 +20,15 @@ class HomeController extends Controller
{
$user = Auth::user();
$backupsCount = 0;
if ($user->canManage('settings')) {
$backupsCount = count(app(BackupService::class)->list());
}
$stats = [
'individui' => Individuo::count(),
'gruppi' => Gruppo::count(),
'backups' => $backupsCount,
'notifiche' => $user->unreadNotificheCount(),
'documenti' => Documento::count(),
'eventi' => Evento::count(),
+18
View File
@@ -19,8 +19,26 @@ class AppSetting extends Model
'app_version',
'dashboard_welcome',
'show_version',
'backup_path',
'backup_retention_days',
'backup_include_files',
'backup_include_env',
'backup_auto_enabled',
'backup_auto_frequency',
'backup_auto_hour',
];
protected function casts(): array
{
return [
'backup_retention_days' => 'integer',
'backup_include_files' => 'boolean',
'backup_include_env' => 'boolean',
'backup_auto_enabled' => 'boolean',
'backup_auto_hour' => 'integer',
];
}
public static function getSetting(string $key, $default = null)
{
$setting = self::first();
+1 -2
View File
@@ -65,11 +65,10 @@ class BackupService
$result = ['success' => true, 'message' => '', 'filename' => ''];
try {
$this->cleanTemp();
File::ensureDirectoryExists($this->tempDir, 0755, true);
File::ensureDirectoryExists($this->backupDir, 0755, true);
$this->cleanTemp();
$timestamp = now()->format('Y-m-d_H-i-s');
$appName = str_replace(' ', '_', AppSetting::getAppName() ?? 'app');
$filename = $appName . '_' . $timestamp . '.zip';
-505
View File
@@ -1,505 +0,0 @@
/* =============================================================================
Glastree Installer - Styles
============================================================================= */
:root {
--primary: #007bff;
--primary-dark: #0056b3;
--success: #28a745;
--danger: #dc3545;
--warning: #ffc107;
--info: #17a2b8;
--dark: #343a40;
--light: #f8f9fa;
--border: #dee2e6;
--text: #212529;
--text-muted: #6c757d;
--radius: 8px;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
font-size: 15px;
line-height: 1.6;
color: var(--text);
background: #e9ecef;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 0 20px;
}
/* Header */
.installer-header {
background: linear-gradient(135deg, #343a40 0%, #212529 100%);
color: #fff;
padding: 30px 0;
text-align: center;
}
.installer-header h1 {
font-size: 28px;
font-weight: 700;
margin-bottom: 4px;
}
.installer-header .subtitle {
font-size: 14px;
opacity: 0.75;
margin: 0;
}
/* Step indicator */
.step-indicator {
text-align: center;
padding: 12px 0;
color: var(--text-muted);
font-size: 13px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 1px;
}
/* Card */
.card {
background: #fff;
border: 1px solid var(--border);
border-radius: var(--radius);
margin-bottom: 24px;
box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.card-body {
padding: 28px;
}
.card-body h2 {
font-size: 22px;
font-weight: 700;
margin-bottom: 8px;
}
.card-body h4 {
font-size: 17px;
font-weight: 600;
margin-bottom: 12px;
color: var(--dark);
}
.card-body h5 {
font-size: 15px;
font-weight: 600;
margin-bottom: 8px;
}
.card-body p {
color: var(--text-muted);
margin-bottom: 20px;
}
hr {
border: none;
border-top: 1px solid var(--border);
margin: 24px 0;
}
/* Form elements */
.form-group {
margin-bottom: 16px;
}
.form-group label {
display: block;
font-weight: 600;
margin-bottom: 4px;
font-size: 14px;
color: var(--dark);
}
.form-control {
width: 100%;
padding: 10px 14px;
font-size: 15px;
border: 1px solid var(--border);
border-radius: 6px;
background: #fff;
transition: border-color 0.2s;
}
.form-control:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
}
.form-text {
display: block;
margin-top: 4px;
font-size: 13px;
color: var(--text-muted);
}
/* Buttons */
.btn {
display: inline-block;
padding: 10px 22px;
font-size: 15px;
font-weight: 600;
border: none;
border-radius: 6px;
cursor: pointer;
text-decoration: none;
transition: all 0.2s;
}
.btn-primary {
background: var(--primary);
color: #fff;
}
.btn-primary:hover {
background: var(--primary-dark);
}
.btn-secondary {
background: #6c757d;
color: #fff;
}
.btn-secondary:hover {
background: #5a6268;
}
.btn-lg {
padding: 14px 32px;
font-size: 17px;
}
.form-actions {
display: flex;
gap: 12px;
justify-content: space-between;
align-items: center;
margin-top: 24px;
}
/* Option cards */
.option-group {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
margin: 20px 0;
}
.option-card {
display: block;
position: relative;
border: 2px solid var(--border);
border-radius: var(--radius);
cursor: pointer;
transition: all 0.2s;
overflow: hidden;
}
.option-card:hover {
border-color: var(--primary);
box-shadow: 0 2px 8px rgba(0,123,255,0.1);
}
.option-card.selected {
border-color: var(--primary);
background: rgba(0,123,255,0.03);
}
.option-card .option-radio {
position: absolute;
opacity: 0;
width: 0;
height: 0;
}
.option-content {
padding: 20px;
}
.option-icon {
font-size: 32px;
margin-bottom: 8px;
color: var(--primary);
}
.option-card h3 {
font-size: 17px;
font-weight: 700;
margin-bottom: 6px;
}
.option-card p {
font-size: 13px;
line-height: 1.5;
}
.option-card ul {
margin-top: 8px;
padding-left: 18px;
font-size: 13px;
color: var(--text-muted);
}
.option-card ul li {
margin-bottom: 2px;
}
/* Requirements */
.requirements-list {
margin: 16px 0;
}
.requirement-item {
display: flex;
align-items: center;
gap: 12px;
padding: 10px 14px;
border: 1px solid var(--border);
border-radius: 6px;
margin-bottom: 6px;
font-size: 14px;
}
.requirement-item.passed {
background: #f0fff4;
border-color: #b8e6c8;
}
.requirement-item.failed {
background: #fff5f5;
border-color: #f5c6cb;
}
.req-icon {
font-size: 18px;
width: 24px;
text-align: center;
}
.requirement-item.passed .req-icon { color: var(--success); }
.requirement-item.failed .req-icon { color: var(--danger); }
.req-name {
flex: 1;
font-weight: 600;
}
.req-status {
font-size: 12px;
font-weight: 700;
padding: 2px 8px;
border-radius: 4px;
}
.requirement-item.passed .req-status {
background: #d4edda;
color: #155724;
}
.requirement-item.failed .req-status {
background: #f8d7da;
color: #721c24;
}
.req-msg {
width: 100%;
margin-top: 4px;
font-size: 13px;
color: var(--danger);
}
/* Alerts */
.alert {
padding: 14px 18px;
border-radius: 6px;
margin-bottom: 16px;
font-size: 14px;
line-height: 1.5;
}
.alert-danger {
background: #f8d7da;
border: 1px solid #f5c6cb;
color: #721c24;
}
.alert-success {
background: #d4edda;
border: 1px solid #c3e6cb;
color: #155724;
}
.alert-warning {
background: #fff3cd;
border: 1px solid #ffeeba;
color: #856404;
}
.alert-info {
background: #d1ecf1;
border: 1px solid #bee5eb;
color: #0c5460;
}
.alert ul {
margin-top: 8px;
padding-left: 20px;
}
/* Log list */
.log-list {
margin: 12px 0;
}
.log-item {
padding: 6px 12px;
font-size: 13px;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
background: var(--light);
border-left: 3px solid var(--success);
margin-bottom: 2px;
}
/* Results list */
.results-list {
margin: 16px 0;
}
.result-item {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 14px;
border-radius: 6px;
margin-bottom: 4px;
font-size: 14px;
}
.result-item.success {
background: #f0fff4;
color: #155724;
}
.result-item.error {
background: #fff5f5;
color: #721c24;
}
.result-icon {
font-size: 18px;
}
/* Final box */
.final-box {
background: var(--light);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 20px;
margin-bottom: 20px;
}
.final-box h3 {
font-size: 17px;
font-weight: 700;
margin-bottom: 12px;
}
.final-box ol,
.final-box ul {
padding-left: 20px;
line-height: 1.8;
}
code {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
font-size: 13px;
background: #f4f4f4;
padding: 2px 6px;
border-radius: 4px;
border: 1px solid #e0e0e0;
}
code.d-block {
display: block;
background: #f4f4f4;
border-radius: 6px;
font-size: 13px;
}
.bg-light {
background: var(--light);
}
.p-2 {
padding: 12px;
}
.p-3 {
padding: 16px;
}
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.border {
border: 1px solid var(--border);
}
.rounded {
border-radius: 6px;
}
.badge-admin {
background: #007bff;
color: #fff;
font-size: 11px;
padding: 2px 8px;
border-radius: 4px;
font-weight: 600;
}
/* Icons via unicode/emoji fallback since no icon font */
.icon-ok::before { content: "\2714 "; }
.icon-error::before { content: "\2718 "; }
.icon-warning::before { content: "\26A0 "; }
.icon-rocket::before { content: "\1F680 "; }
.icon-upload::before { content: "\2191 "; }
.icon-tree::before { content: "\2328 "; }
/* Responsive */
@media (max-width: 600px) {
.option-group {
grid-template-columns: 1fr;
}
.form-actions {
flex-direction: column;
}
.form-actions .btn {
width: 100%;
text-align: center;
}
}
/* Footer */
.installer-footer {
text-align: center;
padding: 16px 0;
color: var(--text-muted);
font-size: 13px;
}
-533
View File
@@ -1,533 +0,0 @@
<?php
declare(strict_types=1);
// =============================================================================
// Glastree Installer - Helper Functions
// =============================================================================
function getBaseUrl(): string
{
$scheme = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') ? 'https' : 'http';
$host = $_SERVER['HTTP_HOST'] ?? 'localhost';
$scriptDir = dirname($_SERVER['SCRIPT_NAME']);
$scriptDir = str_replace('/installer', '', $scriptDir);
return $scheme . '://' . $host . $scriptDir;
}
function siteUrl(string $path = ''): string
{
return rtrim(getBaseUrl(), '/') . '/' . ltrim($path, '/');
}
function redirect(string $url): never
{
header('Location: ' . $url);
exit;
}
function isEnvFileExists(): bool
{
return file_exists(dirname(__DIR__) . '/.env');
}
function e(mixed $value): string
{
return htmlspecialchars((string) $value, ENT_QUOTES, 'UTF-8');
}
function old(string $key, mixed $default = ''): string
{
return e($_POST[$key] ?? $_SESSION['form_data'][$key] ?? $default);
}
function checkRequirements(): array
{
$checks = [];
// PHP version
$checks[] = [
'name' => 'PHP 8.2+',
'passed' => PHP_VERSION_ID >= 80200,
'message' => PHP_VERSION_ID >= 80200 ? 'PHP ' . PHP_VERSION : 'Versione attuale: PHP ' . PHP_VERSION . '. Necessaria 8.2+',
'critical' => true,
];
// Extensions
$extensions = [
'pdo_mysql' => 'PDO MySQL',
'mbstring' => 'MBString',
'xml' => 'XML',
'curl' => 'cURL',
'zip' => 'Zip',
'gd' => 'GD (immagini)',
'fileinfo' => 'Fileinfo',
];
foreach ($extensions as $ext => $label) {
$checks[] = [
'name' => $label,
'passed' => extension_loaded($ext),
'message' => extension_loaded($ext) ? 'Caricata' : 'Estensione "' . $ext . '" non trovata',
'critical' => true,
];
}
// Directory permissions
$dirs = [
'storage' => dirname(__DIR__) . '/storage',
'bootstrap/cache' => dirname(__DIR__) . '/bootstrap/cache',
];
foreach ($dirs as $label => $dir) {
$writable = is_dir($dir) && is_writable($dir);
$checks[] = [
'name' => $label . '/ scrivibile',
'passed' => $writable,
'message' => $writable ? 'Permessi OK' : 'Cartella non scrivibile. Esegui: chmod -R 775 ' . $dir,
'critical' => true,
];
}
// mod_rewrite (suggested)
$checks[] = [
'name' => 'mod_rewrite (Apache)',
'passed' => true,
'message' => 'Raccomandato per URL puliti. Verifica configurazione Apache.',
'critical' => false,
];
// HTTPS
$isHttps = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on';
$checks[] = [
'name' => 'HTTPS attivo',
'passed' => $isHttps,
'message' => $isHttps ? 'Connessione sicura' : 'Connessione non crittata. Configura SSL in produzione.',
'critical' => false,
];
return $checks;
}
function allRequirementsMet(array $checks): bool
{
foreach ($checks as $check) {
if (!empty($check['critical']) && !$check['passed']) {
return false;
}
}
return true;
}
function testDatabaseConnection(string $host, int $port, string $database, string $user, string $pass): array
{
try {
$dsn = "mysql:host={$host};port={$port};dbname={$database};charset=utf8mb4";
$pdo = new PDO($dsn, $user, $pass, [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_TIMEOUT => 5,
]);
return ['success' => true, 'message' => 'Connessione riuscita.'];
} catch (PDOException $e) {
return ['success' => false, 'message' => 'Errore: ' . $e->getMessage()];
}
}
function testRootConnection(string $host, int $port, string $user, string $pass): array
{
try {
$dsn = "mysql:host={$host};port={$port};charset=utf8mb4";
$pdo = new PDO($dsn, $user, $pass, [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_TIMEOUT => 5,
]);
return ['success' => true, 'message' => 'Connessione root riuscita.', 'pdo' => $pdo];
} catch (PDOException $e) {
return ['success' => false, 'message' => 'Errore: ' . $e->getMessage()];
}
}
function createDatabaseAndUser(string $rootUser, string $rootPass, string $host, int $port, string $dbName, string $dbUser, string $dbPass): array
{
$result = testRootConnection($host, $port, $rootUser, $rootPass);
if (!$result['success']) {
return $result;
}
try {
$pdo = $result['pdo'];
$pdo->exec("CREATE DATABASE IF NOT EXISTS `{$dbName}` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci");
$pdo->exec("CREATE USER IF NOT EXISTS '{$dbUser}'@'localhost' IDENTIFIED BY '{$dbPass}'");
$pdo->exec("GRANT ALL ON `{$dbName}`.* TO '{$dbUser}'@'localhost'");
$pdo->exec("FLUSH PRIVILEGES");
return ['success' => true, 'message' => 'Database e utente creati con successo.'];
} catch (PDOException $e) {
return ['success' => false, 'message' => 'Errore: ' . $e->getMessage()];
}
}
function writeEnvFile(array $params): bool
{
$rootDir = dirname(__DIR__);
$examplePath = $rootDir . '/.env.example';
$envPath = $rootDir . '/.env';
if (!file_exists($examplePath)) {
return false;
}
$content = file_get_contents($examplePath);
$replacements = [
'APP_NAME=' => 'APP_NAME=' . ($params['app_name'] ?? 'Glastree'),
'APP_ENV=' => 'APP_ENV=production',
'APP_KEY=' => 'APP_KEY=',
'APP_DEBUG=' => 'APP_DEBUG=false',
'APP_URL=' => 'APP_URL=' . ($params['app_url'] ?? 'http://localhost'),
'DB_CONNECTION=' => 'DB_CONNECTION=mysql',
'# DB_HOST=' => 'DB_HOST=',
'# DB_PORT=' => 'DB_PORT=',
'# DB_DATABASE=' => 'DB_DATABASE=',
'# DB_USERNAME=' => 'DB_USERNAME=',
'# DB_PASSWORD=' => 'DB_PASSWORD=',
];
foreach ($replacements as $search => $replace) {
if (str_starts_with($content, $search) || preg_match('/^' . preg_quote($search, '/') . '/m', $content)) {
$content = preg_replace(
'/^' . preg_quote($search, '/') . '.*$/m',
$replace . ($params['db_host'] ?? '127.0.0.1'),
$content
);
}
}
// Specific DB replacements (handle commented lines)
$content = preg_replace(
'/^# DB_HOST=.*$/m',
'DB_HOST=' . ($params['db_host'] ?? '127.0.0.1'),
$content
);
$content = preg_replace(
'/^# DB_PORT=.*$/m',
'DB_PORT=' . ($params['db_port'] ?? '3306'),
$content
);
$content = preg_replace(
'/^# DB_DATABASE=.*$/m',
'DB_DATABASE=' . ($params['db_database'] ?? 'glastree'),
$content
);
$content = preg_replace(
'/^# DB_USERNAME=.*$/m',
'DB_USERNAME=' . ($params['db_username'] ?? 'glastree'),
$content
);
$content = preg_replace(
'/^# DB_PASSWORD=.*$/m',
'DB_PASSWORD=' . ($params['db_password'] ?? ''),
$content
);
// Ensure APP_KEY= line exists
if (!preg_match('/^APP_KEY=/m', $content)) {
$content .= "\nAPP_KEY=\n";
}
return file_put_contents($envPath, $content) !== false;
}
function bootstrapLaravel(): object
{
$rootDir = dirname(__DIR__);
require_once $rootDir . '/vendor/autoload.php';
$app = require $rootDir . '/bootstrap/app.php';
$kernel = $app->make(\Illuminate\Contracts\Console\Kernel::class);
return $kernel;
}
function runArtisanCommands(object $kernel, array $commands): array
{
$results = [];
foreach ($commands as $command => $options) {
try {
$exitCode = $kernel->call($command, $options ?? []);
$results[] = [
'command' => $command,
'success' => $exitCode === 0,
'output' => $kernel->output(),
];
} catch (\Exception $e) {
$results[] = [
'command' => $command,
'success' => false,
'output' => $e->getMessage(),
];
}
}
return $results;
}
function restoreFromBackup(string $zipPath, string $dbUser, string $dbPass, string $dbName): array
{
$rootDir = dirname(__DIR__);
$restoreDir = sys_get_temp_dir() . '/glastree-restore-' . uniqid();
if (!file_exists($zipPath)) {
return ['success' => false, 'message' => 'File ZIP non trovato: ' . $zipPath];
}
$zip = new ZipArchive();
if ($zip->open($zipPath) !== true) {
return ['success' => false, 'message' => 'Impossibile aprire il file ZIP.'];
}
$zip->extractTo($restoreDir);
$zip->close();
$log = [];
// 1. Import database.sql
$sqlFile = $restoreDir . '/database.sql';
if (file_exists($sqlFile)) {
$cmd = sprintf(
'mysql --host=%s --port=%s --user=%s --password=%s %s < %s 2>&1',
escapeshellarg($_SESSION['db_host'] ?? '127.0.0.1'),
escapeshellarg((string)($_SESSION['db_port'] ?? '3306')),
escapeshellarg($dbUser),
escapeshellarg($dbPass),
escapeshellarg($dbName),
escapeshellarg($sqlFile)
);
exec($cmd, $output, $exitCode);
if ($exitCode === 0) {
$log[] = 'Database importato con successo.';
} else {
$log[] = 'Errore import database: ' . implode("\n", $output);
return ['success' => false, 'message' => 'Import database fallito.', 'log' => $log];
}
} else {
$log[] = 'database.sql non trovato nel backup.';
}
// 2. Copy files to storage
$filesDir = $restoreDir . '/files';
$targetDir = $rootDir . '/storage/app/documenti';
if (is_dir($filesDir)) {
if (!is_dir($targetDir)) {
mkdir($targetDir, 0755, true);
}
$files = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($filesDir, RecursiveDirectoryIterator::SKIP_DOTS),
RecursiveIteratorIterator::SELF_FIRST
);
foreach ($files as $file) {
$relative = substr($file->getPathname(), strlen($filesDir) + 1);
$target = $targetDir . '/' . $relative;
if ($file->isDir()) {
if (!is_dir($target)) {
mkdir($target, 0755, true);
}
} else {
copy($file->getPathname(), $target);
}
}
$log[] = 'File documenti ripristinati.';
} else {
$log[] = 'Cartella files non trovata nel backup.';
}
// 3. Merge .env if present (preserving current DB credentials)
$envBackup = $restoreDir . '/.env';
if (file_exists($envBackup)) {
$currentEnv = file_get_contents($envBackup);
$currentEnv = preg_replace('/^DB_HOST=.*$/m', 'DB_HOST=' . ($_SESSION['db_host'] ?? '127.0.0.1'), $currentEnv);
$currentEnv = preg_replace('/^DB_PORT=.*$/m', 'DB_PORT=' . ($_SESSION['db_port'] ?? '3306'), $currentEnv);
$currentEnv = preg_replace('/^DB_DATABASE=.*$/m', 'DB_DATABASE=' . $dbName, $currentEnv);
$currentEnv = preg_replace('/^DB_USERNAME=.*$/m', 'DB_USERNAME=' . $dbUser, $currentEnv);
$currentEnv = preg_replace('/^DB_PASSWORD=.*$/m', 'DB_PASSWORD=' . $dbPass, $currentEnv);
// Only merge if APP_URL differs from localhost
if (str_contains($currentEnv, 'APP_URL=http://localhost') || str_contains($currentEnv, 'APP_URL=')) {
$currentEnv = preg_replace(
'/^APP_URL=.*$/m',
'APP_URL=' . getBaseUrl(),
$currentEnv
);
}
file_put_contents($rootDir . '/.env', $currentEnv);
$log[] = '.env ripristinato dal backup (credenziali DB preservate).';
}
// 4. Copy manifest if exists
if (file_exists($restoreDir . '/manifest.json')) {
$log[] = 'Manifest: ' . file_get_contents($restoreDir . '/manifest.json');
}
// Cleanup temp
$it = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($restoreDir, RecursiveDirectoryIterator::SKIP_DOTS),
RecursiveIteratorIterator::CHILD_FIRST
);
foreach ($it as $file) {
$file->isDir() ? rmdir($file->getPathname()) : unlink($file->getPathname());
}
rmdir($restoreDir);
return ['success' => true, 'message' => 'Backup ripristinato con successo.', 'log' => $log];
}
function createSuperAdmin(string $name, string $email, string $password): array
{
try {
$kernel = bootstrapLaravel();
$kernel->call('db:seed', ['--force' => true, '--class' => 'Database\\Seeders\\DiocesiSeeder']);
$kernel->call('db:seed', ['--force' => true, '--class' => 'Database\\Seeders\\ComuniSeeder']);
$kernel->call('db:seed', ['--force' => true, '--class' => 'Database\\Seeders\\RoleSeeder']);
$kernel->call('db:seed', ['--force' => true, '--class' => 'Database\\Seeders\\RolePresetSeeder']);
} catch (\Exception $e) {
// Seeder might fail if already seeded, that's OK
}
try {
$user = new \App\Models\User();
$user->name = $name;
$user->email = $email;
$user->password = \Illuminate\Support\Facades\Hash::make($password);
$user->is_admin = true;
$user->status = 'active';
$user->role_preset_id = 1;
$user->permissions = [
'individui' => 2,
'gruppi' => 2,
'eventi' => 2,
'documenti' => 2,
'mailing' => 2,
'viste' => 2,
'report' => 2,
'settings' => 2,
];
$user->save();
return ['success' => true, 'message' => 'Amministratore creato con successo.'];
} catch (\Exception $e) {
return ['success' => false, 'message' => 'Errore creazione admin: ' . $e->getMessage()];
}
}
function getExistingUsers(): array
{
try {
$kernel = bootstrapLaravel();
$users = \App\Models\User::all(['id', 'name', 'email', 'is_admin'])->toArray();
return $users;
} catch (\Exception $e) {
return [];
}
}
function selfDestruct(): bool
{
$installerDir = __DIR__;
if (!is_dir($installerDir)) {
return false;
}
$it = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($installerDir, RecursiveDirectoryIterator::SKIP_DOTS),
RecursiveIteratorIterator::CHILD_FIRST
);
foreach ($it as $file) {
if ($file->isDir()) {
rmdir($file->getPathname());
} else {
unlink($file->getPathname());
}
}
rmdir($installerDir);
return !is_dir($installerDir);
}
function renderHeader(string $title, string $step = ''): void
{
$stepLabel = $step ? " — Step {$step}" : '';
?>
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?= e($title) ?> — Glastree Installer</title>
<link rel="stylesheet" href="assets/style.css">
</head>
<body>
<div class="installer-wrapper">
<div class="installer-header">
<div class="container">
<h1><i class="icon-tree"></i> Glastree</h1>
<p class="subtitle">Installazione Wizard</p>
</div>
</div>
<div class="container">
<?php if ($step): ?>
<div class="step-indicator">Passo <?= e($step) ?> di 6</div>
<?php endif; ?>
<div class="card">
<div class="card-body">
<?php
}
function renderFooter(): void
{
?>
</div>
</div>
</div>
<div class="installer-footer">
<div class="container">
<p>Glastree &copy; <?= date('Y') ?></p>
</div>
</div>
</div>
</body>
</html>
<?php
}
function renderErrors(array $errors): void
{
if (empty($errors)) return;
?>
<div class="alert alert-danger">
<strong><i class="icon-error"></i> Errori:</strong>
<ul class="mb-0">
<?php foreach ($errors as $error): ?>
<li><?= e($error) ?></li>
<?php endforeach; ?>
</ul>
</div>
<?php
}
function renderSuccess(string $message, array $log = []): void
{
?>
<div class="alert alert-success">
<strong><i class="icon-ok"></i> <?= e($message) ?></strong>
<?php if (!empty($log)): ?>
<ul class="mb-0 mt-2">
<?php foreach ($log as $item): ?>
<li><?= e($item) ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
<?php
}
-28
View File
@@ -1,28 +0,0 @@
<?php
declare(strict_types=1);
// =============================================================================
// Glastree - Installer Entry Point
// =============================================================================
// Se .env esiste già, l'app è installata → redirect a login.
// Altrimenti avvia il wizard di installazione.
// =============================================================================
$rootDir = dirname(__DIR__);
if (file_exists($rootDir . '/.env')) {
// App gia' installata
$baseUrl = rtrim((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http') . '://' . ($_SERVER['HTTP_HOST'] ?? 'localhost') . dirname($_SERVER['SCRIPT_NAME']), '/');
$baseUrl = str_replace('/installer', '', $baseUrl);
header('Location: ' . $baseUrl . '/login');
exit;
}
// Avvia il wizard
session_start();
$_SESSION['install_mode'] = $_SESSION['install_mode'] ?? '';
$_SESSION['install_step'] = 1;
header('Location: setup.php?step=1');
exit;
-711
View File
@@ -1,711 +0,0 @@
<?php
declare(strict_types=1);
// =============================================================================
// Glastree Installer - Wizard Setup
// =============================================================================
session_start();
require_once __DIR__ . '/functions.php';
// If already installed (and not in the middle of install), block
if (isEnvFileExists() && empty($_SESSION['install_in_progress'])) {
redirect('/login');
}
$step = max(1, min(6, (int) ($_GET['step'] ?? 1)));
$errors = [];
$success = '';
// ─── Step 1: Welcome + Mode Selection ──────────────────────────────────────
if ($step === 1) {
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$mode = $_POST['mode'] ?? '';
if (!in_array($mode, ['fresh', 'backup'], true)) {
$errors[] = 'Seleziona una modalita di installazione.';
} else {
$_SESSION['install_mode'] = $mode;
$_SESSION['install_in_progress'] = true;
redirect('setup.php?step=2');
}
}
renderHeader('Benvenuto', '1');
?>
<h2>Benvenuto nell'installazione di Glastree</h2>
<p>Questo wizard ti guidera nella configurazione dell'applicazione su questo server.</p>
<?php renderErrors($errors); ?>
<form method="POST">
<div class="option-group">
<label class="option-card <?= ($_SESSION['install_mode'] ?? '') === 'fresh' ? 'selected' : '' ?>">
<input type="radio" name="mode" value="fresh" class="option-radio"
<?= ($_SESSION['install_mode'] ?? '') === 'fresh' ? 'checked' : '' ?>>
<div class="option-content">
<div class="option-icon"><i class="icon-rocket"></i></div>
<h3>Fresh Install</h3>
<p>Crea un database nuovo, esegue migration e seed, e configura l'applicazione da zero.</p>
<ul>
<li>Database nuovo</li>
<li>Migration + dati di base</li>
<li>Crea amministratore</li>
</ul>
</div>
</label>
<label class="option-card <?= ($_SESSION['install_mode'] ?? '') === 'backup' ? 'selected' : '' ?>">
<input type="radio" name="mode" value="backup" class="option-radio"
<?= ($_SESSION['install_mode'] ?? '') === 'backup' ? 'checked' : '' ?>>
<div class="option-content">
<div class="option-icon"><i class="icon-upload"></i></div>
<h3>Restore da Backup</h3>
<p>Carica un file ZIP di backup per ripristinare un'installazione esistente su questo server.</p>
<ul>
<li>Upload file ZIP</li>
<li>Importa database</li>
<li>Ripristina documenti</li>
</ul>
</div>
</label>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Avanti &rarr;</button>
</div>
</form>
<?php
renderFooter();
}
// ─── Step 2: Requirements Check ─────────────────────────────────────────────
if ($step === 2) {
$checks = checkRequirements();
$allMet = allRequirementsMet($checks);
$nonCriticalFailed = false;
foreach ($checks as $check) {
if (!$check['passed'] && empty($check['critical'])) {
$nonCriticalFailed = true;
}
}
if ($_SERVER['REQUEST_METHOD'] === 'POST' && $allMet) {
redirect('setup.php?step=3');
}
renderHeader('Verifica Requisiti', '2');
?>
<h2>Verifica Requisiti di Sistema</h2>
<p>Il sistema controlla che il server soddisfi i requisiti minimi per eseguire Glastree.</p>
<?php renderErrors($errors); ?>
<div class="requirements-list">
<?php foreach ($checks as $check): ?>
<div class="requirement-item <?= $check['passed'] ? 'passed' : 'failed' ?>">
<span class="req-icon">
<?php if ($check['passed']): ?>
<i class="icon-ok"></i>
<?php else: ?>
<i class="icon-error"></i>
<?php endif; ?>
</span>
<span class="req-name"><?= e($check['name']) ?></span>
<span class="req-status"><?= $check['passed'] ? 'OK' : 'ERRORE' ?></span>
<?php if (!$check['passed']): ?>
<span class="req-msg"><?= e($check['message']) ?></span>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
<?php if (!$allMet): ?>
<div class="alert alert-danger">
<i class="icon-error"></i>
Requisiti critici non soddisfatti. Risolvi gli errori sopra e ricarica la pagina.
</div>
<?php elseif ($nonCriticalFailed): ?>
<div class="alert alert-warning">
<i class="icon-warning"></i>
Alcuni requisiti non critici non sono soddisfatti. Puoi proseguire, ma alcune funzionalita potrebbero essere limitate.
</div>
<?php endif; ?>
<form method="POST">
<div class="form-actions">
<a href="setup.php?step=1" class="btn btn-secondary">&larr; Indietro</a>
<?php if ($allMet): ?>
<button type="submit" class="btn btn-primary">Avanti &rarr;</button>
<?php endif; ?>
</div>
</form>
<?php
renderFooter();
}
// ─── Step 3: Database Configuration ─────────────────────────────────────────
if ($step === 3) {
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$action = $_POST['action'] ?? '';
$dbHost = $_POST['db_host'] ?? '127.0.0.1';
$dbPort = (int) ($_POST['db_port'] ?? 3306);
if ($action === 'test_root') {
// Test root credentials
$rootUser = $_POST['root_user'] ?? 'root';
$rootPass = $_POST['root_pass'] ?? '';
$result = testRootConnection($dbHost, $dbPort, $rootUser, $rootPass);
if ($result['success']) {
$_SESSION['root_user'] = $rootUser;
$_SESSION['root_pass'] = $rootPass;
$success = 'Connessione root riuscita. Ora puoi creare il database.';
} else {
$errors[] = $result['message'];
}
} elseif ($action === 'create_db') {
// Create database + user
$rootUser = $_SESSION['root_user'] ?? 'root';
$rootPass = $_SESSION['root_pass'] ?? '';
$dbName = $_POST['db_name'] ?? 'glastree';
$dbUser = $_POST['db_user'] ?? 'glastree';
$dbPass = $_POST['db_pass'] ?? '';
$appUrl = $_POST['app_url'] ?? getBaseUrl();
if (strlen($dbPass) < 6) {
$errors[] = 'La password del database deve essere almeno 6 caratteri.';
} else {
$result = createDatabaseAndUser($rootUser, $rootPass, $dbHost, $dbPort, $dbName, $dbUser, $dbPass);
if ($result['success']) {
$_SESSION['db_host'] = $dbHost;
$_SESSION['db_port'] = $dbPort;
$_SESSION['db_name'] = $dbName;
$_SESSION['db_user'] = $dbUser;
$_SESSION['db_pass'] = $dbPass;
$_SESSION['app_url'] = $appUrl;
// Write .env
$envWritten = writeEnvFile([
'app_url' => $appUrl,
'db_host' => $dbHost,
'db_port' => (string) $dbPort,
'db_database' => $dbName,
'db_username' => $dbUser,
'db_password' => $dbPass,
]);
if ($envWritten) {
redirect('setup.php?step=4');
} else {
$errors[] = 'Impossibile scrivere il file .env.';
}
} else {
$errors[] = $result['message'];
}
}
} elseif ($action === 'test_existing') {
// Test existing database connection
$dbName = $_POST['db_name'] ?? '';
$dbUser = $_POST['db_user'] ?? '';
$dbPass = $_POST['db_pass'] ?? '';
$appUrl = $_POST['app_url'] ?? getBaseUrl();
if (empty($dbName) || empty($dbUser)) {
$errors[] = 'Compila tutti i campi obbligatori.';
} else {
$result = testDatabaseConnection($dbHost, $dbPort, $dbName, $dbUser, $dbPass);
if ($result['success']) {
$_SESSION['db_host'] = $dbHost;
$_SESSION['db_port'] = $dbPort;
$_SESSION['db_name'] = $dbName;
$_SESSION['db_user'] = $dbUser;
$_SESSION['db_pass'] = $dbPass;
$_SESSION['app_url'] = $appUrl;
$envWritten = writeEnvFile([
'app_url' => $appUrl,
'db_host' => $dbHost,
'db_port' => (string) $dbPort,
'db_database' => $dbName,
'db_username' => $dbUser,
'db_password' => $dbPass,
]);
if ($envWritten) {
redirect('setup.php?step=4');
} else {
$errors[] = 'Impossibile scrivere il file .env.';
}
} else {
$errors[] = $result['message'];
}
}
} else {
$errors[] = 'Azione non valida.';
}
}
renderHeader('Configurazione Database', '3');
?>
<h2>Configurazione Database</h2>
<p>Configura la connessione al database MySQL.</p>
<?php renderErrors($errors); ?>
<?php if ($success): ?>
<div class="alert alert-success"><i class="icon-ok"></i> <?= e($success) ?></div>
<?php endif; ?>
<form method="POST" id="db-form">
<div class="form-group">
<label for="db_host">Host MySQL</label>
<input type="text" name="db_host" id="db_host" class="form-control" value="<?= old('db_host', '127.0.0.1') ?>" placeholder="127.0.0.1">
</div>
<div class="form-group">
<label for="db_port">Porta</label>
<input type="number" name="db_port" id="db_port" class="form-control" value="<?= old('db_port', '3306') ?>" placeholder="3306">
</div>
<div class="form-group">
<label for="app_url">URL Applicazione</label>
<input type="text" name="app_url" id="app_url" class="form-control" value="<?= old('app_url', getBaseUrl()) ?>" placeholder="https://glastree.esempio.it">
<small class="form-text text-muted">L'indirizzo pubblico con cui si accedera a Glastree</small>
</div>
<hr>
<h4>Modalita A: Crea Nuovo Database</h4>
<div class="form-group">
<label for="root_user">Utente Root MySQL</label>
<input type="text" name="root_user" id="root_user" class="form-control" value="<?= old('root_user', 'root') ?>">
</div>
<div class="form-group">
<label for="root_pass">Password Root</label>
<input type="password" name="root_pass" id="root_pass" class="form-control" value="">
</div>
<button type="submit" name="action" value="test_root" class="btn btn-secondary">
<i class="icon-ok"></i> Test Connessione Root
</button>
<div class="mt-3 p-3 bg-light border rounded">
<h5>Nuovo Database da Creare</h5>
<div class="form-group">
<label for="db_name">Nome Database</label>
<input type="text" name="db_name" class="form-control" value="<?= old('db_name', 'glastree') ?>" placeholder="glastree">
</div>
<div class="form-group">
<label for="db_user">Utente Database</label>
<input type="text" name="db_user" class="form-control" value="<?= old('db_user', 'glastree') ?>" placeholder="glastree">
</div>
<div class="form-group">
<label for="db_pass">Password Utente</label>
<input type="password" name="db_pass" class="form-control" value="">
</div>
<button type="submit" name="action" value="create_db" class="btn btn-primary">
<i class="icon-rocket"></i> Crea Database e Continua
</button>
</div>
<hr>
<h4>Modalita B: Usa Database Esistente</h4>
<div class="form-group">
<label for="db_name_ex">Nome Database</label>
<input type="text" name="db_name" class="form-control" value="<?= old('db_name', 'glastree') ?>" placeholder="glastree">
</div>
<div class="form-group">
<label for="db_user_ex">Utente</label>
<input type="text" name="db_user" class="form-control" value="<?= old('db_user', 'glastree') ?>" placeholder="glastree">
</div>
<div class="form-group">
<label for="db_pass_ex">Password</label>
<input type="password" name="db_pass" class="form-control" value="">
</div>
<button type="submit" name="action" value="test_existing" class="btn btn-primary">
<i class="icon-ok"></i> Test e Continua
</button>
</form>
<div class="form-actions mt-3">
<a href="setup.php?step=2" class="btn btn-secondary">&larr; Indietro</a>
</div>
<?php
renderFooter();
}
// ─── Step 4: Install (Fresh: migrate+seed / Backup: upload+restore) ────────
if ($step === 4) {
$mode = $_SESSION['install_mode'] ?? 'fresh';
$installDone = $_SESSION['install_done'] ?? false;
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if ($mode === 'fresh') {
// Run Artisan commands
try {
$kernel = bootstrapLaravel();
$commands = [
'key:generate' => ['--force' => true],
'migrate' => ['--force' => true],
'db:seed' => ['--force' => true],
'storage:link' => [],
];
$results = runArtisanCommands($kernel, $commands);
$allOk = true;
$log = [];
foreach ($results as $r) {
$log[] = ($r['success'] ? 'OK' : 'ERRORE') . ': ' . $r['command'];
if (!$r['success']) $allOk = false;
}
if ($allOk) {
$_SESSION['install_done'] = true;
$success = 'Installazione completata con successo!';
$log[] = 'Ora puoi creare l\'amministratore.';
} else {
$errors[] = 'Alcuni comandi sono falliti. Verifica i log.';
foreach ($log as $l) $errors[] = $l;
}
} catch (\Exception $e) {
$errors[] = 'Errore: ' . $e->getMessage();
}
} elseif ($mode === 'backup') {
// Handle backup upload
if (!empty($_FILES['backup_file']) && $_FILES['backup_file']['error'] === UPLOAD_ERR_OK) {
$uploadedFile = $_FILES['backup_file']['tmp_name'];
$originalName = $_FILES['backup_file']['name'];
$result = restoreFromBackup(
$uploadedFile,
$_SESSION['db_user'] ?? '',
$_SESSION['db_pass'] ?? '',
$_SESSION['db_name'] ?? ''
);
if ($result['success']) {
$_SESSION['install_done'] = true;
$success = 'Backup ripristinato con successo!';
$log = $result['log'] ?? [];
} else {
$errors[] = $result['message'];
if (!empty($result['log'])) {
foreach ($result['log'] as $l) $errors[] = $l;
}
}
} elseif (!empty($_POST['backup_path'])) {
// Backup file already on server
$serverPath = $_POST['backup_path'];
if (!file_exists($serverPath)) {
$errors[] = 'File non trovato: ' . $serverPath;
} else {
$result = restoreFromBackup(
$serverPath,
$_SESSION['db_user'] ?? '',
$_SESSION['db_pass'] ?? '',
$_SESSION['db_name'] ?? ''
);
if ($result['success']) {
$_SESSION['install_done'] = true;
$success = 'Backup ripristinato con successo!';
} else {
$errors[] = $result['message'];
}
}
} else {
$errors[] = 'Seleziona un file di backup o fornisci il percorso.';
}
}
}
renderHeader($mode === 'fresh' ? 'Installazione' : 'Ripristino Backup', '4');
?>
<h2><?= $mode === 'fresh' ? 'Installazione Database' : 'Ripristino Backup' ?></h2>
<?php renderErrors($errors); ?>
<?php if ($success): ?>
<div class="alert alert-success"><i class="icon-ok"></i> <?= e($success) ?></div>
<?php if (!empty($log)): ?>
<div class="log-list">
<?php foreach ($log as $l): ?>
<div class="log-item"><?= e($l) ?></div>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($installDone): ?>
<div class="alert alert-info">
<i class="icon-ok"></i> Installazione completata. Procedi al passo successivo.
</div>
<div class="form-actions">
<a href="setup.php?step=5" class="btn btn-primary">Avanti &rarr;</a>
</div>
<?php else: ?>
<?php if ($mode === 'fresh'): ?>
<form method="POST">
<p>Clicca "Installa" per eseguire migration, seed e generare la chiave dell'applicazione.</p>
<div class="form-actions">
<a href="setup.php?step=3" class="btn btn-secondary">&larr; Indietro</a>
<button type="submit" class="btn btn-primary"><i class="icon-rocket"></i> Installa</button>
</div>
</form>
<?php else: ?>
<form method="POST" enctype="multipart/form-data">
<div class="form-group">
<label for="backup_file">Carica file ZIP di backup</label>
<input type="file" name="backup_file" id="backup_file" class="form-control" accept=".zip">
</div>
<hr>
<p class="text-muted">oppure specifica il percorso sul server:</p>
<div class="form-group">
<label for="backup_path">Percorso server del file ZIP</label>
<input type="text" name="backup_path" id="backup_path" class="form-control" placeholder="/tmp/backup.zip">
</div>
<div class="form-actions">
<a href="setup.php?step=3" class="btn btn-secondary">&larr; Indietro</a>
<button type="submit" class="btn btn-primary"><i class="icon-upload"></i> Ripristina Backup</button>
</div>
</form>
<?php endif; ?>
<?php endif; ?>
<?php
renderFooter();
}
// ─── Step 5: Admin User Creation ────────────────────────────────────────────
if ($step === 5) {
$mode = $_SESSION['install_mode'] ?? 'fresh';
$adminCreated = false;
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if ($mode === 'fresh') {
$name = trim($_POST['name'] ?? '');
$email = trim($_POST['email'] ?? '');
$password = $_POST['password'] ?? '';
$passwordConfirm = $_POST['password_confirm'] ?? '';
if (empty($name)) $errors[] = 'Il nome e obbligatorio.';
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) $errors[] = 'Email non valida.';
if (strlen($password) < 8) $errors[] = 'La password deve essere almeno 8 caratteri.';
if ($password !== $passwordConfirm) $errors[] = 'Le password non coincidono.';
if (empty($errors)) {
$result = createSuperAdmin($name, $email, $password);
if ($result['success']) {
$adminCreated = true;
$_SESSION['admin_created'] = true;
} else {
$errors[] = $result['message'];
}
}
} else {
// Backup mode: skip or create additional admin
if (!empty($_POST['name']) && !empty($_POST['email']) && !empty($_POST['password'])) {
$result = createSuperAdmin($_POST['name'], $_POST['email'], $_POST['password']);
if ($result['success']) {
$adminCreated = true;
} else {
$errors[] = $result['message'];
}
} else {
$_SESSION['admin_created'] = true;
$adminCreated = true;
}
}
}
// Check existing users (backup mode)
$existingUsers = [];
if ($mode === 'backup' && file_exists(dirname(__DIR__) . '/.env')) {
try {
$existingUsers = getExistingUsers();
} catch (\Exception $e) {
// Ignore
}
}
renderHeader('Amministratore', '5');
?>
<h2><?= $mode === 'fresh' ? 'Crea Amministratore' : 'Verifica Utenti' ?></h2>
<?php renderErrors($errors); ?>
<?php if ($success): ?>
<div class="alert alert-success"><?= e($success) ?></div>
<?php endif; ?>
<?php if ($adminCreated || !empty($_SESSION['admin_created'])): ?>
<div class="alert alert-success">
<i class="icon-ok"></i>
<?php if ($mode === 'fresh'): ?>
Amministratore creato con successo!
<?php else: ?>
Utenti configurati.
<?php endif; ?>
</div>
<div class="form-actions">
<a href="setup.php?step=6" class="btn btn-primary">Avanti &rarr;</a>
</div>
<?php else: ?>
<?php if (!empty($existingUsers)): ?>
<div class="alert alert-info">
<strong>Utenti trovati nel database ripristinato:</strong>
<ul>
<?php foreach ($existingUsers as $u): ?>
<li><?= e($u['name']) ?> &lt;<?= e($u['email']) ?>&gt;
<?= $u['is_admin'] ? '<span class="badge badge-admin">Superadmin</span>' : '' ?>
</li>
<?php endforeach; ?>
</ul>
<p>Puoi proseguire senza creare nuovi utenti.</p>
</div>
<form method="POST" class="mt-3">
<button type="submit" class="btn btn-secondary">Salta (usa utenti esistenti)</button>
</form>
<hr>
<p class="text-muted">oppure crea un nuovo amministratore:</p>
<?php endif; ?>
<form method="POST">
<div class="form-group">
<label for="name">Nome Amministratore</label>
<input type="text" name="name" id="name" class="form-control" value="<?= old('name', 'Amministratore') ?>" required>
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" name="email" id="email" class="form-control" value="<?= old('email', 'admin@glastree.local') ?>" required>
</div>
<div class="form-group">
<label for="password">Password (min. 8 caratteri)</label>
<input type="password" name="password" id="password" class="form-control" required minlength="8">
</div>
<div class="form-group">
<label for="password_confirm">Conferma Password</label>
<input type="password" name="password_confirm" id="password_confirm" class="form-control" required minlength="8">
</div>
<div class="form-actions">
<a href="setup.php?step=4" class="btn btn-secondary">&larr; Indietro</a>
<button type="submit" class="btn btn-primary"><i class="icon-ok"></i> Crea Amministratore</button>
</div>
</form>
<?php endif; ?>
<?php
renderFooter();
}
// ─── Step 6: Finalize ───────────────────────────────────────────────────────
if ($step === 6) {
$finalized = false;
$results = [];
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
try {
if (!file_exists(dirname(__DIR__) . '/.env')) {
$errors[] = 'File .env non trovato. Qualcosa e andato storto.';
} else {
$kernel = bootstrapLaravel();
$commands = [
'config:cache' => [],
'route:cache' => [],
'view:cache' => [],
];
$results = runArtisanCommands($kernel, $commands);
$allOk = true;
foreach ($results as $r) {
if (!$r['success']) $allOk = false;
}
if ($allOk) {
// Self-destruct
selfDestruct();
$finalized = true;
} else {
$errors[] = 'Alcune operazioni sono fallite.';
}
}
} catch (\Exception $e) {
$errors[] = 'Errore: ' . $e->getMessage();
}
}
if (!$finalized && empty($errors)) {
// Initial display
renderHeader('Finalizzazione', '6');
?>
<h2>Finalizzazione</h2>
<p>Completa l'installazione generando la cache e rimuovendo i file di setup.</p>
<?php renderErrors($errors); ?>
<form method="POST">
<div class="form-actions">
<a href="setup.php?step=5" class="btn btn-secondary">&larr; Indietro</a>
<button type="submit" class="btn btn-primary"><i class="icon-ok"></i> Completa Installazione</button>
</div>
</form>
<?php
renderFooter();
} else {
// Show results
renderHeader('Installazione Completata', '6');
?>
<h2>Installazione Completata!</h2>
<?php renderErrors($errors); ?>
<?php if (!empty($results)): ?>
<div class="results-list">
<?php foreach ($results as $r): ?>
<div class="result-item <?= $r['success'] ? 'success' : 'error' ?>">
<span class="result-icon"><?= $r['success'] ? '<i class="icon-ok"></i>' : '<i class="icon-error"></i>' ?></span>
<span class="result-name"><?= e($r['command']) ?></span>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php if ($finalized): ?>
<div class="alert alert-success">
<i class="icon-ok"></i>
<strong>Glastree e stato installato con successo!</strong>
<p class="mb-0 mt-2">La cartella <code>installer/</code> e stata eliminata per sicurezza.</p>
</div>
<div class="final-box">
<h3>Prossimi passi:</h3>
<ol>
<li><strong>Configura SSL</strong> con Let's Encrypt per connessioni sicure</li>
<li>Accedi con le credenziali amministratore</li>
<li>Vai su <strong>Impostazioni</strong> per configurare:
<ul>
<li>Nome applicazione e logo</li>
<li>Email (SMTP e IMAP)</li>
<li>Repository remoti (Google Drive, Nextcloud)</li>
</ul>
</li>
<li>Vai su <strong>Admin</strong> per creare altri utenti</li>
<li>Configura il cron per backup automatico:
<code class="d-block mt-2 p-2 bg-light">* * * * * cd <?= e(dirname(__DIR__)) ?> && php artisan schedule:run >> /dev/null 2>&1</code>
</li>
</ol>
</div>
<div class="form-actions">
<a href="<?= e(getBaseUrl()) ?>/login" class="btn btn-primary btn-lg">
<i class="icon-ok"></i> Vai al Login &rarr;
</a>
</div>
<?php endif; ?>
<?php
renderFooter();
}
}
+2 -1
View File
@@ -1,5 +1,6 @@
@extends('layouts.adminlte')
@extends('admin.layout')
@php $appName = \App\Models\AppSetting::getAppName() ?? 'Glastree'; @endphp
@section('title', 'Backup - ' . $appName)
@section('page_title', 'Backup e Migrazione')
@section('breadcrumbs')
+6
View File
@@ -59,6 +59,12 @@
<p>Ruoli</p>
</a>
</li>
<li class="nav-item">
<a href="/admin/backup" class="nav-link {{ request()->is('admin/backup*') ? 'active' : '' }}">
<i class="nav-icon fas fa-hdd"></i>
<p>Backup</p>
</a>
</li>
<li class="nav-item">
<a href="/admin/activity-logs" class="nav-link {{ request()->is('admin/activity-logs*') ? 'active' : '' }}">
<i class="nav-icon fas fa-history"></i>
+90 -32
View File
@@ -500,7 +500,7 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
{{-- MODAL: Nuova Cartella --}}
<div class="modal fade" id="newFolderModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-folder-plus mr-2"></i>Nuova Cartella</h5>
@@ -535,7 +535,7 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
{{-- MODAL: Upload --}}
<div class="modal fade" id="uploadModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-upload mr-2"></i>Carica Documento</h5>
@@ -543,9 +543,9 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
<span>&times;</span>
</button>
</div>
<form action="/documenti" method="POST" enctype="multipart/form-data">
@csrf
<div class="modal-body">
<div class="modal-body">
<form action="/documenti" method="POST" enctype="multipart/form-data" id="uploadForm">
@csrf
<div class="form-group">
<label>Nome *</label>
<input type="text" name="nome_file" class="form-control" placeholder="Nome del documento" required>
@@ -557,11 +557,15 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
<option value="{{ $tip->nome }}">{{ $tip->descrizione ?? ucfirst($tip->nome) }}</option>
@endforeach
</select>
<button type="button" class="btn btn-sm btn-outline-success mt-2" id="massMoveNewFolderBtn">
<i class="fas fa-plus mr-1"></i> Nuova cartella
</button>
</div>
</div>
<div class="form-group">
<label>Visibilità *</label>
<select name="visibilita" id="uploadVisibilita" class="form-control" onchange="loadUploadTargets()">
<option value="pubblico">Pubblico</option>
<option value="individuo">Individuo</option>
<option value="gruppo">Gruppo</option>
</select>
</div>
<div class="form-group" id="uploadTargetGroup" style="display:none;">
<label>Riferimento</label>
<select name="visibilita_target_id" class="form-control" id="uploadTargetId">
@@ -589,29 +593,42 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
<input type="file" name="file" class="form-control" required>
<small class="text-muted">Max 10MB</small>
</div>
@if($currentFolder && !$currentRepo)
<input type="hidden" name="cartella_id" value="{{ $currentFolder->id }}">
<p class="text-muted small mb-0">Il documento sarà inserito in: <strong>{{ $currentFolder->nome }}</strong></p>
@endif
<div class="form-group" id="uploadFolderGroup">
<label>Cartella</label>
<select name="cartella_id" id="uploadCartellaId" class="form-control">
<option value=""> Nessuna cartella </option>
@foreach($cartelle as $cartella)
<option value="{{ $cartella->id }}" {{ $currentFolder && $currentFolder->id === $cartella->id ? 'selected' : '' }}>{{ $cartella->nome }}</option>
@if($cartella->children->count() > 0)
@foreach($cartella->children as $child)
<option value="{{ $child->id }}" {{ $currentFolder && $currentFolder->id === $child->id ? 'selected' : '' }}>&nbsp;&nbsp;&nbsp;{{ $child->nome }}</option>
@endforeach
@endif
@endforeach
</select>
<button type="button" class="btn btn-sm btn-outline-success mt-2" id="uploadNewFolderBtn">
<i class="fas fa-plus mr-1"></i> Nuova cartella
</button>
</div>
@if($currentRepo)
<input type="hidden" name="repository_id" value="{{ $currentRepo->id }}">
<p class="text-muted small mb-0">Caricamento su repository remoto: <strong>{{ $currentRepo->nome }}</strong></p>
@endif
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" onclick="$('#uploadModal').modal('hide')">Annulla</button>
<button type="submit" class="btn btn-primary">
<i class="fas fa-upload mr-1"></i> Carica
</button>
</div>
</form>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" onclick="$('#uploadModal').modal('hide')">Annulla</button>
<button type="submit" class="btn btn-primary" form="uploadForm">
<i class="fas fa-upload mr-1"></i> Carica
</button>
</div>
</div>
</div>
</div>
{{-- MODAL: Associa --}}
<div class="modal fade" id="associateModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-link mr-2"></i>Associa a</h5>
@@ -651,7 +668,7 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
{{-- MODAL: Cambia tipo/contesto --}}
<div class="modal fade" id="updateModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-edit mr-2"></i>Cambia tipo/contesto</h5>
@@ -727,7 +744,7 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
{{-- MODAL: Conferma eliminazione singola --}}
<div class="modal fade" id="deleteConfirmModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header bg-danger text-white">
<h5 class="modal-title"><i class="fas fa-exclamation-triangle mr-2"></i>Conferma Eliminazione</h5>
@@ -751,7 +768,7 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
{{-- MODAL: Conferma eliminazione multipla --}}
<div class="modal fade" id="massDeleteConfirmModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header bg-danger text-white">
<h5 class="modal-title"><i class="fas fa-exclamation-triangle mr-2"></i>Conferma Eliminazione Multipla</h5>
@@ -775,7 +792,7 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
{{-- MODAL: Sposta massivo --}}
<div class="modal fade" id="massMoveModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-folder-open mr-2"></i>Sposta documenti selezionati</h5>
@@ -801,6 +818,9 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
@endif
@endforeach
</select>
<button type="button" class="btn btn-sm btn-outline-success mt-2" id="massMoveNewFolderBtn">
<i class="fas fa-plus mr-1"></i> Nuova cartella
</button>
</div>
</div>
<div class="modal-footer">
@@ -816,7 +836,7 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
{{-- MODAL: Sposta documento --}}
<div class="modal fade" id="moveModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-folder-open mr-2"></i>Sposta documento</h5>
@@ -864,6 +884,21 @@ const eventi = @json($eventi->map(fn($e) => ['id' => $e->id, 'label' => $e->nome
const mailingLists = @json($mailingLists ? $mailingLists->map(fn($m) => ['id' => $m->id, 'label' => $m->nome]) : []);
const cartelle = @json($cartelleMoveOptions);
$('#uploadModal').on('shown.bs.modal', function () {
loadUploadTargets();
toggleUploadRepo();
});
$('#newFolderModal').on('show.bs.modal', function () {
$(this).css('z-index', 1060);
$('.modal-backdrop:last').css('z-index', 1050);
});
$('#newFolderModal').on('hidden.bs.modal', function () {
window._uploadNewFolder = false;
$(this).css('z-index', '');
});
function toggleAll(source) {
document.querySelectorAll('.doc-checkbox').forEach(cb => cb.checked = source.checked);
updateCount();
@@ -1244,6 +1279,13 @@ document.getElementById('massMoveNewFolderBtn')?.addEventListener('click', funct
});
});
document.getElementById('uploadNewFolderBtn')?.addEventListener('click', function(e) {
e.preventDefault();
window._uploadNewFolder = true;
$('#uploadModal').modal('hide');
$('#newFolderModal').modal('show');
});
document.getElementById('massMoveForm')?.addEventListener('submit', function(e) {
e.preventDefault();
const form = this;
@@ -1336,8 +1378,21 @@ document.getElementById('newFolderForm')?.addEventListener('submit', function(e)
.then(response => response.json())
.then(data => {
if (data.success) {
$('#newFolderModal').modal('hide');
window.location.reload();
if (window._uploadNewFolder) {
window._uploadNewFolder = false;
$('#newFolderModal').modal('hide');
$('#uploadModal').modal('show');
const select = document.getElementById('uploadCartellaId');
if (select) {
const opt = document.createElement('option');
opt.value = data.cartella.id;
opt.textContent = data.cartella.nome;
opt.selected = true;
select.appendChild(opt);
}
} else {
window.location.reload();
}
} else {
alert('Errore: ' + (data.message || 'Impossibile creare la cartella'));
}
@@ -1349,11 +1404,14 @@ document.getElementById('newFolderForm')?.addEventListener('submit', function(e)
function toggleUploadRepo() {
const repoSelect = document.getElementById('uploadRepository');
const cartellaInput = document.querySelector('input[name="cartella_id"]');
const folderGroup = document.getElementById('uploadFolderGroup');
const cartellaSelect = document.getElementById('uploadCartellaId');
if (repoSelect && repoSelect.value !== '') {
if (cartellaInput) cartellaInput.disabled = true;
if (folderGroup) folderGroup.style.display = 'none';
if (cartellaSelect) cartellaSelect.disabled = true;
} else {
if (cartellaInput) cartellaInput.disabled = false;
if (folderGroup) folderGroup.style.display = '';
if (cartellaSelect) cartellaSelect.disabled = false;
}
}
+6
View File
@@ -1,5 +1,6 @@
@extends('layouts.adminlte')
@php $appName = \App\Models\AppSetting::getAppName() ?? 'Glastree'; @endphp
@section('title', 'Guida - ' . $appName)
@section('page_title', 'Guida alla Configurazione')
@section('breadcrumbs')
@@ -53,6 +54,11 @@
</li>
</ul>
</div>
<div class="card-footer">
<a href="{{ route('help.pdf.download') }}" class="btn btn-primary btn-block">
<i class="fas fa-file-pdf mr-2"></i> Scarica Guida PDF
</a>
</div>
</div>
</div>
+894
View File
@@ -0,0 +1,894 @@
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="utf-8">
<title>{{ $appName ?? 'Glastree' }} Guida alla Configurazione</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-size: 11pt;
line-height: 1.6;
color: #333;
padding: 30px 40px;
}
h1 { font-size: 22pt; color: #1a237e; margin-bottom: 5px; }
h2 { font-size: 16pt; color: #283593; margin-top: 28px; margin-bottom: 10px; border-bottom: 2px solid #e0e0e0; padding-bottom: 4px; }
h3 { font-size: 13pt; color: #303f9f; margin-top: 20px; margin-bottom: 8px; }
h4 { font-size: 12pt; color: #3949ab; margin-top: 16px; margin-bottom: 6px; }
h5 { font-size: 11pt; color: #5c6bc0; margin-top: 14px; margin-bottom: 5px; }
h6 { font-size: 11pt; color: #5c6bc0; margin-top: 12px; margin-bottom: 4px; }
p { margin-bottom: 8px; }
ul, ol { margin: 6px 0 10px 20px; }
li { margin-bottom: 3px; }
table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 10pt; }
th, td { border: 1px solid #ccc; padding: 6px 8px; text-align: left; }
th { background: #e8eaf6; font-weight: 600; }
code { background: #f5f5f5; padding: 1px 5px; border-radius: 3px; font-family: 'Consolas', 'Courier New', monospace; font-size: 9.5pt; color: #c62828; }
pre { background: #263238; color: #e0e0e0; padding: 12px 16px; border-radius: 5px; font-family: 'Consolas', 'Courier New', monospace; font-size: 9pt; line-height: 1.4; overflow-x: auto; margin: 8px 0 14px; white-space: pre-wrap; word-break: break-word; }
pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.callout { border-left: 4px solid; padding: 10px 14px; margin: 12px 0; background: #f5f5f5; border-radius: 0 4px 4px 0; }
.callout-info { border-color: #2196f3; background: #e3f2fd; }
.callout-danger { border-color: #f44336; background: #ffebee; }
.callout-warning { border-color: #ff9800; background: #fff3e0; }
.callout-success { border-color: #4caf50; background: #e8f5e9; }
.badge { display: inline-block; padding: 2px 7px; font-size: 9pt; border-radius: 3px; background: #e0e0e0; }
.badge-primary { background: #1976d2; color: #fff; }
.badge-success { background: #388e3c; color: #fff; }
.badge-info { background: #0288d1; color: #fff; }
.badge-secondary { background: #757575; color: #fff; }
.subtitle { font-size: 12pt; color: #666; margin-bottom: 20px; }
.page-break { page-break-before: always; }
hr { border: none; border-top: 1px solid #ddd; margin: 24px 0; }
.toc { margin: 20px 0; padding: 16px 20px; background: #f5f5f5; border-radius: 5px; }
.toc a { color: #1565c0; text-decoration: none; }
.toc li { margin-bottom: 5px; }
@media print {
body { padding: 0; font-size: 10pt; }
pre { font-size: 8pt; padding: 8px 12px; }
h2 { page-break-after: avoid; }
h3, h4, h5 { page-break-after: avoid; }
.callout, table, pre { page-break-inside: avoid; }
}
</style>
</head>
<body>
<h1>{{ $appName ?? 'Glastree' }}</h1>
<p class="subtitle">Guida completa alla configurazione, installazione e migrazione</p>
<div class="toc">
<strong>Indice</strong>
<ol>
<li><a href="#webdav">WebDAV / Nextcloud</a></li>
<li><a href="#googledrive">Google Drive</a></li>
<li><a href="#tipologie">Tipologie e Gestione Dati</a></li>
<li><a href="#email">Email / SMTP</a></li>
<li><a href="#installazione">Guida all'Installazione</a></li>
<li><a href="#backup">Backup e Migrazione Server</a></li>
<li><a href="#docker">Docker</a></li>
</ol>
</div>
{{-- 1. WebDAV / Nextcloud --}}
<h2 id="webdav">1. WebDAV / Nextcloud</h2>
<h3>Cos'è</h3>
<p>WebDAV è un protocollo che permette di accedere a file su server remoti. Nextcloud lo utilizza per la sincronizzazione dei file.</p>
<h3>Configurazione</h3>
<p>Vai in <strong>Impostazioni Repository</strong> e crea un nuovo repository di tipo WebDAV.</p>
<div class="callout callout-info">
<h4>Campi obbligatori</h4>
<dl>
<dt><strong>Nome</strong></dt>
<dd>Un nome descrittivo (es. "Nextcloud Lavoro")</dd>
<dt><strong>Base URI</strong></dt>
<dd>L'URL del tuo server WebDAV.<br>
<em>Nextcloud:</em> <code>https://tuodominio.it/remote.php/dav/files/utente/</code><br>
<em>Altri:</em> <code>https://server.webdav.it/</code></dd>
<dt><strong>Root</strong></dt>
<dd>Percorso base all'interno del server (es. <code>/Documenti/</code>). Lascia <code>/</code> per usare la root.</dd>
<dt><strong>Username</strong></dt>
<dd>Il tuo nome utente</dd>
<dt><strong>Password</strong></dt>
<dd>La password dell'account</dd>
<dt><strong>Auth Type</strong></dt>
<dd><code>Basic</code> per la maggior parte dei server (Nextcloud, ownCloud).</dd>
</dl>
</div>
<h3>Nome utente con @ (chiocciola)</h3>
<p>Se il tuo nome utente contiene il carattere <code>@</code> (es. <code>mario.rossi@azienda.com</code>), segui queste regole:</p>
<ul>
<li><strong>Nel campo "Base URI":</strong> l'indirizzo email deve essere <strong>URL-encoded</strong>:<br>
<code>https://server.it/remote.php/dav/files/mario.rossi%40azienda.com/</code><br>
<small>(il carattere <code>@</code> diventa <code>%40</code>)</small></li>
<li><strong>Nel campo "Username":</strong> inserisci l'indirizzo email <strong>normale</strong> con la <code>@</code> vera.</li>
</ul>
<p>Il sistema gestisce automaticamente la differenza tra l'URI (che richiede <code>%40</code>) e l'autenticazione (che usa la <code>@</code> reale).</p>
<h3>Test connessione</h3>
<p>Dopo aver salvato, usa il pulsante <strong>Test</strong> nella tabella dei repository per verificare che la connessione funzioni.</p>
<h3>Importare file</h3>
<p>Apri la sezione <strong>Documenti</strong>, clicca sul pulsante del repository nella toolbar per sfogliare i file remoti, poi clicca <strong>Salva tra i documenti</strong> su un file per importarlo come documento locale.</p>
<div class="page-break"></div>
{{-- 2. Google Drive --}}
<h2 id="googledrive">2. Google Drive</h2>
<h3>Cos'è</h3>
<p>Integrazione con Google Drive per sfogliare e importare file direttamente dal tuo spazio Google Drive.</p>
<h3>Requisiti</h3>
<ol>
<li>Un account Google / Google Workspace</li>
<li>Un progetto sulla <strong>Google Cloud Console</strong> con l'API Google Drive abilitata</li>
<li>Credenziali OAuth 2.0 (Client ID e Client Secret)</li>
</ol>
<h3>Passo 1: Creare il progetto Google Cloud</h3>
<ol>
<li>Vai su <strong>Google Cloud Console</strong> (console.developers.google.com)</li>
<li>Crea un nuovo progetto o selezionane uno esistente</li>
<li>Vai a <strong>API e servizi → Libreria</strong></li>
<li>Cerca "<strong>Google Drive API</strong>" e <strong>abilitala</strong></li>
<li>Vai a <strong>API e servizi → Credenziali</strong></li>
<li>Clicca "<strong>Crea credenziali → ID client OAuth</strong>"</li>
<li>Tipo applicazione: "<strong>Applicazione Web</strong>"</li>
<li><strong>URI di reindirizzamento autorizzato:</strong> aggiungi <code>{{ url('/auth/google-drive/callback') }}</code></li>
<li>Completa la creazione e <strong>copia Client ID e Client Secret</strong></li>
</ol>
<h3>Passo 2: Configurazione nell'app</h3>
<ol>
<li>Vai in <strong>Impostazioni Repository</strong></li>
<li>Clicca "<strong>Nuovo Repository</strong>" e seleziona tipo <strong>Google Drive</strong></li>
<li>Inserisci un nome descrittivo (es. "Drive Lavoro")</li>
<li>Incolla <strong>Client ID</strong> e <strong>Client Secret</strong></li>
<li><strong>Folder ID (opzionale):</strong> se vuoi limitare l'accesso a una cartella specifica, inserisci il suo ID (lo trovi nell'URL quando apri la cartella in Google Drive: <code>https://drive.google.com/drive/folders/<strong>ID_QUI</strong></code>)</li>
<li>Clicca "<strong>Autorizza Google Drive</strong>" verrai reindirizzato a Google per concedere i permessi</li>
<li>Dopo l'autorizzazione, il refresh token verrà salvato automaticamente</li>
</ol>
<h3>Google Drive API non abilitata</h3>
<p>Se vedi l'errore <em>"Google Drive API non abilitata"</em> nel test connessione, significa che l'API Drive non è stata attivata nel tuo progetto Google Cloud.</p>
<div class="callout callout-danger">
<h4>Soluzione</h4>
<p>Vai su <code>https://console.developers.google.com/apis/api/drive.googleapis.com/overview</code></p>
<p>Seleziona il progetto corretto dall'header in alto, clicca <strong>"Enable"</strong> e attendi qualche minuto prima di riprovare.</p>
</div>
<h3>Importare file</h3>
<p>Stessa procedura di WebDAV: apri <strong>Documenti</strong>, clicca sul repository Drive, sfoglia i file e usa <strong>Salva tra i documenti</strong>.</p>
<h3>File Google (Documenti, Fogli, Presentazioni)</h3>
<p>I file creati con Google Workspace (Documenti Google, Fogli Google, Presentazioni Google, Disegni Google) non possono essere scaricati direttamente perché non hanno un formato binario nativo.</p>
<p>Il sistema li converte automaticamente in formato Office Open XML durante l'import:</p>
<table>
<thead><tr><th>File Google</th><th>Formato convertito</th></tr></thead>
<tbody>
<tr><td>Documento Google</td><td><code>.docx</code> (Word)</td></tr>
<tr><td>Foglio Google</td><td><code>.xlsx</code> (Excel)</td></tr>
<tr><td>Presentazione Google</td><td><code>.pptx</code> (PowerPoint)</td></tr>
<tr><td>Disegno Google</td><td><code>.png</code> (Immagine)</td></tr>
<tr><td>Altri (Moduli, Script)</td><td><code>.pdf</code> (PDF)</td></tr>
</tbody>
</table>
<p>Il nome del file viene automaticamente esteso con l'estensione corretta (es. "Relazione" "Relazione.docx").</p>
<div class="page-break"></div>
{{-- 3. Tipologie e Dati --}}
<h2 id="tipologie">3. Tipologie e Gestione Dati</h2>
<h3>Tipologie Documenti</h3>
<p>Le tipologie classificano i documenti (avatar, galleria, documento, statuto, altro).</p>
<p>Si gestiscono in <strong>Impostazioni Tipologie Documenti</strong>. Puoi aggiungere, rinominare, riordinare ed eliminare tipologie (tranne quelle con documenti associati).</p>
<h3>Tipologie Individui</h3>
<p>Classificano gli individui (es. socio, volontario, dipendente). Si gestiscono in <strong>Impostazioni Tipologie</strong>.</p>
<h3>Tipologie Eventi</h3>
<p>Classificano gli eventi (es. riunione, assemblea, formazione). Si gestiscono in <strong>Impostazioni Tipologie Eventi</strong>.</p>
<h3>Ruoli Individui</h3>
<p>Definiscono il ruolo o la carica di un individuo (es. presidente, segretario, tesoriere). Si gestiscono in <strong>Impostazioni Ruoli</strong>.</p>
<h3>Visibilità Documenti</h3>
<p>Ogni documento può avere diversi livelli di visibilità:</p>
<ul>
<li><strong>Pubblico</strong> visibile a tutti gli utenti</li>
<li><strong>Individuo</strong> visibile solo a uno specifico individuo</li>
<li><strong>Gruppo</strong> visibile solo ai membri di un gruppo</li>
<li><strong>Evento</strong> visibile solo ai partecipanti di un evento</li>
<li><strong>Mailing</strong> visibile solo ai membri di una mailing list</li>
</ul>
<div class="page-break"></div>
{{-- 4. Email / SMTP --}}
<h2 id="email">4. Email / SMTP</h2>
<h3>Configurazione Email</h3>
<p>Vai in <strong>Impostazioni Email</strong> per configurare la posta elettronica.</p>
<h3>Server IMAP (Ricezione)</h3>
<p>Usato per ricevere e leggere le email direttamente nell'app.</p>
<div class="callout callout-info">
<h4>Campi consigliati per provider comuni</h4>
<table>
<thead><tr><th>Provider</th><th>Host</th><th>Porta</th><th>Crittografia</th></tr></thead>
<tbody>
<tr><td>Gmail</td><td><code>imap.gmail.com</code></td><td><code>993</code></td><td>SSL</td></tr>
<tr><td>Outlook/Office 365</td><td><code>outlook.office365.com</code></td><td><code>993</code></td><td>SSL</td></tr>
<tr><td>Libero</td><td><code>imapmail.libero.it</code></td><td><code>993</code></td><td>SSL</td></tr>
<tr><td>Aruba</td><td><code>imap.aruba.it</code></td><td><code>993</code></td><td>SSL</td></tr>
</tbody>
</table>
</div>
<h3>Server SMTP (Invio)</h3>
<p>Usato per inviare email dall'app. Supporta account multipli (mittenti).</p>
<div class="callout callout-info">
<h4>Campi consigliati per provider comuni</h4>
<table>
<thead><tr><th>Provider</th><th>Host</th><th>Porta</th><th>Crittografia</th></tr></thead>
<tbody>
<tr><td>Gmail</td><td><code>smtp.gmail.com</code></td><td><code>587</code></td><td>TLS</td></tr>
<tr><td>Outlook/Office 365</td><td><code>smtp.office365.com</code></td><td><code>587</code></td><td>TLS</td></tr>
<tr><td>Libero</td><td><code>smtp.libero.it</code></td><td><code>465</code></td><td>SSL</td></tr>
<tr><td>Aruba</td><td><code>smtp.aruba.it</code></td><td><code>465</code></td><td>SSL</td></tr>
</tbody>
</table>
</div>
<h3>Gmail / Google Workspace</h3>
<div class="callout callout-warning">
Gmail richiede una <strong>Password per l'app</strong> (non la password normale) se usi la verifica in due passaggi. Puoi generarla su <code>https://myaccount.google.com/apppasswords</code>.
</div>
<h3>Mailing</h3>
<p>Le <strong>Mailing List</strong> permettono di inviare email a gruppi predefiniti di destinatari.</p>
<ul>
<li>Crea una mailing list in <strong>Mailing List → Nuova</strong></li>
<li>Puoi popolare la lista da individui, gruppi o manualmente</li>
<li>Invia email alla lista da <strong>Email → Nuova Email</strong>, selezionando la mailing list come destinatario</li>
</ul>
<h3>Test connessione</h3>
<p>Dopo aver configurato i server, usa il pulsante <strong>Test Connessione</strong> per verificare che IMAP e SMTP funzionino correttamente.</p>
<div class="page-break"></div>
{{-- 5. Installazione --}}
<h2 id="installazione">5. Guida all'Installazione</h2>
<h3>Panoramica</h3>
<p>L'applicazione include un <strong>wizard di installazione web</strong> che guida passo-passo nella configurazione su un nuovo server LAMP. Supporta due modalità:</p>
<table>
<thead><tr><th>Modalità</th><th>Descrizione</th></tr></thead>
<tbody>
<tr><td><strong>Fresh Install</strong></td><td>Installa l'applicazione da zero su un nuovo server: crea il database, esegue le migration, popola i dati di base e crea l'amministratore.</td></tr>
<tr><td><strong>Restore da Backup</strong></td><td>Ripristina un'installazione esistente da un file ZIP di backup: importa il database, ripristina i documenti e la configurazione.</td></tr>
</tbody>
</table>
<h3>Requisiti del Server</h3>
<table>
<thead><tr><th>Componente</th><th>Versione Minima</th><th>Note</th></tr></thead>
<tbody>
<tr><td>Web Server</td><td>Apache 2.4+</td><td>Con mod_rewrite abilitato</td></tr>
<tr><td>PHP</td><td>8.2+ (consigliato 8.4)</td><td>Estensioni: pdo_mysql, mbstring, xml, curl, zip, gd, fileinfo</td></tr>
<tr><td>MySQL / MariaDB</td><td>MySQL 8.0+ / MariaDB 10.5+</td><td>Supporto utf8mb4</td></tr>
<tr><td>Composer</td><td>2.x</td><td>Per gestione dipendenze PHP</td></tr>
<tr><td>Node.js / npm</td><td>Node 20+ / npm 10+</td><td>Per compilazione asset frontend (opzionale se precompilati)</td></tr>
</tbody>
</table>
<h3>Installazione Passo-Passo</h3>
<h4>Passo 1: Preparare il server LAMP</h4>
<pre>sudo apt update && sudo apt upgrade -y
sudo apt install -y apache2 mariadb-server php8.4 php8.4-cli \
php8.4-mysql php8.4-xml php8.4-mbstring php8.4-curl \
php8.4-zip php8.4-bcmath php8.4-gd php8.4-intl \
composer git unzip
sudo a2enmod rewrite
sudo systemctl restart apache2</pre>
<h4>Passo 2: Ottenere l'applicazione</h4>
<p>Puoi clonare il repository con git oppure estrarre il file ZIP ricevuto nella cartella <code>/var/www/glastree</code>.</p>
<pre>cd /var/www
# Opzione A — Git clone
git clone &lt;URL_REPOSITORY&gt; glastree
# Opzione B — ZIP (se non hai git)
# unzip /percorso/del/glastree.zip -d glastree
cd glastree
composer install --no-dev --optimize-autoloader
npm ci && npm run build</pre>
<p>Se non hai accesso a npm, puoi saltare il build. L'interfaccia userà comunque AdminLTE via CDN.</p>
<h4>Passo 3: Permessi cartelle</h4>
<pre>sudo chown -R www-data:www-data storage bootstrap/cache
sudo chmod -R 775 storage bootstrap/cache</pre>
<h4>Passo 4: Configurare Apache</h4>
<pre>sudo tee /etc/apache2/sites-available/glastree.conf &lt;&lt;APACHE
&lt;VirtualHost *:80&gt;
ServerName glastree.esempio.it
DocumentRoot /var/www/glastree/public
&lt;Directory /var/www/glastree/public&gt;
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
&lt;/Directory&gt;
ErrorLog \${APACHE_LOG_DIR}/glastree_error.log
CustomLog \${APACHE_LOG_DIR}/glastree_access.log combined
&lt;/VirtualHost&gt;
APACHE
sudo a2dissite 000-default.conf
sudo a2ensite glastree.conf
sudo systemctl reload apache2</pre>
<h4>Passo 5: Avviare il wizard di installazione</h4>
<p>Apri il browser e visita: <code>http://glastree.esempio.it/installer/</code></p>
<p>Il wizard ti guiderà attraverso 6 passi:</p>
<table>
<thead><tr><th>Passo</th><th>Descrizione</th></tr></thead>
<tbody>
<tr><td>1. Benvenuto</td><td>Scegli Fresh Install o Restore da Backup</td></tr>
<tr><td>2. Requisiti</td><td>Verifica PHP, estensioni e permessi</td></tr>
<tr><td>3. Database</td><td>Configura MySQL (crea nuovo o usa esistente)</td></tr>
<tr><td>4. Installazione</td><td>Fresh: migration e seed. Backup: upload ZIP</td></tr>
<tr><td>5. Amministratore</td><td>Fresh: crea super-admin. Backup: verifica utenti</td></tr>
<tr><td>6. Finalizzazione</td><td>Cache, storage link, auto-eliminazione installer</td></tr>
</tbody>
</table>
<div class="callout callout-warning">
<strong>Attenzione:</strong> Al termine dell'installazione, la cartella <code>installer/</code> viene <strong>automaticamente eliminata</strong>. Non puoi rieseguire l'installazione se non ricreando manualmente la cartella.
</div>
<h3>Modalità Fresh Install</h3>
<p>Seleziona questa modalità quando installi l'applicazione per la prima volta su un server.</p>
<p>Cosa succede durante l'installazione:</p>
<ol>
<li>Genera <code>APP_KEY</code> per la crittografia</li>
<li>Esegue tutte le migration per creare le tabelle del database</li>
<li>Popola i dati di base (diocesi, comuni, ruoli, preset)</li>
<li>Crea il collegamento <code>storage public/storage</code></li>
<li>Crea l'utente amministratore con i permessi completi</li>
</ol>
<h3>Modalità Restore da Backup</h3>
<p>Seleziona questa modalità quando vuoi migrare un'installazione esistente su un nuovo server.</p>
<p>Cosa serve:</p>
<ul>
<li>Un file ZIP generato dalla pagina <strong>Admin Backup</strong> del server originale</li>
<li>Il wizard accetta upload diretto del file o un percorso sul server</li>
</ul>
<p>Cosa succede durante il restore:</p>
<ol>
<li>Estrae il file ZIP in una cartella temporanea</li>
<li>Importa <code>database.sql</code> nel database MySQL configurato</li>
<li>Copia i file documenti in <code>storage/app/documenti/</code></li>
<li>Ripristina il file <code>.env</code> dal backup (preservando le credenziali DB del nuovo server)</li>
</ol>
<h3>Dopo l'Installazione</h3>
<ol>
<li><strong>Configura SSL</strong> con Let's Encrypt:
<pre>sudo apt install -y certbot python3-certbot-apache
sudo certbot --apache -d glastree.esempio.it</pre>
</li>
<li><strong>Accedi</strong> con le credenziali amministratore create durante l'installazione</li>
<li><strong>Configura l'applicazione</strong> in Impostazioni:
<ul>
<li>Nome applicazione e logo</li>
<li>Email (SMTP per invio, IMAP per ricezione)</li>
<li>Repository remoti (Google Drive, Nextcloud)</li>
</ul>
</li>
<li><strong>Crea utenti</strong> dal pannello Admin Utenti</li>
<li><strong>Configura il cron</strong> per backup automatico e sync email:
<pre>sudo crontab -u www-data -e
# Inserisci:
* * * * * cd /var/www/glastree && php artisan schedule:run >> /dev/null 2>&1</pre>
</li>
</ol>
<h3>Risoluzione Problemi</h3>
<div class="callout callout-danger">
<h4>Errore "500 | Server Error" dopo l'installazione</h4>
<p>Probabilmente mancano permessi sulle cartelle <code>storage</code> o <code>bootstrap/cache</code>:</p>
<pre>sudo chown -R www-data:www-data storage bootstrap/cache
sudo chmod -R 775 storage bootstrap/cache</pre>
</div>
<div class="callout callout-danger">
<h4>Errore "No application encryption key"</h4>
<p>APP_KEY non generata. Nella cartella dell'app:</p>
<pre>php artisan key:generate</pre>
</div>
<div class="callout callout-warning">
<h4>mod_rewrite non funziona</h4>
<p>Se le rotte restituiscono 404, verifica che Apache abbia AllowOverride:</p>
<pre>sudo a2enmod rewrite
# Nel VirtualHost: AllowOverride All
sudo systemctl reload apache2</pre>
</div>
<div class="page-break"></div>
{{-- 6. Backup e Migrazione --}}
<h2 id="backup">6. Backup e Migrazione Server</h2>
<h3>Cos'è</h3>
<p>Il sistema di backup crea un archivio ZIP contenente tutto il necessario per ripristinare l'applicazione su un nuovo server. Include database, file caricati e configurazione.</p>
<h3>Cosa include il backup</h3>
<table>
<thead><tr><th>Componente</th><th>Incluso</th><th>Dettagli</th></tr></thead>
<tbody>
<tr><td>Database (MySQL)</td><td>Sempre</td><td>Struttura, dati, stored procedure, eventi, trigger</td></tr>
<tr><td>File caricati</td><td>Opzionale</td><td>Documenti, avatar, gallerie</td></tr>
<tr><td>Configurazione .env</td><td>Opzionale</td><td>APP_KEY, credenziali DB, SMTP, token OAuth</td></tr>
<tr><td>Metadati</td><td>Sempre</td><td>Versione app, PHP, Laravel</td></tr>
</tbody>
</table>
<h3>Come eseguire un backup</h3>
<table>
<thead><tr><th>Via Interfaccia Web</th><th>Via Comando</th></tr></thead>
<tbody>
<tr>
<td>
<ol>
<li>Vai su <strong>Admin Backup</strong></li>
<li>Verifica le impostazioni (includi files/.env)</li>
<li>Clicca <strong>Esegui Backup Ora</strong></li>
<li>Scarica il file ZIP generato</li>
</ol>
</td>
<td>
<pre>php artisan backup:run</pre>
<p>Il file viene creato in <code>storage/app/backups/</code></p>
</td>
</tr>
</tbody>
</table>
<h3>Backup automatico</h3>
<p>Puoi abilitare il backup automatico dalla pagina <strong>Admin Backup</strong>:</p>
<ul>
<li><strong>Frequenza:</strong> giornaliero, settimanale o mensile</li>
<li><strong>Ora:</strong> consigliata 03:00 (notte)</li>
<li><strong>Requisito:</strong> il cron di Laravel deve essere configurato sul server</li>
</ul>
<div class="callout callout-warning">
<i class="fas fa-clock mr-2"></i>
Per il backup automatico, aggiungi questo cron:
<pre>* * * * * cd {{ base_path() }} && php artisan schedule:run >> /dev/null 2>&1</pre>
</div>
<hr>
<h3>Procedura di Migrazione Completa</h3>
<p>Segui questa procedura per migrare l'applicazione su un nuovo server LAMP (Linux, Apache, MySQL, PHP).</p>
<div class="callout callout-danger">
<strong>ATTENZIONE: APP_KEY</strong>
<p>L'APP_KEY cripta i dati sensibili (password email SMTP, token OAuth Google Drive, ecc.).</p>
<ul>
<li><strong>Se hai il .env originale dal backup:</strong> NON rigenerare APP_KEY mantieni i dati criptati accessibili.</li>
<li><strong>Se hai perso il .env:</strong> DEVI rigenerare APP_KEY, ma perderai l'accesso ai dati criptati esistenti. Dovrai riconfigurare SMTP e OAuth.</li>
</ul>
</div>
<h4>Passo 1: Preparazione del server</h4>
<pre>sudo apt update && sudo apt upgrade -y</pre>
<h4>Passo 2: Installa LAMP + PHP 8.4</h4>
<pre>sudo apt install -y apache2 mariadb-server php8.4 php8.4-cli \
php8.4-mysql php8.4-xml php8.4-mbstring php8.4-curl \
php8.4-zip php8.4-bcmath php8.4-gd php8.4-intl \
composer git unzip
sudo a2enmod rewrite</pre>
<h4>Passo 3: Ottieni l'applicazione</h4>
<p>Puoi clonare il repository con git oppure estrarre il file ZIP ricevuto nella cartella <code>/var/www/glastree</code>.</p>
<pre>cd /var/www
# Opzione A — Git clone
git clone &lt;URL_REPOSITORY&gt; glastree
# Opzione B — ZIP (se non hai git)
# unzip /percorso/del/glastree.zip -d glastree
cd glastree
composer install --no-dev --optimize-autoloader
npm ci && npm run build</pre>
<h4>Passo 4: Carica il backup</h4>
<p>Copia il file <code>backup.zip</code> sul nuovo server e estrailo:</p>
<pre>mkdir -p /tmp/restore
unzip backup.zip -d /tmp/restore/
ls -la /tmp/restore/
# Dovresti vedere: database.sql .env files/ manifest.json</pre>
<h4>Passo 5: Crea database e importa</h4>
<pre>sudo mysql -u root &lt;&lt;EOF
CREATE DATABASE glastree CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'glastree'@'localhost' IDENTIFIED BY 'ScegliPasswordFortep4ss!';
GRANT ALL ON glastree.* TO 'glastree'@'localhost';
FLUSH PRIVILEGES;
EOF
mysql -u glastree -p glastree &lt; /tmp/restore/database.sql</pre>
<h4>Passo 6: Configura .env</h4>
<pre>cp /tmp/restore/.env .env
# Modifica se necessario:
# APP_URL=https://nuovo-dominio.it
# DB_HOST=localhost
# DB_DATABASE=glastree
# DB_USERNAME=glastree
# DB_PASSWORD=ScegliPasswordFortep4ss!
# DECIDI SULL'APP_KEY (leggi avviso sopra!)
# php artisan key:generate ← SOLO se non hai il .env originale</pre>
<h4>Passo 7: Ripristina file e permessi</h4>
<pre>cp -r /tmp/restore/files/* storage/app/documenti/
sudo chown -R www-data:www-data storage bootstrap/cache
sudo chmod -R 755 storage bootstrap/cache
php artisan storage:link</pre>
<h4>Passo 8: Cache</h4>
<pre>php artisan optimize:clear
php artisan config:cache
php artisan route:cache
php artisan view:cache</pre>
<h4>Passo 9: Configura Apache</h4>
<pre>sudo tee /etc/apache2/sites-available/glastree.conf &lt;&lt;APACHE
&lt;VirtualHost *:80&gt;
ServerName glastree.esempio.it
DocumentRoot /var/www/glastree/public
&lt;Directory /var/www/glastree/public&gt;
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
&lt;/Directory&gt;
ErrorLog \${APACHE_LOG_DIR}/glastree_error.log
CustomLog \${APACHE_LOG_DIR}/glastree_access.log combined
&lt;/VirtualHost&gt;
APACHE
sudo a2dissite 000-default.conf
sudo a2ensite glastree.conf
sudo systemctl reload apache2</pre>
<h4>Passo 10: SSL Let's Encrypt</h4>
<pre>sudo apt install -y certbot python3-certbot-apache
sudo certbot --apache -d glastree.esempio.it</pre>
<h4>Passo 11: Cron per backup automatico</h4>
<pre>sudo crontab -u www-data -e
# Inserisci:
* * * * * cd /var/www/glastree && php artisan schedule:run >> /dev/null 2>&1</pre>
<h4>Passo 12: Verifica finale</h4>
<ol>
<li>Apri https://glastree.esempio.it nel browser</li>
<li>Fai login con le credenziali esistenti</li>
<li>Verifica: Dashboard, Documenti, Impostazioni, Email</li>
<li>Se hai rigenerato APP_KEY: riconfigura SMTP e OAuth Google Drive</li>
</ol>
<hr>
<h3>PHP Web Installer</h3>
<p>L'applicazione include un <strong>wizard di installazione web</strong> nella cartella <code>installer/</code>. Questo wizard gestisce sia installazioni fresh che ripristino da backup.</p>
<p>Vedi la sezione <strong>Installazione</strong> per la guida completa.</p>
<div class="page-break"></div>
{{-- 7. Docker --}}
<h2 id="docker">7. Docker</h2>
<h3>Creare un'immagine Docker con dati di base</h3>
<p>Puoi creare un'immagine Docker pronta all'uso che include l'applicazione e i dati di base (tipologie documenti, tipologie eventi, ruoli). Scegli la configurazione in base alle tue esigenze:</p>
<table>
<thead><tr><th>Configurazione</th><th>Descrizione</th></tr></thead>
<tbody>
<tr><td><strong>SQLite (Leggero)</strong></td><td>Database embedded, nessun servizio aggiuntivo. Ideale per demo, test, sviluppo locale o ambienti con poca concorrenza.</td></tr>
<tr><td><strong>MySQL (Standard)</strong></td><td>Database separato in un container MySQL. Configurazione standard, ideale per produzione, staging e ambienti con più utenti.</td></tr>
</tbody>
</table>
<h3>1. Dockerfile (comune a entrambe le modalità)</h3>
<pre>FROM php:8.4-apache
# Abilita mod_rewrite
RUN docker-php-ext-enable opcache \
&& a2enmod rewrite
# Installa estensioni PHP (sia SQLite che MySQL)
RUN docker-php-ext-install pdo_mysql pdo_sqlite bcmath gd zip
# Installa Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# Configura DocumentRoot per Laravel
ENV APACHE_DOCUMENT_ROOT=/var/www/html/public
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf \
&& sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
# Copia l'applicazione
COPY . /var/www/html/
# Installa dipendenze e compila asset
RUN composer install --no-dev --optimize-autoloader \
&& mkdir -p storage/app/public \
&& mkdir -p storage/framework/cache/data \
&& mkdir -p storage/framework/sessions \
&& mkdir -p storage/framework/views \
&& mkdir -p storage/logs \
&& mkdir -p bootstrap/cache \
&& chown -R www-data:www-data storage bootstrap/cache
# Entrypoint per inizializzazione
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["apache2-foreground"]</pre>
<h3>2. Entrypoint Script (comune)</h3>
<p>Crea <code>docker-entrypoint.sh</code>. Lo script rileva automaticamente la configurazione in base alle variabili d'ambiente:</p>
<pre>#!/bin/bash
set -e
# Se .env non esiste, lo genera dalle variabili d'ambiente
if [ ! -f .env ]; then
cp .env.example .env
if [ "$DB_CONNECTION" = "mysql" ]; then
# Configura MySQL
sed -i "s/DB_CONNECTION=mysql/DB_CONNECTION=mysql/" .env
sed -i "s/DB_HOST=.*/DB_HOST=${DB_HOST:-mysql}/" .env
sed -i "s/DB_PORT=.*/DB_PORT=${DB_PORT:-3306}/" .env
sed -i "s/DB_DATABASE=.*/DB_DATABASE=${DB_DATABASE:-glastree}/" .env
sed -i "s/DB_USERNAME=.*/DB_USERNAME=${DB_USERNAME:-glastree}/" .env
sed -i "s/DB_PASSWORD=.*/DB_PASSWORD=${DB_PASSWORD:-secret}/" .env
# Attende che MySQL sia pronto
echo "Attendo MySQL..."
until php -r "new PDO('mysql:host=${DB_HOST:-mysql};dbname=${DB_DATABASE:-glastree}', '${DB_USERNAME:-glastree}', '${DB_PASSWORD:-secret}');" 2>/dev/null; do
sleep 2
done
echo "MySQL pronto."
else
# Configura SQLite
sed -i 's/DB_CONNECTION=mysql/DB_CONNECTION=sqlite/' .env
sed -i 's/DB_HOST=.*//' .env
sed -i 's/DB_PORT=.*//' .env
sed -i 's/DB_DATABASE=.*/DB_DATABASE=\/var\/www\/html\/database\/database.sqlite/' .env
sed -i 's/DB_USERNAME=.*//' .env
sed -i 's/DB_PASSWORD=.*//' .env
touch database/database.sqlite
chmod 664 database/database.sqlite
fi
# Genera APP_KEY
php artisan key:generate --force
fi
# Esegui migration e seed se il database è vuoto
if [ ! -f .db_initialized ]; then
php artisan migrate --force
php artisan db:seed --force
touch .db_initialized
fi
# Configura storage link
php artisan storage:link --force 2>/dev/null || true
exec "$@"</pre>
<pre>chmod +x docker-entrypoint.sh</pre>
<h3>3. Seed Base Dati (comune)</h3>
<p>Per includere tipologie documenti, tipologie eventi e ruoli, crea un seeder dedicato:</p>
<pre>php artisan make:seeder DockerBaseDataSeeder</pre>
<p>Contenuto di <code>database/seeders/DockerBaseDataSeeder.php</code>:</p>
<pre>&lt;?php
declare(strict_types=1);
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class DockerBaseDataSeeder extends Seeder
{
public function run(): void
{
// Tipologie Documenti
$tipologieDoc = ['documento', 'avatar', 'galleria', 'statuto', 'programma', 'locandina', 'altro'];
foreach ($tipologieDoc as $ord =&gt; $nome) {
DB::table('tipologie_documenti')-&gt;updateOrInsert(
['nome' =&gt; $nome],
['descrizione' =&gt; ucfirst($nome), 'ordine' =&gt; $ord + 1, 'attiva' =&gt; true]
);
}
// Tipologie Eventi
$tipologieEventi = [
['nome' =&gt; 'catechesi', 'descrizione' =&gt; 'Catechesi'],
['nome' =&gt; 'liturgia', 'descrizione' =&gt; 'Liturgia'],
['nome' =&gt; 'animazione', 'descrizione' =&gt; 'Animazione'],
['nome' =&gt; 'formazione', 'descrizione' =&gt; 'Formazione'],
['nome' =&gt; 'incontro', 'descrizione' =&gt; 'Incontro'],
['nome' =&gt; 'riunione', 'descrizione' =&gt; 'Riunione'],
['nome' =&gt; 'festa', 'descrizione' =&gt; 'Festa'],
['nome' =&gt; 'altro', 'descrizione' =&gt; 'Altro'],
];
foreach ($tipologieEventi as $ord =&gt; $t) {
DB::table('tipologie_eventi')-&gt;updateOrInsert(
['nome' =&gt; $t['nome']],
['descrizione' =&gt; $t['descrizione'], 'ordine' =&gt; $ord + 1, 'attiva' =&gt; true]
);
}
// Ruoli
$ruoli = ['presidente', 'vicepresidente', 'segretario', 'tesoriere', 'consigliere', 'volontario', 'socio', 'altro'];
foreach ($ruoli as $ord =&gt; $nome) {
DB::table('ruoli')-&gt;updateOrInsert(
['nome' =&gt; $nome],
['descrizione' =&gt; ucfirst($nome), 'ordine' =&gt; $ord + 1, 'attiva' =&gt; true]
);
}
}
}</pre>
<p>Registralo in <code>database/seeders/DatabaseSeeder.php</code>:</p>
<pre>$this-&gt;call([
// ... altri seeder ...
DockerBaseDataSeeder::class,
]);</pre>
<h3>4. Docker Compose</h3>
<h4>Opzione A — SQLite (leggero)</h4>
<pre>services:
glastree:
build: .
ports:
- "8080:80"
volumes:
- glastree_storage:/var/www/html/storage
- glastree_db:/var/www/html/database
environment:
- APP_ENV=production
- APP_DEBUG=false
- APP_URL=http://localhost:8080
- DB_CONNECTION=sqlite
volumes:
glastree_storage:
glastree_db:</pre>
<h4>Opzione B — MySQL (standard)</h4>
<pre>services:
glastree:
build: .
ports:
- "8080:80"
volumes:
- glastree_storage:/var/www/html/storage
depends_on:
mysql:
condition: service_healthy
environment:
- APP_ENV=production
- APP_DEBUG=false
- APP_URL=http://localhost:8080
- DB_CONNECTION=mysql
- DB_HOST=mysql
- DB_PORT=3306
- DB_DATABASE=glastree
- DB_USERNAME=glastree
- DB_PASSWORD=secret
mysql:
image: mysql:8.0
volumes:
- mysql_data:/var/lib/mysql
environment:
- MYSQL_DATABASE=glastree
- MYSQL_USER=glastree
- MYSQL_PASSWORD=secret
- MYSQL_ROOT_PASSWORD=root_secret
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
timeout: 3s
retries: 10
volumes:
glastree_storage:
mysql_data:</pre>
<h3>5. Build e avvio</h3>
<p>Assicurati di essere nella cartella del progetto (ottenuta via <code>git clone</code> o estraendo il ZIP), poi:</p>
<pre># Costruisci l'immagine (comune)
docker build -t glastree:latest .
# Avvia con SQLite
docker compose -f docker-compose.yml up -d
# Oppure avvia con MySQL
# docker compose -f docker-compose.mysql.yml up -d
# Apri nel browser
open http://localhost:8080</pre>
<h3>6. Primo accesso</h3>
<p>Al primo avvio, l'entrypoint esegue automaticamente migration e seed. Troverai già popolati:</p>
<ul>
<li><strong>Tipologie Documenti:</strong> documento, avatar, galleria, statuto, programma, locandina, altro</li>
<li><strong>Tipologie Eventi:</strong> catechesi, liturgia, animazione, formazione, incontro, riunione, festa, altro</li>
<li><strong>Ruoli:</strong> presidente, vicepresidente, segretario, tesoriere, consigliere, volontario, socio, altro</li>
</ul>
<p>Dovrai creare il primo utente amministratore via CLI:</p>
<pre>docker exec -it glastree php artisan tinker --execute="
\$u = new \App\Models\User;
\$u->name = 'Amministratore';
\$u->email = 'admin@esempio.it';
\$u->password = bcrypt('password-forte');
\$u->is_admin = true;
\$u->permissions = ['individui' => 2, 'gruppi' => 2, 'eventi' => 2, 'documenti' => 2, 'mailing' => 2, 'viste' => 2, 'report' => 2, 'settings' => 2];
\$u->save();
echo 'Utente creato con successo!';
"</pre>
<div class="callout callout-warning">
<h4>Note importanti</h4>
<ul>
<li><strong>Persistenza:</strong> i volumi Docker preservano storage e database tra i riavvii</li>
<li><strong>APP_KEY:</strong> viene generata al primo avvio — se elimini i volumi, la perdi e i dati criptati diventano inaccessibili</li>
<li><strong>MySQL in produzione:</strong> imposta password sicure per <code>MYSQL_PASSWORD</code> e <code>MYSQL_ROOT_PASSWORD</code></li>
<li><strong>File compose separati:</strong> puoi mantenere entrambi i file (<code>docker-compose.yml</code> per SQLite, <code>docker-compose.mysql.yml</code> per MySQL) e scegliere con <code>-f</code></li>
</ul>
</div>
</body>
</html>
+14
View File
@@ -92,6 +92,20 @@
<a href="/mailing-liste" class="small-box-footer">Visualizza <i class="fas fa-arrow-circle-right"></i></a>
</div>
</div>
@if(Auth::user()->canManage('settings'))
<div class="col-lg-3 col-6">
<div class="small-box bg-navy">
<div class="inner">
<h3>{{ $stats['backups'] }}</h3>
<p>Backup</p>
</div>
<div class="icon">
<i class="fas fa-hdd"></i>
</div>
<a href="{{ route('admin.backup.index') }}" class="small-box-footer">Visualizza <i class="fas fa-arrow-circle-right"></i></a>
</div>
</div>
@endif
</div>
<div class="row">
+35 -15
View File
@@ -85,12 +85,6 @@ $appName = \App\Models\AppSetting::getAppName() ?? 'Glastree';
<p>Dashboard</p>
</a>
</li>
<li class="nav-item">
<a href="{{ route('help') }}" class="nav-link {{ request()->routeIs('help') ? 'active' : '' }}">
<i class="nav-icon fas fa-question-circle"></i>
<p>Guida</p>
</a>
</li>
@if(Auth::user()->canAccess('individui'))
<li class="nav-item">
<a href="{{ route('individui.index') }}" class="nav-link">
@@ -220,19 +214,45 @@ $appName = \App\Models\AppSetting::getAppName() ?? 'Glastree';
<p>Impostazioni</p>
</a>
</li>
<li class="nav-item">
<a href="/admin/utenti" class="nav-link {{ request()->is('admin*') ? 'active' : '' }}">
<li class="nav-item has-treeview {{ request()->is('admin/*') ? 'menu-open' : '' }}">
<a href="#" class="nav-link {{ request()->is('admin/*') ? 'active' : '' }}">
<i class="nav-icon fas fa-users-cog"></i>
<p>Admin</p>
</a>
</li>
<li class="nav-item">
<a href="/admin/backup" class="nav-link {{ request()->is('admin/backup*') ? 'active' : '' }}">
<i class="nav-icon fas fa-hdd"></i>
<p>Backup</p>
<p>Admin <i class="right fas fa-angle-left" style="font-size: 0.8rem;"></i></p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="/admin/utenti" class="nav-link {{ request()->routeIs('admin.utenti.*') ? 'active' : '' }}">
<i class="nav-icon fas fa-user-shield"></i>
<p>Utenti</p>
</a>
</li>
<li class="nav-item">
<a href="{{ route('admin.ruoli.index') }}" class="nav-link {{ request()->routeIs('admin.ruoli.*') ? 'active' : '' }}">
<i class="nav-icon fas fa-tag"></i>
<p>Ruoli</p>
</a>
</li>
<li class="nav-item">
<a href="/admin/backup" class="nav-link {{ request()->routeIs('admin.backup.*') ? 'active' : '' }}">
<i class="nav-icon fas fa-hdd"></i>
<p>Backup</p>
</a>
</li>
<li class="nav-item">
<a href="{{ route('admin.activity-logs.index') }}" class="nav-link {{ request()->routeIs('admin.activity-logs.*') ? 'active' : '' }}">
<i class="nav-icon fas fa-history"></i>
<p>Log Attività</p>
</a>
</li>
</ul>
</li>
@endif
<li class="nav-item">
<a href="{{ route('help') }}" class="nav-link {{ request()->routeIs('help') ? 'active' : '' }}">
<i class="nav-icon fas fa-question-circle"></i>
<p>Guida / Aiuto</p>
</a>
</li>
</ul>
</nav>
</div>
+3 -3
View File
@@ -56,9 +56,9 @@ Route::middleware('auth')->group(function () {
Route::get('/dashboard', [HomeController::class, 'index'])->name('dashboard')->middleware('auth');
// Help
Route::get('/help', function () {
return view('help.index', ['appName' => \App\Models\AppSetting::getAppName() ?? 'Glastree']);
})->middleware('auth')->name('help');
Route::get('/help', [App\Http\Controllers\HelpController::class, 'index'])->middleware('auth')->name('help');
Route::get('/help/pdf', [App\Http\Controllers\HelpController::class, 'pdf'])->middleware('auth')->name('help.pdf');
Route::get('/help/pdf/download', [App\Http\Controllers\HelpController::class, 'downloadPdf'])->middleware('auth')->name('help.pdf.download');
// Resource routes
// Individui specific routes (MUST be before resource route)
@@ -1,76 +0,0 @@
<?php $__env->startSection('title', $data['title'] ?? 'Report'); ?>
<?php $__env->startSection('page_title', $data['title'] ?? 'Risultato Report'); ?>
<?php $__env->startSection('content'); ?>
<div class="card">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-chart-bar mr-2"></i><?php echo e($data['title'] ?? 'Report'); ?></h3>
<div class="card-tools">
<a href="<?php echo e(route('report.index')); ?>" class="btn btn-sm btn-secondary mr-2">
<i class="fas fa-arrow-left mr-1"></i> Torna ai Report
</a>
<?php
$printParams = isset($report) ? ['custom_id' => $report->id] : ['report' => $reportType ?? ''];
$exportParams = isset($report) ? ['custom_id' => $report->id] : ['report' => $reportType ?? ''];
?>
<a href="<?php echo e(route('report.print-preview', $printParams)); ?>" class="btn btn-sm btn-info mr-2" target="_blank">
<i class="fas fa-print mr-1"></i> Stampa Report
</a>
<a href="<?php echo e(route('report.export', $exportParams)); ?>" class="btn btn-sm btn-success">
<i class="fas fa-file-csv mr-1"></i> Esporta CSV
</a>
</div>
</div>
<div class="card-body">
<?php if(!empty($data['summary'])): ?>
<div class="alert alert-info">
<i class="fas fa-info-circle mr-2"></i>
<strong><?php echo e($data['summary']); ?></strong>
</div>
<?php endif; ?>
<?php if(!empty($data['headers']) && !empty($data['rows'])): ?>
<div class="table-responsive">
<table class="table table-bordered table-striped table-hover">
<thead class="thead-light">
<tr>
<?php $__currentLoopData = $data['headers']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $header): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<th><?php echo e($header); ?></th>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $data['rows']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<?php $__currentLoopData = $row; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cell): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<td><?php echo e(is_array($cell) ? json_encode($cell) : $cell); ?></td>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
<?php else: ?>
<div class="text-center text-muted py-5">
<i class="fas fa-inbox fa-3x mb-3"></i>
<p>Nessun dato disponibile per questo report.</p>
</div>
<?php endif; ?>
</div>
<div class="card-footer">
<div class="row">
<div class="col-md-6">
<a href="<?php echo e(route('report.index')); ?>" class="btn btn-secondary">
<i class="fas fa-arrow-left mr-1"></i> Torna ai Report
</a>
</div>
<div class="col-md-6 text-right">
<small class="text-muted">Generato il <?php echo e(now()->format('d/m/Y H:i:s')); ?></small>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/report/result.blade.php ENDPATH**/ ?>
@@ -1,51 +0,0 @@
<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;
$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames((['frame', 'direction' => 'ltr']));
foreach ($attributes->all() as $__key => $__value) {
if (in_array($__key, $__propNames)) {
$$__key = $$__key ?? $__value;
} else {
$__newAttributes[$__key] = $__value;
}
}
$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);
unset($__propNames);
unset($__newAttributes);
foreach (array_filter((['frame', 'direction' => 'ltr']), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
$$__key = $$__key ?? $__value;
}
$__defined_vars = get_defined_vars();
foreach ($attributes->all() as $__key => $__value) {
if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}
unset($__defined_vars, $__key, $__value); ?>
<?php
$file = $frame->file();
$line = $frame->line();
?>
<div
<?php echo e($attributes->merge(['class' => 'truncate font-mono text-xs text-neutral-500 dark:text-neutral-400'])); ?>
dir="<?php echo e($direction); ?>"
>
<span data-tippy-content="<?php echo e($file); ?>:<?php echo e($line); ?>">
<?php if(config('app.editor')): ?>
<a href="<?php echo e($frame->editorHref()); ?>" @click.stop>
<span class="hover:underline decoration-neutral-400"><?php echo e($file); ?></span><span class="text-neutral-500">:<?php echo e($line); ?></span>
</a>
<?php else: ?>
<?php echo e($file); ?><span class="text-neutral-500">:<?php echo e($line); ?></span>
<?php endif; ?>
</span>
</div>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/file-with-line.blade.php ENDPATH**/ ?>
@@ -1,12 +0,0 @@
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" <?php echo e($attributes); ?>>
<g clip-path="url(#clip0_14732_6211)">
<path d="M1.75 5.25V2.75C1.75 1.922 2.422 1.25 3.25 1.25H4.202C4.808 1.25 5.381 1.525 5.761 1.998L6.364 2.75H8.25C9.355 2.75 10.25 3.645 10.25 4.75V5.25" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M2.46801 5.25H9.53101C10.44 5.25 11.14 6.052 11.017 6.953L10.735 9.021C10.6 10.012 9.75301 10.751 8.75301 10.751H3.24601C2.24601 10.751 1.39901 10.012 1.26401 9.021L0.982011 6.953C0.859011 6.052 1.55901 5.25 2.46801 5.25Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
</g>
<defs>
<clipPath id="clip0_14732_6211">
<rect width="12" height="12" />
</clipPath>
</defs>
</svg>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/icons/folder-open.blade.php ENDPATH**/ ?>

Before

Width:  |  Height:  |  Size: 1.0 KiB

@@ -1,15 +0,0 @@
<svg fill="currentColor" viewBox="0 0 1268 308" xmlns="http://www.w3.org/2000/svg">
<defs>
<path id="a" d="m0 0v-0.49449h1.7215v-4.3497l-1.6849-0.00916v-0.40291c1.3278 0 1.6849-0.22893 1.8131-1.1538h0.43954v5.9155h1.7399v0.49449h-4.0292z"/>
<path id="b" d="m0 0c-1.3186 0-2.1062-1.227-2.1062-3.2965 0-2.0696 0.78752-3.2966 2.1062-3.2966s2.1062 1.227 2.1062 3.2966c0 2.0695-0.78752 3.2965-2.1062 3.2965zm0-3.8918c0.3205 0 0.56774 0.2473 0.56774 0.5678 0 0.3113-0.24724 0.5677-0.56774 0.5677-0.31134 0-0.56775-0.2564-0.56775-0.5677 0-0.3205 0.25641-0.5678 0.56775-0.5678zm0 3.3973c0.99813 0 1.5567-1.0164 1.5567-2.802 0-1.7857-0.55859-2.8021-1.5567-2.8021s-1.5567 1.0164-1.5567 2.8021c0 1.7856 0.55859 2.802 1.5567 2.802z"/>
</defs>
</svg>
<script>
(()=>{
const d="10A212.9A|AB2AB2AB2A212.2AB2AB2AB|6AB3A212.4AB4A|2ABAB3ABA212.AB4AB2A|10A212.3AB4AB|AB2ABAB3A212.AB3AB3A|8ABA212.7ABA|ABAB2AB3A212.2ABAB4A|10A212.6AB2A|2AB2ABAB2A32.9A61.9A73.9A19.AB2AB4A|9AB28.5AB2AB2AB4A3.10A6.25A10.5AB2AB2AB4A4.9A4.9A20.11A9.5AB2AB2AB5A15.7ABA|ABABAB4A25.4ABAB9AB4A.2AB3AB2AB6.2AB2AB2ABAB2AB2ABAB2AB3A7.4ABAB9AB5A.2AB2AB2AB4.2AB2AB2ABA18.2AB2AB2AB2A7.4AB11AB2AB3A12.ABABAB3A|7AB2A23.3AB7ABABABAB3AB8AB3A6.4AB10AB7ABA5.3AB7ABABAB4AB2AB5AB4A5.5AB4A17.7AB2A6.3AB4ABABABABAB10A10.8AB|2AB2AB3AB21.3AB3AB2AB14ABABAB4ABA6.AB4AB2ABABAB4ABAB4A3.3AB3AB2AB8AB7ABAB3AB2A6.AB5ABA16.2ABABAB3A6.2AB3AB13AB2ABAB4A8.2AB3AB2A|10A20.2AB10AB7.ABAB7AB4A6.3AB12AB5AB2A2.2AB10AB7.2ABAB10AB6.3AB6A14.11A4.10AB11.7AB3A7.4AB4A|ABAB2ABABA19.6ABABAB14.3AB2AB3AB2A6.AB3ABAB2A16.6ABABAB14.3AB2ABAB4A7.4ABAB3A13.ABAB2AB2AB4.2ABABABABA15.AB2AB2AB2A6.AB5ABA|10A19.AB2AB5A16.12A6.9AB15.2AB2AB5A16.9AB2A8.AB5AB2A11.10A4.10A17.10A5.3AB2AB2A|2ABABAB3A18.4AB3ABA18.AB2ABAB2ABA6.2ABAB2AB2A15.4AB3ABA18.ABAB2AB3AB8.4AB5A10.2AB2ABABABA4.ABAB2AB3A18.AB2ABAB2A5.AB7A|8ABA17.2AB4AB3A19.10A6.10A15.AB4AB2A20.10A9.AB3AB2ABA9.10A4.9AB27AB5.4AB2ABA|AB2AB5A17.4AB5A20.AB2ABABABA6.AB2ABAB2AB14.4AB5A20.2AB2ABAB2A10.10A7.2ABAB2AB2A5.AB2ABAB4AB2AB2AB2ABAB2ABABABABAB5A4.2AB6A|6ABABA17.AB4AB2AB20.10A6.10A14.2AB4AB2A21.8AB11.ABABAB2AB6.11A5.8AB7AB18AB3A4.4ABAB2A|ABAB6A17.3AB6A20.2ABAB2AB2A6.ABAB2ABABA14.5AB4A20.2ABAB2AB2A11.10A4.2ABAB2ABABA6.2AB2AB4ABABAB3AB2ABAB2AB2AB2AB4ABA4.AB6AB|5AB2ABA18.4AB2AB2A19.10A6.10A15.AB4AB2A20.10A12.2AB2AB2ABA3.10A7.7AB2A33.3AB2AB2A|2AB7A18.AB8A18.2AB2ABABABA6.2AB2AB2ABA15.3AB4ABA18.2AB2ABAB2AB12.11A.2AB2ABAB2A9.ABAB6A32.AB7A|4ABAB3A19.2ABABAB4A15.2AB9A6.10A15.5AB6A15.2AB9A13.ABABAB2AB5AB5AB9.5ABAB3A17.4A10.4AB2ABA|AB6ABA19.8AB4A11.2AB3AB2AB3AB6.ABABABAB2A16.AB4AB2AB3A10.3AB4AB2ABABA14.9ABAB4AB2A11.2AB5AB2A14.3AB5A7.2AB6A|3AB2AB20A3.2AB2AB3AB7A.16AB2A6.10A17.2AB7AB5A2.10AB8A14.3ABAB8AB3A13.4AB8A8.4AB3AB5A5.5ABABA|AB7AB2ABAB2AB2ABAB2ABA5.8ABAB2AB3AB2ABAB2AB2ABAB4A6.2AB2AB2ABA19.2ABAB5AB2AB3AB2ABAB5ABAB2ABA15.6ABAB2AB5A15.4AB2ABAB10AB8ABA7.ABAB5A|4AB2AB11AB7A6.2ABAB9AB11AB5ABA6.10A20.5ABAB15ABAB8A16.AB11ABA17.AB8AB2AB2AB4ABABAB2A9.6AB2A|2AB6ABAB2ABAB5ABAB2A9.8AB2ABABABABA2.5ABAB2A6.ABAB2ABABA22.8AB2ABABABAB3A2.4ABAB2A16.3ABAB2AB2AB2A20.2ABAB8AB2AB7A11.2AB5AB|5ABAB10AB8A12.7AB6A4.AB5AB2A6.10A26.AB12A5.2AB6A17.9AB3A24.2AB2ABAB6ABA15.4ABAB2A",
s=document.currentScript.previousElementSibling,
ns="http://www.w3.org/2000/svg";
const ox=0.32415,oy=7.3223,cw=5.4907,rh=10.0,zx=1.923,zy=0.0915;
d.split("|").forEach((r,ri)=>{const g=document.createElementNS(ns,"g");g.setAttribute("transform","translate(0,"+(oy+ri*rh)+")");let col=0;for(let i=0;i<r.length;i++){let c=r[i],n=1;if(c>="0"&&c<="9"){n=c;while(i+1<r.length&&r[i+1]>="0"&&r[i+1]<="9")n+=r[++i];n=+n;c=r[++i];}if(c==="."){col+=n;continue;}for(let j=0;j<n;j++){const u=document.createElementNS(ns,"use");u.setAttribute("href",c==="A"?"#a":"#b");u.setAttribute("x",ox+col*cw+(c==="B"?zx:0));if(c==="B")u.setAttribute("y",zy);g.appendChild(u);col++;}}s.appendChild(g);});
})();
</script><?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/icons/laravel-ascii.blade.php ENDPATH**/ ?>

Before

Width:  |  Height:  |  Size: 3.9 KiB

@@ -1,37 +0,0 @@
<?php if($paginator->hasPages()): ?>
<div class="ui pagination menu" role="navigation">
<?php if($paginator->onFirstPage()): ?>
<a class="icon item disabled" aria-disabled="true" aria-label="<?php echo app('translator')->get('pagination.previous'); ?>"> <i class="left chevron icon"></i> </a>
<?php else: ?>
<a class="icon item" href="<?php echo e($paginator->previousPageUrl()); ?>" rel="prev" aria-label="<?php echo app('translator')->get('pagination.previous'); ?>"> <i class="left chevron icon"></i> </a>
<?php endif; ?>
<?php $__currentLoopData = $elements; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if(is_string($element)): ?>
<a class="icon item disabled" aria-disabled="true"><?php echo e($element); ?></a>
<?php endif; ?>
<?php if(is_array($element)): ?>
<?php $__currentLoopData = $element; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $page => $url): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if($page == $paginator->currentPage()): ?>
<a class="item active" href="<?php echo e($url); ?>" aria-current="page"><?php echo e($page); ?></a>
<?php else: ?>
<a class="item" href="<?php echo e($url); ?>"><?php echo e($page); ?></a>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php if($paginator->hasMorePages()): ?>
<a class="icon item" href="<?php echo e($paginator->nextPageUrl()); ?>" rel="next" aria-label="<?php echo app('translator')->get('pagination.next'); ?>"> <i class="right chevron icon"></i> </a>
<?php else: ?>
<a class="icon item disabled" aria-disabled="true" aria-label="<?php echo app('translator')->get('pagination.next'); ?>"> <i class="right chevron icon"></i> </a>
<?php endif; ?>
</div>
<?php endif; ?>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/semantic-ui.blade.php ENDPATH**/ ?>
@@ -1,720 +0,0 @@
<?php $__env->startSection('title', 'Modifica Individuo'); ?>
<?php $__env->startSection('page_title', 'Modifica Individuo'); ?>
<?php $__env->startSection('content'); ?>
<form action="/individui/<?php echo e($individuo->id); ?>" method="POST" id="main-form">
<?php echo csrf_field(); ?>
<?php echo method_field('PUT'); ?>
<input type="hidden" name="individuo_id" value="<?php echo e($individuo->id); ?>">
<input type="hidden" name="_avatar_token" value="<?php echo e(csrf_token()); ?>">
<div class="row">
<div class="col-md-6">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-user mr-2"></i>Dati Anagrafici</h3>
</div>
<div class="card-body">
<div class="form-group">
<label>Codice ID</label>
<input type="text" class="form-control" value="<?php echo e($individuo->codice_id); ?>" disabled>
</div>
<div class="form-group">
<label>Cognome *</label>
<input type="text" name="cognome" class="form-control" value="<?php echo e($individuo->cognome); ?>" required>
</div>
<div class="form-group">
<label>Nome *</label>
<input type="text" name="nome" class="form-control" value="<?php echo e($individuo->nome); ?>" required>
</div>
<div class="form-group">
<label>Data di nascita</label>
<input type="date" name="data_nascita" class="form-control" value="<?php echo e($individuo->data_nascita?->format('Y-m-d')); ?>">
</div>
<div class="form-group">
<label>Genere</label>
<select name="genere" class="form-control">
<option value="">Seleziona...</option>
<option value="M" <?php echo e($individuo->genere === 'M' ? 'selected' : ''); ?>>Maschio</option>
<option value="F" <?php echo e($individuo->genere === 'F' ? 'selected' : ''); ?>>Femmina</option>
</select>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card card-secondary">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-camera mr-2"></i>Avatar</h3>
</div>
<div class="card-body text-center">
<?php if($individuo->avatar): ?>
<img src="/individui/<?php echo e($individuo->id); ?>/avatar"
alt="Avatar"
class="img-thumbnail mb-2"
style="max-width: 120px; max-height: 120px; object-fit: cover; border-radius: 50%;">
<br>
<button type="button" class="btn btn-danger btn-sm" onclick="deleteAvatar()">
<i class="fas fa-trash mr-1"></i>Rimuovi
</button>
<?php else: ?>
<div class="bg-secondary d-flex align-items-center justify-content-center mb-3"
style="width: 120px; height: 120px; margin: 0 auto; border-radius: 50%;">
<i class="fas fa-user fa-4x text-white"></i>
</div>
<?php endif; ?>
<div class="custom-file mb-2">
<input type="file" class="custom-file-input" id="avatar-input" name="avatar" accept="image/jpeg,image/png,image/gif">
<label class="custom-file-label" for="avatar-input">Scegli immagine...</label>
</div>
<button type="button" class="btn btn-primary btn-sm" onclick="uploadAvatar()">
<i class="fas fa-upload mr-1"></i>Carica Avatar
</button>
<div id="avatar-message" class="mt-2"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="card">
<div class="card-header"><h3 class="card-title"><i class="fas fa-map-marker-alt mr-2"></i>Residenza</h3></div>
<div class="card-body">
<div class="form-group">
<label>Indirizzo</label>
<input type="text" name="indirizzo" class="form-control" value="<?php echo e($individuo->indirizzo); ?>">
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label>CAP</label>
<input type="text" name="cap" class="form-control" value="<?php echo e($individuo->cap); ?>">
</div>
<div class="form-group col-md-5">
<label>Città</label>
<input type="text" name="città" class="form-control" value="<?php echo e($individuo->città); ?>">
</div>
<div class="form-group col-md-3">
<label>Provincia</label>
<input type="text" name="sigla_provincia" class="form-control" maxlength="2" value="<?php echo e($individuo->sigla_provincia); ?>">
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-header"><h3 class="card-title"><i class="fas fa-id-card mr-2"></i>Documento di identità</h3></div>
<div class="card-body">
<div class="form-group">
<label>Tipo documento</label>
<select name="tipo_documento" class="form-control">
<option value="">Seleziona...</option>
<option value="carta_identita" <?php echo e($individuo->tipo_documento === 'carta_identita' ? 'selected' : ''); ?>>Carta d'Identità</option>
<option value="patente" <?php echo e($individuo->tipo_documento === 'patente' ? 'selected' : ''); ?>>Patente</option>
</select>
</div>
<div class="form-group">
<label>Numero documento</label>
<input type="text" name="numero_documento" class="form-control" value="<?php echo e($individuo->numero_documento); ?>">
</div>
<div class="form-group">
<label>Scadenza documento</label>
<input type="date" name="scadenza_documento" class="form-control" value="<?php echo e($individuo->scadenza_documento?->format('Y-m-d')); ?>">
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="card">
<div class="card-header"><h3 class="card-title"><i class="fas fa-sticky-note mr-2"></i>Note</h3></div>
<div class="card-body">
<div class="form-group mb-0">
<textarea name="note" class="form-control" rows="4"><?php echo e($individuo->note); ?></textarea>
</div>
</div>
</div>
</div>
</div>
<div class="card mt-3">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-address-book mr-2"></i>Contatti</h3>
<button type="button" class="btn btn-xs btn-success float-right" onclick="aggiungiRigaContatto()">
<i class="fas fa-plus mr-1"></i> Aggiungi
</button>
</div>
<div class="card-body p-0">
<table class="table table-bordered mb-0" id="contatti-table">
<thead class="thead-light">
<tr>
<th style="width: 20%;">Tipo</th>
<th style="width: 30%;">Valore</th>
<th style="width: 20%;">Etichetta</th>
<th style="width: 10%;">Primario</th>
<th style="width: 50px;"></th>
</tr>
</thead>
<tbody id="contatti-tbody">
<?php $__currentLoopData = $individuo->contatti; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $contatto): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td>
<select name="contatti[<?php echo e($loop->index); ?>][tipo]" class="form-control">
<option value="telefono" <?php echo e($contatto->tipo === 'telefono' ? 'selected' : ''); ?>>Telefono</option>
<option value="cellulare" <?php echo e($contatto->tipo === 'cellulare' ? 'selected' : ''); ?>>Cellulare</option>
<option value="email" <?php echo e($contatto->tipo === 'email' ? 'selected' : ''); ?>>Email</option>
<option value="fax" <?php echo e($contatto->tipo === 'fax' ? 'selected' : ''); ?>>Fax</option>
<option value="web" <?php echo e($contatto->tipo === 'web' ? 'selected' : ''); ?>>Web</option>
<option value="telegram" <?php echo e($contatto->tipo === 'telegram' ? 'selected' : ''); ?>>Telegram</option>
<option value="whatsapp" <?php echo e($contatto->tipo === 'whatsapp' ? 'selected' : ''); ?>>WhatsApp</option>
<option value="altro" <?php echo e($contatto->tipo === 'altro' ? 'selected' : ''); ?>>Altro</option>
</select>
</td>
<td><input type="text" name="contatti[<?php echo e($loop->index); ?>][valore]" class="form-control" value="<?php echo e($contatto->valore); ?>"></td>
<td><input type="text" name="contatti[<?php echo e($loop->index); ?>][etichetta]" class="form-control" value="<?php echo e($contatto->etichetta); ?>"></td>
<td class="text-center"><input type="checkbox" name="contatti[<?php echo e($loop->index); ?>][is_primary]" value="1" <?php echo e($contatto->is_primary ? 'checked' : ''); ?>></td>
<td><button type="button" class="btn btn-danger btn-xs" onclick="this.closest('tr').remove()"><i class="fas fa-trash"></i></button></td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
<?php if($individuo->contatti->isEmpty()): ?>
<div id="no-contatti-msg" class="text-center text-muted py-4">
<p class="mb-0">Nessun contatto. Clicca su "Aggiungi" per aggiungerne uno.</p>
</div>
<?php endif; ?>
</div>
</div>
</div>
<div class="card mt-3">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-folder mr-2"></i>Gruppi</h3>
<button type="button" class="btn btn-xs btn-success float-right" onclick="showGruppoForm()">
<i class="fas fa-plus mr-1"></i> Aggiungi
</button>
</div>
<div class="card-body p-0">
<?php if($individuo->gruppi->count() > 0): ?>
<table class="table table-bordered table-hover table-striped mb-0">
<thead class="thead-light">
<tr>
<th>Nome</th>
<th>Diocesi</th>
<th style="width: 130px;">Ruolo</th>
<th style="width: 110px;">Data Adesione</th>
<th style="width: 80px;">Azioni</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $individuo->gruppi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $gruppo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr id="gruppo-row-<?php echo e($gruppo->id); ?>">
<td>
<i class="fas fa-folder text-warning mr-1"></i>
<a href="/gruppi/<?php echo e($gruppo->id); ?>"><?php echo e($gruppo->nome); ?></a>
</td>
<td><?php echo e($gruppo->diocesi?->nome ?: '-'); ?></td>
<td>
<?php $ruoliIndividuo = $individuo->getRuoliForGruppo($gruppo->id) ?>
<?php if($ruoliIndividuo->count() > 0): ?>
<?php $__currentLoopData = $ruoliIndividuo; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ruolo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<span class="badge badge-info mr-1"><?php echo e($ruolo->nome); ?></span>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php else: ?>
-
<?php endif; ?>
</td>
<td><?php echo e($gruppo->pivot->data_adesione ? \Carbon\Carbon::parse($gruppo->pivot->data_adesione)->format('d/m/Y') : '-'); ?></td>
<td>
<button type="button" class="btn btn-xs btn-warning" onclick="editGruppoInline(<?php echo e($gruppo->id); ?>)" title="Modifica">
<i class="fas fa-edit"></i>
</button>
<form action="/individui/<?php echo e($individuo->id); ?>/gruppi/<?php echo e($gruppo->id); ?>" method="POST" class="mb-0">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Rimuovere da questo gruppo?')" title="Rimuovi">
<i class="fas fa-trash"></i>
</button>
</form>
</td>
</tr>
<tr id="gruppo-edit-<?php echo e($gruppo->id); ?>" style="display:none;">
<td colspan="5">
<form action="/individui/<?php echo e($individuo->id); ?>/gruppi/<?php echo e($gruppo->id); ?>" method="POST" class="mb-0">
<?php echo csrf_field(); ?> <?php echo method_field('PUT'); ?>
<div class="row">
<div class="col-md-4">
<input type="text" class="form-control form-control-sm" value="<?php echo e($gruppo->nome); ?>" disabled>
</div>
<div class="col-md-3">
<select name="ruolo_ids[]" class="form-control form-control-sm" multiple size="3">
<?php $selectedRuoliIds = $individuo->getRuoloIdsForGruppo($gruppo->id) ?>
<?php $__currentLoopData = \App\Models\Ruolo::attive(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ruolo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($ruolo->id); ?>" <?php echo e(in_array($ruolo->id, $selectedRuoliIds) ? 'selected' : ''); ?>><?php echo e($ruolo->nome); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<div class="col-md-3">
<input type="date" name="data_adesione" class="form-control form-control-sm" value="<?php echo e($gruppo->pivot->data_adesione); ?>">
</div>
<div class="col-md-2">
<button type="submit" class="btn btn-xs btn-success"><i class="fas fa-check mr-1"></i>Salva</button>
<button type="button" class="btn btn-xs btn-secondary" onclick="cancelEditGruppo(<?php echo e($gruppo->id); ?>)"><i class="fas fa-times"></i></button>
</div>
</div>
</form>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
<?php else: ?>
<div class="text-center text-muted py-4">
<i class="fas fa-users fa-2x mb-2"></i>
<p class="mb-0">Nessun gruppo associato</p>
</div>
<?php endif; ?>
</div>
</div>
<div class="card mt-3">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-file mr-2"></i>Documenti</h3>
<button type="button" class="btn btn-xs btn-success float-right" onclick="showDocumentoForm()">
<i class="fas fa-plus mr-1"></i> Carica
</button>
</div>
<div class="card-body p-0">
<div id="documento-add-form" style="display:none;" class="p-3 bg-light border-bottom">
<form action="/documenti" method="POST" enctype="multipart/form-data" class="mb-0">
<?php echo csrf_field(); ?>
<input type="hidden" name="_redirect" value="<?php echo e(url()->current()); ?>">
<input type="hidden" name="visibilita" value="individuo">
<input type="hidden" name="visibilita_target_id" value="<?php echo e($individuo->id); ?>">
<input type="hidden" name="visibilita_target_type" value="App\Models\Individuo">
<div class="row">
<div class="col-md-3">
<input type="text" name="nome_file" class="form-control form-control-sm" placeholder="Nome documento" required>
</div>
<div class="col-md-3">
<select name="tipologia" class="form-control form-control-sm" required>
<option value="">Tipologia...</option>
<option value="documento">Documento</option>
<option value="avatar">Avatar</option>
<option value="galleria">Galleria</option>
<option value="statuto">Statuto</option>
<option value="altro">Altro</option>
</select>
</div>
<div class="col-md-4">
<input type="file" name="file" class="form-control form-control-sm" required>
</div>
<div class="col-md-2">
<button type="submit" class="btn btn-xs btn-success"><i class="fas fa-upload mr-1"></i>Carica</button>
<button type="button" class="btn btn-xs btn-secondary" onclick="hideDocumentoForm()"><i class="fas fa-times"></i></button>
</div>
</div>
</form>
</div>
<?php if($individuo->documenti->count() > 0): ?>
<table class="table table-bordered table-hover table-striped mb-0">
<thead class="thead-light">
<tr>
<th>Nome</th>
<th style="width: 120px;">Tipologia</th>
<th style="width: 80px;">Dimensione</th>
<th style="width: 130px;">Data Upload</th>
<th style="width: 80px;">Azioni</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $individuo->documenti; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $documento): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td>
<a href="#" onclick="event.preventDefault(); previewDocumento(<?php echo e($documento->id); ?>, '<?php echo e($documento->mime_type); ?>');">
<i class="fas fa-file text-secondary mr-1"></i>
<?php echo e($documento->nome_file); ?>
</a>
</td>
<td><?php echo e(ucfirst(str_replace('_', ' ', $documento->tipologia))); ?></td>
<td><?php echo e(number_format($documento->dimensione / 1024, 1)); ?> KB</td>
<td><?php echo e($documento->created_at->format('d/m/Y')); ?></td>
<td>
<?php if($documento->file_path): ?>
<button type="button" class="btn btn-xs btn-primary" onclick="previewDocumento(<?php echo e($documento->id); ?>, '<?php echo e($documento->mime_type); ?>')" title="Anteprima">
<i class="fas fa-eye"></i>
</button>
<?php endif; ?>
<form action="/documenti/<?php echo e($documento->id); ?>" method="POST" class="d-inline">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Eliminare questo documento?')" title="Elimina">
<i class="fas fa-trash"></i>
</button>
</form>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
<?php else: ?>
<div class="text-center text-muted py-4">
<i class="fas fa-file fa-2x mb-2"></i>
<p class="mb-0">Nessun documento</p>
</div>
<?php endif; ?>
</div>
</div>
<div class="mt-3 mb-4">
<button type="button" class="btn btn-success btn-lg" id="save-all-btn" onclick="submitMainForm()">
<i class="fas fa-save mr-2"></i> Salva Tutte le Modifiche
</button>
<a href="/individui/<?php echo e($individuo->id); ?>" class="btn btn-secondary btn-lg ml-2">
<i class="fas fa-times mr-1"></i> Annulla
</a>
</div>
</form>
<div class="card mt-3" id="gruppo-add-card" style="display:none; background-color: #fff3cd; border-color: #ffc107;">
<div class="card-header bg-warning">
<h3 class="card-title"><i class="fas fa-folder-plus mr-2"></i>Aggiungi a Gruppo</h3>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-4">
<select id="new-gruppo-id" class="form-control form-control-sm">
<option value="">Seleziona gruppo...</option>
<?php $__currentLoopData = \App\Models\Gruppo::orderBy('nome')->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $g): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if(!$individuo->gruppi->contains($g->id)): ?>
<option value="<?php echo e($g->id); ?>"><?php echo e($g->full_path); ?></option>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<div class="col-md-3">
<select id="new-gruppo-ruolo" class="form-control form-control-sm" multiple size="3">
<?php $__currentLoopData = \App\Models\Ruolo::attive(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ruolo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($ruolo->id); ?>"><?php echo e($ruolo->nome); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<small class="text-muted">Ctrl+click per selezionare più ruoli</small>
</div>
<div class="col-md-3">
<input type="date" id="new-gruppo-data" class="form-control form-control-sm">
</div>
<div class="col-md-2">
<button type="button" class="btn btn-success btn-sm" onclick="submitGruppoForm()">
<i class="fas fa-check mr-1"></i> Associa
</button>
<button type="button" class="btn btn-secondary btn-sm" onclick="hideGruppoForm()">
<i class="fas fa-times"></i>
</button>
</div>
</div>
</div>
<div class="modal fade" id="previewModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document" style="max-width: 90vw;">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-file mr-2"></i><span id="previewModalTitle">Anteprima</span></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Chiudi">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body text-center p-0" style="min-height: 400px;">
<iframe id="previewFrame" src="" style="width: 100%; height: 70vh; border: none;"></iframe>
</div>
<div class="modal-footer">
<a id="previewDownloadBtn" href="#" class="btn btn-primary" download>
<i class="fas fa-download mr-1"></i> Scarica
</a>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Chiudi</button>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script>
document.addEventListener('DOMContentLoaded', function() {
console.log('All form fields:');
var form = document.getElementById('main-form');
var fields = form.querySelectorAll('input, textarea, select');
fields.forEach(function(f) {
console.log(f.name + ' [' + f.type + ']: value="' + f.value.substring(0,30) + '" disabled=' + f.disabled);
});
// Debug note field specifically
var noteField = form.querySelector('[name="note"]');
console.log('Note field found:', !!noteField);
if (noteField) {
console.log('Note value:', noteField.value);
}
var saveBtn = document.getElementById('save-btn');
if (saveBtn) {
saveBtn.addEventListener('click', function() {
console.log('=== SAVE CLICKED ===');
var note = form.querySelector('[name="note"]');
console.log('Note at save time:', note ? note.value : 'NOT FOUND');
});
}
form.addEventListener('submit', function(e) {
console.log('=== FORM SUBMIT ===');
var note = form.querySelector('[name="note"]');
console.log('Note at submit:', note ? note.value : 'NOT FOUND');
var contattiFields = form.querySelectorAll('[name^="contatti"]');
console.log('Contatti fields count:', contattiFields.length);
contattiFields.forEach(function(f, i) {
console.log('Contatto field ' + i + ':', f.name, '=', f.value);
});
var formData = new FormData(form);
console.log('FormData contatti:', formData.getAll('contatti'));
});
});
</script>
<script>
function submitMainForm() {
var form = document.getElementById('main-form');
console.log('=== DEBUG SUBMIT ===');
var contattiFields = form.querySelectorAll('[name^="contatti"]');
console.log('Contatti fields found:', contattiFields.length);
contattiFields.forEach(function(f, i) {
console.log('Field ' + i + ': name=' + f.name + ', value=' + f.value);
});
form.action = '/individui/<?php echo e($individuo->id); ?>';
var methodInput = form.querySelector('input[name="_method"]');
if (!methodInput) {
var m = document.createElement('input');
m.type = 'hidden';
m.name = '_method';
m.value = 'PUT';
form.appendChild(m);
}
var csrfInput = form.querySelector('input[name="_token"]');
if (!csrfInput) {
var c = document.createElement('input');
c.type = 'hidden';
c.name = '_token';
c.value = '<?php echo e(csrf_token()); ?>';
form.appendChild(c);
}
var formData = new FormData(form);
console.log('FormData contatti keys:');
for (var pair of formData.entries()) {
if (pair[0].startsWith('contatti')) {
console.log(' ' + pair[0] + ' = ' + pair[1]);
}
}
form.submit();
}
let contattoIndex = <?php echo e($individuo->contatti->count()); ?>;
function aggiungiRigaContatto() {
const tbody = document.getElementById('contatti-tbody');
const noMsg = document.getElementById('no-contatti-msg');
if (noMsg) noMsg.style.display = 'none';
const row = document.createElement('tr');
row.innerHTML = `
<td>
<select name="contatti[${contattoIndex}][tipo]" class="form-control">
<option value="">Seleziona...</option>
<option value="telefono">Telefono</option>
<option value="cellulare">Cellulare</option>
<option value="email">Email</option>
<option value="fax">Fax</option>
<option value="web">Web</option>
<option value="telegram">Telegram</option>
<option value="whatsapp">WhatsApp</option>
<option value="altro">Altro</option>
</select>
</td>
<td><input type="text" name="contatti[${contattoIndex}][valore]" class="form-control" placeholder="Valore"></td>
<td><input type="text" name="contatti[${contattoIndex}][etichetta]" class="form-control" placeholder="Etichetta"></td>
<td class="text-center"><input type="checkbox" name="contatti[${contattoIndex}][is_primary]" value="1"></td>
<td>
<button type="button" class="btn btn-success btn-xs" title="Salva" onclick="submitMainForm()">
<i class="fas fa-save"></i>
</button>
<button type="button" class="btn btn-danger btn-xs" title="Elimina" onclick="this.closest('tr').remove()">
<i class="fas fa-trash"></i>
</button>
</td>
`;
tbody.appendChild(row);
contattoIndex++;
}
function showGruppoForm() {
var card = document.getElementById('gruppo-add-card');
if (card) {
card.style.display = 'block';
card.scrollIntoView({ behavior: 'smooth', block: 'start' });
}
}
function hideGruppoForm() {
var card = document.getElementById('gruppo-add-card');
if (card) {
card.style.display = 'none';
}
}
function submitGruppoForm() {
var gruppoId = document.getElementById('new-gruppo-id').value;
var ruoloSelect = document.getElementById('new-gruppo-ruolo');
var dataAdesione = document.getElementById('new-gruppo-data').value;
if (!gruppoId) {
alert('Seleziona un gruppo');
return;
}
var formData = new URLSearchParams();
formData.append('gruppo_id', gruppoId);
var selectedRuoli = Array.from(ruoloSelect.selectedOptions).map(opt => opt.value).filter(v => v);
selectedRuoli.forEach(function(ruoloId) {
formData.append('ruolo_ids[]', ruoloId);
});
formData.append('data_adesione', dataAdesione);
fetch('/individui/<?php echo e($individuo->id); ?>/gruppi', {
method: 'POST',
headers: {
'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>',
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: formData
})
.then(response => {
if (!response.ok) {
return response.text().then(text => { throw new Error(text); });
}
return response.json();
})
.then(data => {
if (data.success) {
hideGruppoForm();
window.location.reload();
} else {
alert(data.error || 'Errore');
}
})
.catch(error => {
alert('Errore: ' + error.message);
});
}
function editGruppoInline(id) {
document.getElementById('gruppo-row-' + id).style.display = 'none';
document.getElementById('gruppo-edit-' + id).style.display = 'table-row';
}
function cancelEditGruppo(id) {
document.getElementById('gruppo-row-' + id).style.display = 'table-row';
document.getElementById('gruppo-edit-' + id).style.display = 'none';
}
function showDocumentoForm() {
document.getElementById('documento-add-form').style.display = 'block';
}
function hideDocumentoForm() {
document.getElementById('documento-add-form').style.display = 'none';
}
function previewDocumento(id, mimeType) {
var previewUrl = '/documenti/' + id + '/preview';
var downloadUrl = '/documenti/' + id + '/download';
document.getElementById('previewFrame').src = previewUrl;
document.getElementById('previewDownloadBtn').href = downloadUrl;
document.getElementById('previewModalTitle').textContent = 'Anteprima';
if (mimeType && mimeType.startsWith('image/')) {
document.getElementById('previewDownloadBtn').style.display = 'inline-block';
} else {
document.getElementById('previewDownloadBtn').style.display = 'none';
}
$('#previewModal').modal('show');
}
document.getElementById('avatar-input').addEventListener('change', function(e) {
var fileName = e.target.files[0]?.name || 'Scegli file...';
e.target.nextElementSibling.textContent = fileName;
});
function uploadAvatar() {
var input = document.getElementById('avatar-input');
if (!input.files[0]) {
document.getElementById('avatar-message').innerHTML = '<span class="text-danger">Seleziona un\'immagine</span>';
return;
}
var formData = new FormData();
formData.append('avatar', input.files[0]);
formData.append('_token', '<?php echo e(csrf_token()); ?>');
document.getElementById('avatar-message').innerHTML = '<span class="text-info"><i class="fas fa-spinner fa-spin"></i> Caricamento...</span>';
fetch('/individui/<?php echo e($individuo->id); ?>/avatar', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => {
if (data.success) {
document.getElementById('avatar-message').innerHTML = '<span class="text-success">Avatar caricato!</span>';
setTimeout(function() { window.location.reload(); }, 500);
} else {
document.getElementById('avatar-message').innerHTML = '<span class="text-danger">' + (data.message || 'Errore') + '</span>';
}
})
.catch(error => {
document.getElementById('avatar-message').innerHTML = '<span class="text-danger">Errore: ' + error + '</span>';
});
}
function deleteAvatar() {
if (!confirm('Rimuovere l\'avatar?')) return;
fetch('/individui/<?php echo e($individuo->id); ?>/avatar', {
method: 'DELETE',
headers: {
'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>',
'Accept': 'application/json'
}
})
.then(response => response.json())
.then(data => {
if (data.success) {
window.location.reload();
} else {
alert(data.message || 'Errore');
}
})
.catch(error => {
alert('Errore: ' + error);
});
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/individui/edit.blade.php ENDPATH**/ ?>
@@ -1,374 +0,0 @@
<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;
$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames((['queries']));
foreach ($attributes->all() as $__key => $__value) {
if (in_array($__key, $__propNames)) {
$$__key = $$__key ?? $__value;
} else {
$__newAttributes[$__key] = $__value;
}
}
$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);
unset($__propNames);
unset($__newAttributes);
foreach (array_filter((['queries']), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
$$__key = $$__key ?? $__value;
}
$__defined_vars = get_defined_vars();
foreach ($attributes->all() as $__key => $__value) {
if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}
unset($__defined_vars, $__key, $__value); ?>
<div
<?php echo e($attributes->merge(['class' => "flex flex-col gap-2.5 bg-neutral-50 dark:bg-white/1 border border-neutral-200 dark:border-neutral-800 rounded-xl p-2.5 shadow-xs"])); ?>
x-data="{
totalQueries: <?php echo e(min(count($queries), 100)); ?>,
currentPage: 1,
perPage: 10,
get totalPages() {
return Math.ceil(this.totalQueries / this.perPage);
},
get hasPrevious() {
return this.currentPage > 1;
},
get hasNext() {
return this.currentPage < this.totalPages;
},
goToPage(page) {
if (page >= 1 && page <= this.totalPages) {
this.currentPage = page;
}
},
first() {
this.currentPage = 1;
},
last() {
this.currentPage = this.totalPages;
},
previous() {
if (this.hasPrevious) {
this.currentPage--;
}
},
next() {
if (this.hasNext) {
this.currentPage++;
}
},
get visiblePages() {
const total = this.totalPages;
const current = this.currentPage;
const pages = [];
if (total <= 7) {
for (let i = 1; i <= total; i++) {
pages.push({ type: 'page', value: i });
}
} else {
if (current <= 4) {
for (let i = 1; i <= 5; i++) {
pages.push({ type: 'page', value: i });
}
if (total > 6) {
pages.push({ type: 'ellipsis', value: '...', id: 'end' });
pages.push({ type: 'page', value: total });
}
} else if (current > total - 4) {
pages.push({ type: 'page', value: 1 });
if (total > 6) {
pages.push({ type: 'ellipsis', value: '...', id: 'start' });
}
for (let i = Math.max(total - 4, 2); i <= total; i++) {
pages.push({ type: 'page', value: i });
}
} else {
pages.push({ type: 'page', value: 1 });
pages.push({ type: 'ellipsis', value: '...', id: 'start' });
for (let i = current - 1; i <= current + 1; i++) {
pages.push({ type: 'page', value: i });
}
pages.push({ type: 'ellipsis', value: '...', id: 'end' });
pages.push({ type: 'page', value: total });
}
}
return pages;
}
}"
>
<div class="flex items-center justify-between p-2">
<div class="flex items-center gap-2.5">
<div class="bg-white dark:bg-neutral-800 border border-neutral-200 dark:border-white/5 rounded-md w-6 h-6 flex items-center justify-center p-1">
<?php if (isset($component)) { $__componentOriginal9e277ab5ada333d718192209049fcff4 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9e277ab5ada333d718192209049fcff4 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.icons.database','data' => ['class' => 'w-2.5 h-2.5 text-blue-500 dark:text-emerald-500']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::icons.database'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'w-2.5 h-2.5 text-blue-500 dark:text-emerald-500']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9e277ab5ada333d718192209049fcff4)): ?>
<?php $attributes = $__attributesOriginal9e277ab5ada333d718192209049fcff4; ?>
<?php unset($__attributesOriginal9e277ab5ada333d718192209049fcff4); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9e277ab5ada333d718192209049fcff4)): ?>
<?php $component = $__componentOriginal9e277ab5ada333d718192209049fcff4; ?>
<?php unset($__componentOriginal9e277ab5ada333d718192209049fcff4); ?>
<?php endif; ?>
</div>
<h3 class="text-base font-semibold">Queries</h3>
</div>
<div x-show="totalQueries > 0" class="text-sm text-neutral-500 dark:text-neutral-400 flex items-center gap-2">
<span x-text="`${((currentPage - 1) * perPage) + 1}-${Math.min(currentPage * perPage, totalQueries)} of ${totalQueries}`"></span>
<?php if(count($queries) > 100): ?>
<?php if (isset($component)) { $__componentOriginalc6e888149e09c77971305ebbddaee753 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalc6e888149e09c77971305ebbddaee753 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.icons.info','data' => ['class' => 'w-3 h-3 text-blue-500 dark:text-emerald-500','dataTippyContent' => 'Only the first 100 queries are shown']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::icons.info'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'w-3 h-3 text-blue-500 dark:text-emerald-500','data-tippy-content' => 'Only the first 100 queries are shown']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalc6e888149e09c77971305ebbddaee753)): ?>
<?php $attributes = $__attributesOriginalc6e888149e09c77971305ebbddaee753; ?>
<?php unset($__attributesOriginalc6e888149e09c77971305ebbddaee753); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc6e888149e09c77971305ebbddaee753)): ?>
<?php $component = $__componentOriginalc6e888149e09c77971305ebbddaee753; ?>
<?php unset($__componentOriginalc6e888149e09c77971305ebbddaee753); ?>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
<div class="flex flex-col gap-1">
<?php $__empty_1 = true; $__currentLoopData = array_slice($queries, 0, 100); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => ['connectionName' => $connectionName, 'sql' => $sql, 'time' => $time]): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<div
class="border border-neutral-200 dark:border-none bg-white dark:bg-white/[3%] rounded-md h-10 flex items-center justify-between gap-4 px-4 text-xs font-mono shadow-xs"
x-show="Math.floor(<?php echo e($index); ?> / perPage) === (currentPage - 1)"
>
<div class="flex items-center gap-2 truncate">
<div class="flex items-center gap-2">
<?php if (isset($component)) { $__componentOriginal9e277ab5ada333d718192209049fcff4 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9e277ab5ada333d718192209049fcff4 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.icons.database','data' => ['class' => 'w-3 h-3 text-neutral-500 dark:text-neutral-400']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::icons.database'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'w-3 h-3 text-neutral-500 dark:text-neutral-400']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9e277ab5ada333d718192209049fcff4)): ?>
<?php $attributes = $__attributesOriginal9e277ab5ada333d718192209049fcff4; ?>
<?php unset($__attributesOriginal9e277ab5ada333d718192209049fcff4); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9e277ab5ada333d718192209049fcff4)): ?>
<?php $component = $__componentOriginal9e277ab5ada333d718192209049fcff4; ?>
<?php unset($__componentOriginal9e277ab5ada333d718192209049fcff4); ?>
<?php endif; ?>
<span class="text-neutral-500 dark:text-neutral-400"><?php echo e($connectionName); ?></span>
</div>
<?php if (isset($component)) { $__componentOriginal12cb286571f553eebcbe98210b217f94 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal12cb286571f553eebcbe98210b217f94 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.syntax-highlight','data' => ['code' => $sql,'language' => 'sql','truncate' => true,'class' => 'min-w-0','dataTippyContent' => ''.e(nl2br($sql)).'']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::syntax-highlight'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['code' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($sql),'language' => 'sql','truncate' => true,'class' => 'min-w-0','data-tippy-content' => ''.e(nl2br($sql)).'']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal12cb286571f553eebcbe98210b217f94)): ?>
<?php $attributes = $__attributesOriginal12cb286571f553eebcbe98210b217f94; ?>
<?php unset($__attributesOriginal12cb286571f553eebcbe98210b217f94); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal12cb286571f553eebcbe98210b217f94)): ?>
<?php $component = $__componentOriginal12cb286571f553eebcbe98210b217f94; ?>
<?php unset($__componentOriginal12cb286571f553eebcbe98210b217f94); ?>
<?php endif; ?>
</div>
<div class="text-neutral-500 dark:text-neutral-200 text-right flex-shrink-0"><?php echo e($time); ?>ms</div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<?php if (isset($component)) { $__componentOriginal612ffe32146e3bd2ac6ba6076cca9520 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal612ffe32146e3bd2ac6ba6076cca9520 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.empty-state','data' => ['message' => 'No queries executed']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::empty-state'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['message' => 'No queries executed']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal612ffe32146e3bd2ac6ba6076cca9520)): ?>
<?php $attributes = $__attributesOriginal612ffe32146e3bd2ac6ba6076cca9520; ?>
<?php unset($__attributesOriginal612ffe32146e3bd2ac6ba6076cca9520); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal612ffe32146e3bd2ac6ba6076cca9520)): ?>
<?php $component = $__componentOriginal612ffe32146e3bd2ac6ba6076cca9520; ?>
<?php unset($__componentOriginal612ffe32146e3bd2ac6ba6076cca9520); ?>
<?php endif; ?>
<?php endif; ?>
</div>
<!-- Pagination Controls -->
<div x-cloak x-show="totalPages > 1" class="flex items-center justify-center gap-1 py-4 font-mono">
<!-- First Button -->
<button
@click="first()"
class="cursor-pointer flex items-center justify-center w-8 h-8 rounded-md transition-colors"
:disabled="!hasPrevious"
:class="hasPrevious ? 'text-neutral-500 dark:text-neutral-300 hover:bg-neutral-200 hover:dark:text-white hover:dark:bg-white/5' : 'text-neutral-600 cursor-not-allowed!'"
>
<?php if (isset($component)) { $__componentOriginal935198b948cf7048e898f42ce9f720b5 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal935198b948cf7048e898f42ce9f720b5 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.icons.chevrons-left','data' => ['class' => 'w-3 h-3']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::icons.chevrons-left'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'w-3 h-3']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal935198b948cf7048e898f42ce9f720b5)): ?>
<?php $attributes = $__attributesOriginal935198b948cf7048e898f42ce9f720b5; ?>
<?php unset($__attributesOriginal935198b948cf7048e898f42ce9f720b5); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal935198b948cf7048e898f42ce9f720b5)): ?>
<?php $component = $__componentOriginal935198b948cf7048e898f42ce9f720b5; ?>
<?php unset($__componentOriginal935198b948cf7048e898f42ce9f720b5); ?>
<?php endif; ?>
</button>
<!-- Previous Button -->
<button
@click="previous()"
class="cursor-pointer flex items-center justify-center w-8 h-8 rounded-md transition-colors"
:class="hasPrevious ? 'text-neutral-500 dark:text-neutral-300 hover:bg-neutral-200 hover:dark:text-white hover:dark:bg-white/5' : 'text-neutral-600 cursor-not-allowed!'"
:disabled="!hasPrevious"
>
<?php if (isset($component)) { $__componentOriginalb1a2603ab360710208f4e8402894d933 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalb1a2603ab360710208f4e8402894d933 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.icons.chevron-left','data' => ['class' => 'w-3 h-3']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::icons.chevron-left'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'w-3 h-3']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalb1a2603ab360710208f4e8402894d933)): ?>
<?php $attributes = $__attributesOriginalb1a2603ab360710208f4e8402894d933; ?>
<?php unset($__attributesOriginalb1a2603ab360710208f4e8402894d933); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalb1a2603ab360710208f4e8402894d933)): ?>
<?php $component = $__componentOriginalb1a2603ab360710208f4e8402894d933; ?>
<?php unset($__componentOriginalb1a2603ab360710208f4e8402894d933); ?>
<?php endif; ?>
</button>
<!-- Page Numbers -->
<template x-for="(page, index) in visiblePages" :key="`page-${page.type}-${page.value}-${page.id || index}`">
<div>
<template x-if="page.type === 'ellipsis'">
<span class="flex items-center justify-center w-8 h-8 text-neutral-500">...</span>
</template>
<template x-if="page.type === 'page'">
<button
@click="goToPage(page.value)"
class="cursor-pointer flex items-center justify-center w-8 h-8 rounded-md text-sm font-medium transition-colors"
:class="currentPage === page.value ? 'bg-blue-600 text-white' : 'text-neutral-500 dark:text-neutral-300 hover:bg-neutral-200 hover:dark:text-white hover:dark:bg-white/5'"
x-text="page.value"
></button>
</template>
</div>
</template>
<!-- Next Button -->
<button
@click="next()"
class="cursor-pointer flex items-center justify-center w-8 h-8 rounded-md transition-colors"
:class="hasNext ? 'text-neutral-500 dark:text-neutral-300 hover:bg-neutral-200 hover:dark:text-white hover:dark:bg-white/5' : 'text-neutral-600 cursor-not-allowed!'"
:disabled="!hasNext"
>
<?php if (isset($component)) { $__componentOriginalb7b593bedd3add356eaada0571956b3f = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalb7b593bedd3add356eaada0571956b3f = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.icons.chevron-right','data' => ['class' => 'w-3 h-3']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::icons.chevron-right'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'w-3 h-3']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalb7b593bedd3add356eaada0571956b3f)): ?>
<?php $attributes = $__attributesOriginalb7b593bedd3add356eaada0571956b3f; ?>
<?php unset($__attributesOriginalb7b593bedd3add356eaada0571956b3f); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalb7b593bedd3add356eaada0571956b3f)): ?>
<?php $component = $__componentOriginalb7b593bedd3add356eaada0571956b3f; ?>
<?php unset($__componentOriginalb7b593bedd3add356eaada0571956b3f); ?>
<?php endif; ?>
</button>
<!-- Last Button -->
<button
@click="last()"
class="cursor-pointer flex items-center justify-center w-8 h-8 rounded-md transition-colors"
:class="hasNext ? 'text-neutral-500 dark:text-neutral-300 hover:bg-neutral-200 hover:dark:text-white hover:dark:bg-white/5' : 'text-neutral-600 cursor-not-allowed!'"
:disabled="!hasNext"
>
<?php if (isset($component)) { $__componentOriginalbb91e7976582fbddcedcde197cd5dca1 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalbb91e7976582fbddcedcde197cd5dca1 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.icons.chevrons-right','data' => ['class' => 'w-3 h-3']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::icons.chevrons-right'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'w-3 h-3']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalbb91e7976582fbddcedcde197cd5dca1)): ?>
<?php $attributes = $__attributesOriginalbb91e7976582fbddcedcde197cd5dca1; ?>
<?php unset($__attributesOriginalbb91e7976582fbddcedcde197cd5dca1); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalbb91e7976582fbddcedcde197cd5dca1)): ?>
<?php $component = $__componentOriginalbb91e7976582fbddcedcde197cd5dca1; ?>
<?php unset($__componentOriginalbb91e7976582fbddcedcde197cd5dca1); ?>
<?php endif; ?>
</button>
</div>
</div>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/query.blade.php ENDPATH**/ ?>
@@ -1,4 +0,0 @@
<svg width="6" height="10" viewBox="0 0 6 10" fill="none" xmlns="http://www.w3.org/2000/svg" <?php echo e($attributes); ?>>
<path d="M5.125 0.75L0.875 5L5.125 9.25" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/icons/chevron-left.blade.php ENDPATH**/ ?>

Before

Width:  |  Height:  |  Size: 418 B

@@ -1,54 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php echo $__env->yieldContent('title'); ?></title>
<!-- Styles -->
<style>
html, body {
background-color: #fff;
color: #636b6f;
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-weight: 100;
height: 100vh;
margin: 0;
}
.full-height {
height: 100vh;
}
.flex-center {
align-items: center;
display: flex;
justify-content: center;
}
.position-ref {
position: relative;
}
.content {
text-align: center;
}
.title {
font-size: 36px;
padding: 20px;
}
</style>
</head>
<body>
<div class="flex-center position-ref full-height">
<div class="content">
<div class="title">
<?php echo $__env->yieldContent('message'); ?>
</div>
</div>
</div>
</body>
</html>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/layout.blade.php ENDPATH**/ ?>
@@ -1,256 +0,0 @@
<?php $__env->startSection('title', 'Nuovo Messaggio'); ?>
<?php $__env->startSection('page_title', 'Nuovo Messaggio Email'); ?>
<?php $__env->startSection('content'); ?>
<div class="row">
<div class="col-md-9">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-envelope mr-2"></i>Componi Messaggio</h3>
</div>
<div class="card-body">
<form action="<?php echo e(route('mailing.invia')); ?>" method="POST" enctype="multipart/form-data">
<?php echo csrf_field(); ?>
<?php if(isset($senderAccounts) && $senderAccounts->count() > 0): ?>
<div class="form-group">
<label for="mittente_id">Mittente</label>
<select name="mittente_id" id="mittente_id" class="form-control">
<option value="">Sistema predefinito</option>
<?php $__currentLoopData = $senderAccounts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sender): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($sender->id); ?>"><?php echo e($sender->email_name ?: $sender->email_address); ?> &lt;<?php echo e($sender->email_address); ?>&gt;</option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<small class="text-muted">Seleziona un mittente per l'invio. Usa "Sistema predefinito" per inviare con l'account email principale.</small>
</div>
<?php endif; ?>
<?php if($individui->count() > 0): ?>
<div class="form-group" id="destinatari-form-group">
<label>Destinatari selezionati</label>
<div class="table-responsive">
<table class="table table-bordered table-sm">
<thead>
<tr>
<th>Codice</th>
<th>Nome</th>
<th>Email</th>
<th style="width: 50px;"></th>
</tr>
</thead>
<tbody id="destinatari-tbody">
<?php $__currentLoopData = $individui; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ind): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr id="dest-<?php echo e($ind->id); ?>">
<td><span class="badge badge-secondary"><?php echo e($ind->codice_id); ?></span></td>
<td><strong><?php echo e($ind->cognito); ?></strong> <?php echo e($ind->nome); ?></td>
<td><?php echo e($ind->contatti->where('tipo', 'email')->first()?->valore ?: 'Nessuna email'); ?></td>
<td>
<button type="button" class="btn btn-xs btn-outline-danger" onclick="removeDestinatario(<?php echo e($ind->id); ?>)" title="Rimuovi">
<i class="fas fa-times"></i>
</button>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
<input type="hidden" name="destinatari_ids" id="destinatari_ids" value="<?php echo e($individui->pluck('id')->join(',')); ?>">
<small class="text-muted" id="destinatari-count"><?php echo e($individui->count()); ?> destinatari</small>
</div>
<?php else: ?>
<div class="form-group">
<label for="lista_id">Lista Destinatari</label>
<select name="lista_id" id="lista_id" class="form-control">
<option value="">Seleziona lista...</option>
<?php $__empty_1 = true; $__currentLoopData = $liste; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lista): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<option value="<?php echo e($lista->id); ?>"><?php echo e($lista->nome); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<option value="">Nessuna lista disponibile</option>
<?php endif; ?>
</select>
</div>
<?php endif; ?>
<div class="form-group">
<label for="oggetto">Oggetto *</label>
<input type="text" name="oggetto" id="oggetto" class="form-control" required>
</div>
<div class="form-group">
<label for="corpo">Messaggio *</label>
<textarea name="corpo" id="corpo" class="form-control" rows="10" required></textarea>
</div>
<div class="form-group">
<label>Allegati</label>
<div class="border rounded p-3">
<div class="mb-3">
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#documentiModal">
<i class="fas fa-folder-open mr-1"></i> Seleziona da Documenti
</button>
<label class="btn btn-sm btn-success mb-0">
<i class="fas fa-upload mr-1"></i> Carica nuovo file
<input type="file" name="allegato" id="allegato" class="d-none" onchange="handleFileUpload(this)">
</label>
</div>
<div id="allegati-list">
<?php if(!empty($documentiSelezionati)): ?>
<?php $__currentLoopData = $documentiSelezionati; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $doc): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="d-flex align-items-center justify-content-between bg-light p-2 mb-2 rounded" id="allegato-<?php echo e($doc->id); ?>">
<span><i class="fas fa-file mr-2"></i><?php echo e($doc->nome_file); ?></span>
<button type="button" class="btn btn-xs btn-danger" onclick="removeAllegato(<?php echo e($doc->id); ?>)">
<i class="fas fa-times"></i>
</button>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
</div>
<input type="hidden" name="documenti_selezionati" id="documenti_selezionati" value="">
</div>
</div>
<button type="submit" class="btn btn-primary">
<i class="fas fa-paper-plane mr-1"></i> Invia
</button>
<a href="<?php echo e(route('individui.index')); ?>" class="btn btn-secondary">
Annulla
</a>
</form>
</div>
</div>
</div>
</div>
<div class="modal fade" id="documentiModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-folder-open mr-2"></i>Seleziona Documenti</h5>
<button type="button" class="close" data-dismiss="modal">
<span>&times;</span>
</button>
</div>
<div class="modal-body">
<?php if($documenti->count() > 0): ?>
<div class="table-responsive">
<table class="table table-bordered table-hover table-sm">
<thead>
<tr>
<th style="width: 40px;"></th>
<th>Nome File</th>
<th>Tipologia</th>
<th>Data</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $documenti; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $doc): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input doc-checkbox" id="doc-<?php echo e($doc->id); ?>" value="<?php echo e($doc->id); ?>" data-nome="<?php echo e($doc->nome_file); ?>">
<label class="custom-control-label" for="doc-<?php echo e($doc->id); ?>"></label>
</div>
</td>
<td><?php echo e($doc->nome_file); ?></td>
<td><span class="badge badge-info"><?php echo e($doc->tipologia ?: $doc->tipo); ?></span></td>
<td><?php echo e($doc->created_at->format('d/m/Y')); ?></td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
<?php else: ?>
<p class="text-muted">Nessun documento disponibile.</p>
<?php endif; ?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annulla</button>
<button type="button" class="btn btn-primary" onclick="aggiungiDocumenti()">
<i class="fas fa-plus mr-1"></i> Aggiungi
</button>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script>
let allegatiSelezionati = [];
function removeDestinatario(id) {
const row = document.getElementById('dest-' + id);
if (!row) return;
row.remove();
const input = document.getElementById('destinatari_ids');
if (input) {
let ids = input.value.split(',').filter(function(i) {
return i && parseInt(i) !== id;
});
input.value = ids.join(',');
const countEl = document.getElementById('destinatari-count');
if (countEl) {
countEl.textContent = ids.length + ' destinatari';
}
if (ids.length === 0) {
document.getElementById('destinatari-form-group').style.display = 'none';
document.getElementById('lista-form-group').style.display = 'block';
}
}
}
function aggiungiDocumenti() {
const checkboxes = document.querySelectorAll('.doc-checkbox:checked');
checkboxes.forEach(function(cb) {
const id = parseInt(cb.value);
const nome = cb.dataset.nome;
if (!allegatiSelezionati.includes(id)) {
allegatiSelezionati.push(id);
const container = document.getElementById('allegati-list');
const div = document.createElement('div');
div.className = 'd-flex align-items-center justify-content-between bg-light p-2 mb-2 rounded';
div.id = 'allegato-' + id;
div.innerHTML = '<span><i class="fas fa-file mr-2"></i>' + nome + '</span>' +
'<button type="button" class="btn btn-xs btn-danger" onclick="removeAllegato(' + id + ')">' +
'<i class="fas fa-times"></i></button>';
container.appendChild(div);
}
cb.checked = false;
});
document.getElementById('documenti_esistenti').value = allegatiSelezionati.join(',');
$('#documentiModal').modal('hide');
}
function removeAllegato(id) {
allegatiSelezionati = allegatiSelezionati.filter(function(a) { return a !== id; });
const el = document.getElementById('allegato-' + id);
if (el) el.remove();
document.getElementById('documenti_selezionati').value = allegatiSelezionati.join(',');
}
function handleFileUpload(input) {
if (input.files && input.files[0]) {
const file = input.files[0];
const container = document.getElementById('allegati-list');
const div = document.createElement('div');
div.className = 'd-flex align-items-center justify-content-between bg-light p-2 mb-2 rounded';
div.id = 'allegato-upload';
div.innerHTML = '<span><i class="fas fa-file mr-2"></i>' + file.name + ' (' + (file.size / 1024).toFixed(1) + ' KB)</span>' +
'<button type="button" class="btn btn-xs btn-danger" onclick="this.parentElement.remove(); input.value=\'\';">' +
'<i class="fas fa-times"></i></button>';
container.appendChild(div);
}
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/mailing/nuovo.blade.php ENDPATH**/ ?>
@@ -1,65 +0,0 @@
<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;
$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames((['frame']));
foreach ($attributes->all() as $__key => $__value) {
if (in_array($__key, $__propNames)) {
$$__key = $$__key ?? $__value;
} else {
$__newAttributes[$__key] = $__value;
}
}
$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);
unset($__propNames);
unset($__newAttributes);
foreach (array_filter((['frame']), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
$$__key = $$__key ?? $__value;
}
$__defined_vars = get_defined_vars();
foreach ($attributes->all() as $__key => $__value) {
if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}
unset($__defined_vars, $__key, $__value); ?>
<?php
$class = $frame->class();
$operator = $frame->operator();
$callable = $frame->callable();
if ($class && $operator) {
$source = $class.$operator.$callable.'('.implode(', ', $frame->args()).')';
} elseif ($callable !== 'throw') {
$source = $callable.'('.implode(', ', $frame->args()).')';
} else {
$source = $frame->source();
}
?>
<?php if (isset($component)) { $__componentOriginal12cb286571f553eebcbe98210b217f94 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal12cb286571f553eebcbe98210b217f94 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.syntax-highlight','data' => ['code' => $source,'language' => 'php','truncate' => true,'class' => 'text-xs min-w-0','dataTippyContent' => ''.e($source).'']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::syntax-highlight'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['code' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($source),'language' => 'php','truncate' => true,'class' => 'text-xs min-w-0','data-tippy-content' => ''.e($source).'']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal12cb286571f553eebcbe98210b217f94)): ?>
<?php $attributes = $__attributesOriginal12cb286571f553eebcbe98210b217f94; ?>
<?php unset($__attributesOriginal12cb286571f553eebcbe98210b217f94); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal12cb286571f553eebcbe98210b217f94)): ?>
<?php $component = $__componentOriginal12cb286571f553eebcbe98210b217f94; ?>
<?php unset($__componentOriginal12cb286571f553eebcbe98210b217f94); ?>
<?php endif; ?>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/formatted-source.blade.php ENDPATH**/ ?>
@@ -1,6 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" <?php echo e($attributes); ?>>
<circle cx="12" cy="12" r="10"/>
<path d="M12 16v-4"/>
<path d="M12 8h.01"/>
</svg>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/icons/info.blade.php ENDPATH**/ ?>

Before

Width:  |  Height:  |  Size: 471 B

@@ -1,11 +0,0 @@
<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg" <?php echo e($attributes); ?>>
<g clip-path="url(#clip0_14732_6105)">
<path d="M9.87466 7.8287L5.92654 0.549947C5.82917 0.369362 5.68068 0.221523 5.49966 0.124947C5.25374 -0.00665839 4.9658 -0.0358401 4.69847 0.0437494C4.43115 0.123339 4.20606 0.305262 4.07216 0.549947L0.124664 7.8287C0.0383472 7.98887 -0.00481098 8.16875 -0.000569449 8.35066C0.00367208 8.53256 0.0551674 8.71024 0.148856 8.86622C0.242546 9.0222 0.375205 9.15112 0.533798 9.24031C0.692391 9.32951 0.871462 9.37591 1.05341 9.37495H8.94591C9.12031 9.37495 9.29203 9.33202 9.44591 9.24995C9.56783 9.18524 9.67572 9.09703 9.76338 8.99041C9.85104 8.8838 9.91672 8.76088 9.95663 8.62876C9.99655 8.49663 10.0099 8.35791 9.99595 8.22059C9.98199 8.08328 9.94036 7.95009 9.87466 7.8287ZM4.99966 8.12495C4.87605 8.12495 4.75521 8.08829 4.65243 8.01962C4.54965 7.95094 4.46954 7.85333 4.42224 7.73912C4.37493 7.62492 4.36256 7.49925 4.38667 7.37802C4.41079 7.25678 4.47031 7.14541 4.55772 7.05801C4.64513 6.9706 4.75649 6.91107 4.87773 6.88696C4.99897 6.86284 5.12464 6.87522 5.23884 6.92252C5.35304 6.96983 5.45066 7.04993 5.51933 7.15272C5.58801 7.2555 5.62466 7.37633 5.62466 7.49995C5.62466 7.66571 5.55882 7.82468 5.44161 7.94189C5.3244 8.0591 5.16542 8.12495 4.99966 8.12495ZM5.62466 5.93745C5.62466 6.02033 5.59174 6.09981 5.53313 6.15842C5.47453 6.21702 5.39504 6.24995 5.31216 6.24995H4.68716C4.60428 6.24995 4.5248 6.21702 4.46619 6.15842C4.40759 6.09981 4.37466 6.02033 4.37466 5.93745V3.43745C4.37466 3.35457 4.40759 3.27508 4.46619 3.21648C4.5248 3.15787 4.60428 3.12495 4.68716 3.12495H5.31216C5.39504 3.12495 5.47453 3.15787 5.53313 3.21648C5.59174 3.27508 5.62466 3.35457 5.62466 3.43745V5.93745Z" fill="currentColor" />
</g>
<defs>
<clipPath id="clip0_14732_6105">
<rect width="10" height="10" />
</clipPath>
</defs>
</svg>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/icons/alert.blade.php ENDPATH**/ ?>

Before

Width:  |  Height:  |  Size: 2.1 KiB

@@ -1,418 +0,0 @@
<?php $__env->startSection('title', 'Report'); ?>
<?php $__env->startSection('page_title', 'Report e Statistiche'); ?>
<?php $__env->startSection('styles'); ?>
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<link href="https://cdn.jsdelivr.net/npm/select2-bootstrap4-theme@1.0.0/dist/select2-bootstrap4.min.css" rel="stylesheet" />
<style>
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
font-size: 0.8rem;
}
.card-indigo {
border-top: 3px solid #6610f2;
}
.card-indigo .card-title {
color: #6610f2;
}
.accordion .card-header .btn-link {
text-decoration: none;
font-weight: 600;
color: #495057;
}
.accordion .card-header .btn-link:hover {
color: #007bff;
}
.accordion .card-header .btn-link i {
transition: transform 0.2s ease;
width: 20px;
}
.accordion .card-header .btn-link[aria-expanded="true"] i.fa-chevron-right {
transform: rotate(90deg);
}
</style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<?php if(session('success')): ?>
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<?php echo e(session('success')); ?>
</div>
<?php endif; ?>
<?php if(session('error')): ?>
<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<?php echo e(session('error')); ?>
</div>
<?php endif; ?>
<div class="accordion" id="reportAccordion">
<div class="card">
<div class="card-header" id="headingOne">
<h2 class="mb-0">
<button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
<i class="fas fa-chevron-down mr-2 text-primary"></i>
<i class="fas fa-chart-bar mr-2 text-primary"></i> Panoramica Database
</button>
</h2>
</div>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#reportAccordion">
<div class="card-body">
<div class="row">
<div class="col-md-2 col-4 text-center">
<div class="info-box">
<span class="info-box-icon bg-info"><i class="fas fa-users"></i></span>
<div class="info-box-content">
<span class="info-box-text">Individui</span>
<span class="info-box-number"><?php echo e(number_format($stats['individui'])); ?></span>
</div>
</div>
</div>
<div class="col-md-2 col-4 text-center">
<div class="info-box">
<span class="info-box-icon bg-warning"><i class="fas fa-folder"></i></span>
<div class="info-box-content">
<span class="info-box-text">Gruppi</span>
<span class="info-box-number"><?php echo e(number_format($stats['gruppi'])); ?></span>
</div>
</div>
</div>
<div class="col-md-2 col-4 text-center">
<div class="info-box">
<span class="info-box-icon bg-danger"><i class="fas fa-calendar"></i></span>
<div class="info-box-content">
<span class="info-box-text">Eventi</span>
<span class="info-box-number"><?php echo e(number_format($stats['eventi'])); ?></span>
</div>
</div>
</div>
<div class="col-md-2 col-4 text-center">
<div class="info-box">
<span class="info-box-icon bg-secondary"><i class="fas fa-file"></i></span>
<div class="info-box-content">
<span class="info-box-text">Documenti</span>
<span class="info-box-number"><?php echo e(number_format($stats['documenti'])); ?></span>
</div>
</div>
</div>
<div class="col-md-2 col-4 text-center">
<div class="info-box">
<span class="info-box-icon bg-purple"><i class="fas fa-list"></i></span>
<div class="info-box-content">
<span class="info-box-text">Mailing List</span>
<span class="info-box-number"><?php echo e(number_format($stats['mailing_liste'])); ?></span>
</div>
</div>
</div>
<div class="col-md-2 col-4 text-center">
<div class="info-box">
<span class="info-box-icon bg-teal"><i class="fas fa-address-book"></i></span>
<div class="info-box-content">
<span class="info-box-text">Contatti</span>
<span class="info-box-number"><?php echo e(number_format($stats['contatti'])); ?></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header" id="headingTwo">
<h2 class="mb-0">
<button class="btn btn-link btn-block text-left collapsed" type="button" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
<i class="fas fa-chevron-right mr-2 text-warning"></i>
<i class="fas fa-chart-pie mr-2 text-warning"></i> Report Predefiniti
<span class="badge badge-warning badge-pill ml-2"><?php echo e(count($prebuiltReports)); ?></span>
</button>
</h2>
</div>
<div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#reportAccordion">
<div class="card-body">
<div class="row">
<?php $__currentLoopData = $prebuiltReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $report): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="col-md-4 col-lg-3 mb-3">
<?php
$cardColor = $report['colore'] === 'indigo' ? 'card-indigo' : 'card-' . $report['colore'];
$btnColor = $report['colore'] === 'indigo' ? 'primary' : $report['colore'];
?>
<div class="card <?php echo e($cardColor); ?> card-outline h-100">
<div class="card-body text-center d-flex flex-column">
<i class="fas <?php echo e($report['icona']); ?> fa-3x text-<?php echo e($btnColor); ?> mb-3"></i>
<h5><?php echo e($report['nome']); ?></h5>
<p class="text-muted small mb-3 flex-grow-1"><?php echo e($report['descrizione']); ?></p>
<?php if($report['has_tipologia_filter'] ?? false): ?>
<form action="<?php echo e(route('report.run')); ?>" method="GET" class="mb-2">
<div class="form-group mb-2">
<select name="tipologia_documento" class="form-control form-control-sm select2-tipologia" style="width: 100%;">
<option value="">Tutte le tipologie</option>
<?php $__currentLoopData = $tipologieDocumento; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tipologia): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($tipologia); ?>"><?php echo e(ucfirst($tipologia)); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<input type="hidden" name="report" value="<?php echo e($report['id']); ?>">
<div class="btn-group btn-group-sm w-100">
<button type="submit" class="btn btn-sm btn-<?php echo e($btnColor); ?>">
<i class="fas fa-play mr-1"></i> Genera
</button>
<a href="<?php echo e(route('report.export', ['report' => $report['id']])); ?>" class="btn btn-sm btn-outline-<?php echo e($btnColor); ?>">
<i class="fas fa-download mr-1"></i> CSV
</a>
</div>
</form>
<?php else: ?>
<div class="btn-group btn-group-sm w-100">
<a href="<?php echo e(route('report.run', ['report' => $report['id']])); ?>" class="btn btn-sm btn-<?php echo e($btnColor); ?>">
<i class="fas fa-play mr-1"></i> Genera
</a>
<a href="<?php echo e(route('report.export', ['report' => $report['id']])); ?>" class="btn btn-sm btn-outline-<?php echo e($btnColor); ?>">
<i class="fas fa-download mr-1"></i> CSV
</a>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header" id="headingThree">
<h2 class="mb-0">
<button class="btn btn-link btn-block text-left collapsed" type="button" data-toggle="collapse" data-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
<i class="fas fa-chevron-right mr-2 text-info"></i>
<i class="fas fa-bookmark mr-2 text-info"></i> Report Personalizzati
<span class="badge badge-info badge-pill ml-2"><?php echo e($customReports->count()); ?></span>
</button>
</h2>
</div>
<div id="collapseThree" class="collapse" aria-labelledby="headingThree" data-parent="#reportAccordion">
<div class="card-body">
<div class="row">
<div class="col-md-8">
<?php if($customReports->count() > 0): ?>
<table class="table table-striped mb-0">
<thead>
<tr>
<th>Nome</th>
<th>Tipo</th>
<th>Creato il</th>
<th style="width: 140px;">Azioni</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $customReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $report): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td>
<i class="fas fa-chart-line text-primary mr-1"></i>
<?php echo e($report->nome); ?>
</td>
<td><span class="badge badge-info"><?php echo e(ucfirst($report->tipo_report)); ?></span></td>
<td><?php echo e($report->created_at->format('d/m/Y H:i')); ?></td>
<td>
<a href="<?php echo e(route('report.run', ['custom_id' => $report->id])); ?>" class="btn btn-xs btn-success" title="Esegui">
<i class="fas fa-play"></i>
</a>
<a href="<?php echo e(route('report.export', ['custom_id' => $report->id])); ?>" class="btn btn-xs btn-info" title="Esporta CSV">
<i class="fas fa-file-csv"></i>
</a>
<form action="<?php echo e(route('report.destroy-custom', $report->id)); ?>" method="POST" class="d-inline">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Eliminare questo report?')" title="Elimina">
<i class="fas fa-trash"></i>
</button>
</form>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
<?php else: ?>
<div class="text-center text-muted py-4">
<i class="fas fa-chart-line fa-3x mb-3"></i>
<p>Nessun report personalizzato creato.</p>
</div>
<?php endif; ?>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-header bg-primary">
<h3 class="card-title text-white"><i class="fas fa-plus mr-2"></i>Crea Report Personalizzato</h3>
</div>
<div class="card-body">
<form action="<?php echo e(route('report.store-custom')); ?>" method="POST">
<?php echo csrf_field(); ?>
<div class="form-group">
<label>Nome Report *</label>
<input type="text" name="nome" class="form-control" required placeholder="Es: Individui attivi">
</div>
<div class="form-group">
<label>Descrizione</label>
<textarea name="descrizione" class="form-control" rows="2" placeholder="Descrizione opzionale..."></textarea>
</div>
<div class="form-group">
<label>Tipo Dato *</label>
<select name="tipo_report" id="tipo_report" class="form-control" required>
<option value="">Seleziona...</option>
<?php $__currentLoopData = $columnOptions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $type => $columns): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($type); ?>"><?php echo e(ucfirst($type)); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<div class="form-group">
<label>Colonne *</label>
<select name="columns[]" id="columns_select" class="form-control select2-multi" multiple style="width: 100%;">
</select>
<small class="text-muted">Seleziona le colonne da includere nel report</small>
</div>
<div class="form-group">
<label>Ordina per</label>
<select name="sort_by" id="sort_by" class="form-control">
<option value="">Nessun ordinamento</option>
</select>
</div>
<div class="form-group">
<label>Direzione ordinamento</label>
<select name="sort_direction" class="form-control">
<option value="asc">Ascendente (A-Z)</option>
<option value="desc" selected>Discendente (Z-A)</option>
</select>
</div>
<div class="form-group">
<label>Limite risultati</label>
<input type="number" name="limit" class="form-control" placeholder="Es: 100" min="1">
</div>
<button type="submit" class="btn btn-primary btn-block">
<i class="fas fa-save mr-1"></i> Salva Report
</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
const columnOptions = <?php echo json_encode($columnOptions, 15, 512) ?>;
let columnsSelectInitialized = false;
function initTipologiaSelect2(container) {
$(container).find('.select2-tipologia').select2({
theme: 'bootstrap4',
placeholder: 'Filtra per tipologia...',
allowClear: true,
width: '100%',
});
}
function destroyTipologiaSelect2(container) {
$(container).find('.select2-tipologia').select2('destroy');
}
function initColumnsSelect2() {
if (columnsSelectInitialized) return;
$('#columns_select').select2({
theme: 'bootstrap4',
placeholder: 'Seleziona le colonne...',
allowClear: true,
width: '100%',
});
columnsSelectInitialized = true;
}
function destroyColumnsSelect2() {
if (!columnsSelectInitialized) return;
$('#columns_select').select2('destroy');
columnsSelectInitialized = false;
}
function getSortOptions(tipoReport) {
const cols = columnOptions[tipoReport] || {};
const options = [];
for (const [key, col] of Object.entries(cols)) {
if (col.type !== 'relation') {
options.push({ value: key, label: col.label });
}
}
return options;
}
$('#collapseTwo').on('shown.bs.collapse', function () {
initTipologiaSelect2(this);
}).on('hidden.bs.collapse', function () {
destroyTipologiaSelect2(this);
});
$('#collapseThree').on('shown.bs.collapse', function () {
initColumnsSelect2();
}).on('hidden.bs.collapse', function () {
destroyColumnsSelect2();
});
if ($('#collapseTwo').hasClass('show')) {
initTipologiaSelect2(document);
}
if ($('#collapseThree').hasClass('show')) {
initColumnsSelect2();
}
$('#tipo_report').on('change', function() {
const tipo = this.value;
const $select = $('#columns_select');
if (columnsSelectInitialized) {
$select.empty().trigger('change');
}
$select.empty();
if (tipo && columnOptions[tipo]) {
const cols = columnOptions[tipo];
const fragment = document.createDocumentFragment();
for (const [key, col] of Object.entries(cols)) {
fragment.appendChild(new Option(col.label, key, false, false));
}
$select.append(fragment);
}
if (columnsSelectInitialized) {
$select.trigger('change');
}
const $sortBy = $('#sort_by');
$sortBy.empty();
$sortBy.append(new Option('Nessun ordinamento', '', false, false));
const sortOptions = getSortOptions(tipo);
sortOptions.forEach(function(opt) {
$sortBy.append(new Option(opt.label, opt.value, false, false));
});
});
if ($('#tipo_report').val()) {
$('#tipo_report').trigger('change');
}
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/report/index.blade.php ENDPATH**/ ?>
@@ -1,75 +0,0 @@
<?php
$children = $gruppo->children()->with(['diocesi', 'individui'])->orderBy('nome')->get();
$hasChildren = $children->count() > 0;
$canWriteGruppi = Auth::user()->canManage('gruppi');
$responsabili = $gruppo->getResponsabili();
?>
<div class="tree-item" style="margin-left: <?php echo e($gruppo->depth ?? 0); ?>px;">
<div class="tree-label">
<?php if($hasChildren): ?>
<span class="tree-toggle" onclick="toggleItem(<?php echo e($gruppo->id); ?>)">
<i id="icon-<?php echo e($gruppo->id); ?>" class="fas fa-chevron-right text-muted"></i>
</span>
<?php else: ?>
<span style="width: 22px; display: inline-block;"></span>
<?php endif; ?>
<i class="fas fa-<?php echo e($hasChildren ? 'folder' : 'folder-open'); ?> text-<?php echo e($gruppo->depth == 0 ? 'warning' : 'secondary'); ?> mr-1"></i>
<a href="<?php echo e(route('gruppi.show', $gruppo->id)); ?>" class="<?php echo e(($gruppo->depth ?? 0) == 0 ? 'font-weight-bold' : ''); ?>">
<?php echo e($gruppo->nome); ?>
</a>
<span class="badge badge-<?php echo e(($gruppo->depth ?? 0) == 0 ? 'primary' : 'secondary'); ?> badge-level"><?php echo e($gruppo->depth ?? 0); ?></span>
<small class="text-muted ml-2">
<?php echo e($gruppo->diocesi?->nome ?? ''); ?>
<?php if($responsabili->count() > 0): ?>
· <i class="fas fa-user text-info"></i> <?php echo e($responsabili->pluck('cognome')->implode(', ')); ?>
<?php endif; ?>
</small>
<span class="ml-auto">
<?php if($gruppo->individui_count > 0): ?>
<span class="badge badge-info"><?php echo e($gruppo->individui_count); ?> membri</span>
<?php endif; ?>
<?php if($hasChildren): ?>
<span class="badge badge-warning"><?php echo e($children->count()); ?> figli</span>
<?php endif; ?>
</span>
<span class="ml-2">
<a href="<?php echo e(route('gruppi.show', $gruppo->id)); ?>" class="btn btn-xs btn-info" title="Visualizza">
<i class="fas fa-eye"></i>
</a>
<?php if($canWriteGruppi): ?>
<a href="<?php echo e(url('/gruppi/' . $gruppo->id . '/edit')); ?>" class="btn btn-xs btn-warning" title="Modifica">
<i class="fas fa-edit"></i>
</a>
<?php
$isParent = $hasChildren;
$isSuperAdmin = Auth::user()->isSuperAdmin();
$canDelete = !$isParent || $isSuperAdmin;
?>
<?php if($canDelete): ?>
<form action="<?php echo e(url('/gruppi/' . $gruppo->id)); ?>" method="POST" class="d-inline">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Confermi l\'eliminazione? Verranno eliminati anche tutti i sottogruppi.')" title="Elimina">
<i class="fas fa-trash"></i>
</button>
</form>
<?php else: ?>
<button type="button" class="btn btn-xs btn-danger disabled" title="Solo il superamministratore può eliminare gruppi con sottogruppi">
<i class="fas fa-trash"></i>
</button>
<?php endif; ?>
<?php endif; ?>
</span>
</div>
</div>
<?php if($hasChildren): ?>
<div id="group-<?php echo e($gruppo->id); ?>" class="tree-children" style="display: none;">
<?php $__currentLoopData = $children; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $child): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php echo $__env->make('gruppi.partials.tree-item', ['gruppo' => $child], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
<?php endif; ?><?php /**PATH /var/www/html/glastree/resources/views/gruppi/partials/tree-item.blade.php ENDPATH**/ ?>
@@ -1,80 +0,0 @@
<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;
$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames((['frame']));
foreach ($attributes->all() as $__key => $__value) {
if (in_array($__key, $__propNames)) {
$$__key = $$__key ?? $__value;
} else {
$__newAttributes[$__key] = $__value;
}
}
$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);
unset($__propNames);
unset($__newAttributes);
foreach (array_filter((['frame']), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
$$__key = $$__key ?? $__value;
}
$__defined_vars = get_defined_vars();
foreach ($attributes->all() as $__key => $__value) {
if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}
unset($__defined_vars, $__key, $__value); ?>
<div class="grid gap-3 p-4 bg-neutral-50 dark:bg-transparent overflow-x-auto rounded-lg">
<?php if($frame->previous()): ?>
<div class="flex">
<?php if (isset($component)) { $__componentOriginalc33171fb5f34409a0ad661ae1625dcb2 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalc33171fb5f34409a0ad661ae1625dcb2 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.formatted-source','data' => ['frame' => $frame,'className' => 'text-xs']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::formatted-source'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['frame' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($frame),'className' => 'text-xs']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalc33171fb5f34409a0ad661ae1625dcb2)): ?>
<?php $attributes = $__attributesOriginalc33171fb5f34409a0ad661ae1625dcb2; ?>
<?php unset($__attributesOriginalc33171fb5f34409a0ad661ae1625dcb2); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc33171fb5f34409a0ad661ae1625dcb2)): ?>
<?php $component = $__componentOriginalc33171fb5f34409a0ad661ae1625dcb2; ?>
<?php unset($__componentOriginalc33171fb5f34409a0ad661ae1625dcb2); ?>
<?php endif; ?>
</div>
<?php else: ?>
<span class="font-mono text-xs leading-3 text-neutral-500">Entrypoint</span>
<?php endif; ?>
<?php if (isset($component)) { $__componentOriginalfe2bc8d0a6d110d41fdc8740012cee8d = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalfe2bc8d0a6d110d41fdc8740012cee8d = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.file-with-line','data' => ['frame' => $frame,'class' => 'text-xs']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::file-with-line'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['frame' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($frame),'class' => 'text-xs']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalfe2bc8d0a6d110d41fdc8740012cee8d)): ?>
<?php $attributes = $__attributesOriginalfe2bc8d0a6d110d41fdc8740012cee8d; ?>
<?php unset($__attributesOriginalfe2bc8d0a6d110d41fdc8740012cee8d); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalfe2bc8d0a6d110d41fdc8740012cee8d)): ?>
<?php $component = $__componentOriginalfe2bc8d0a6d110d41fdc8740012cee8d; ?>
<?php unset($__componentOriginalfe2bc8d0a6d110d41fdc8740012cee8d); ?>
<?php endif; ?>
</div>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/vendor-frame.blade.php ENDPATH**/ ?>
@@ -1,122 +0,0 @@
<?php if($paginator->hasPages()): ?>
<nav role="navigation" aria-label="<?php echo e(__('Pagination Navigation')); ?>">
<div class="flex gap-2 items-center justify-between sm:hidden">
<?php if($paginator->onFirstPage()): ?>
<span class="inline-flex items-center px-4 py-2 text-sm font-medium text-gray-600 bg-white border border-gray-300 cursor-not-allowed leading-5 rounded-md dark:text-gray-300 dark:bg-gray-700 dark:border-gray-600">
<?php echo __('pagination.previous'); ?>
</span>
<?php else: ?>
<a href="<?php echo e($paginator->previousPageUrl()); ?>" rel="prev" class="inline-flex items-center px-4 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-700 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-800 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-200 dark:focus:border-blue-700 dark:active:bg-gray-700 dark:active:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-900 dark:hover:text-gray-200">
<?php echo __('pagination.previous'); ?>
</a>
<?php endif; ?>
<?php if($paginator->hasMorePages()): ?>
<a href="<?php echo e($paginator->nextPageUrl()); ?>" rel="next" class="inline-flex items-center px-4 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-700 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-800 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-200 dark:focus:border-blue-700 dark:active:bg-gray-700 dark:active:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-900 dark:hover:text-gray-200">
<?php echo __('pagination.next'); ?>
</a>
<?php else: ?>
<span class="inline-flex items-center px-4 py-2 text-sm font-medium text-gray-600 bg-white border border-gray-300 cursor-not-allowed leading-5 rounded-md dark:text-gray-300 dark:bg-gray-700 dark:border-gray-600">
<?php echo __('pagination.next'); ?>
</span>
<?php endif; ?>
</div>
<div class="hidden sm:flex-1 sm:flex sm:gap-2 sm:items-center sm:justify-between">
<div>
<p class="text-sm text-gray-700 leading-5 dark:text-gray-600">
<?php echo __('Showing'); ?>
<?php if($paginator->firstItem()): ?>
<span class="font-medium"><?php echo e($paginator->firstItem()); ?></span>
<?php echo __('to'); ?>
<span class="font-medium"><?php echo e($paginator->lastItem()); ?></span>
<?php else: ?>
<?php echo e($paginator->count()); ?>
<?php endif; ?>
<?php echo __('of'); ?>
<span class="font-medium"><?php echo e($paginator->total()); ?></span>
<?php echo __('results'); ?>
</p>
</div>
<div>
<span class="inline-flex rtl:flex-row-reverse shadow-sm rounded-md">
<?php if($paginator->onFirstPage()): ?>
<span aria-disabled="true" aria-label="<?php echo e(__('pagination.previous')); ?>">
<span class="inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-not-allowed rounded-l-md leading-5 dark:bg-gray-700 dark:border-gray-600 dark:text-gray-400" aria-hidden="true">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" />
</svg>
</span>
</span>
<?php else: ?>
<a href="<?php echo e($paginator->previousPageUrl()); ?>" rel="prev" class="inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-l-md leading-5 hover:text-gray-400 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:active:bg-gray-700 dark:focus:border-blue-800 dark:text-gray-300 dark:hover:bg-gray-900 dark:hover:text-gray-300" aria-label="<?php echo e(__('pagination.previous')); ?>">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" />
</svg>
</a>
<?php endif; ?>
<?php $__currentLoopData = $elements; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if(is_string($element)): ?>
<span aria-disabled="true">
<span class="inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 cursor-default leading-5 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-300"><?php echo e($element); ?></span>
</span>
<?php endif; ?>
<?php if(is_array($element)): ?>
<?php $__currentLoopData = $element; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $page => $url): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if($page == $paginator->currentPage()): ?>
<span aria-current="page">
<span class="inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-gray-200 border border-gray-300 cursor-default leading-5 dark:bg-gray-700 dark:border-gray-600 dark:text-gray-300"><?php echo e($page); ?></span>
</span>
<?php else: ?>
<a href="<?php echo e($url); ?>" class="inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 hover:text-gray-700 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-300 dark:hover:text-gray-300 dark:active:bg-gray-700 dark:focus:border-blue-800 hover:bg-gray-100 dark:hover:bg-gray-900" aria-label="<?php echo e(__('Go to page :page', ['page' => $page])); ?>">
<?php echo e($page); ?>
</a>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php if($paginator->hasMorePages()): ?>
<a href="<?php echo e($paginator->nextPageUrl()); ?>" rel="next" class="inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-r-md leading-5 hover:text-gray-400 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:active:bg-gray-700 dark:focus:border-blue-800 dark:text-gray-300 dark:hover:bg-gray-900 dark:hover:text-gray-300" aria-label="<?php echo e(__('pagination.next')); ?>">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
</svg>
</a>
<?php else: ?>
<span aria-disabled="true" aria-label="<?php echo e(__('pagination.next')); ?>">
<span class="inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-not-allowed rounded-r-md leading-5 dark:bg-gray-700 dark:border-gray-600 dark:text-gray-400" aria-hidden="true">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
</svg>
</span>
</span>
<?php endif; ?>
</span>
</div>
</div>
</nav>
<?php endif; ?>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/tailwind.blade.php ENDPATH**/ ?>
@@ -1,112 +0,0 @@
<?php $__env->startSection('title', 'Modifica Utente'); ?>
<?php $__env->startSection('page_title', 'Modifica Utente: ' . $user->name); ?>
<?php $__env->startSection('breadcrumbs'); ?>
<li class="breadcrumb-item"><a href="/admin/utenti">Admin</a></li>
<li class="breadcrumb-item"><a href="/admin/utenti">Utenti</a></li>
<li class="breadcrumb-item active"><?php echo e($user->name); ?></li>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="row">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<h3 class="card-title">Dati Utente</h3>
</div>
<div class="card-body">
<form method="POST" action="/admin/utenti/<?php echo e($user->id); ?>">
<?php echo csrf_field(); ?> <?php echo method_field('PUT'); ?>
<div class="form-group">
<label>Nome *</label>
<input type="text" name="name" class="form-control" required value="<?php echo e(old('name', $user->name)); ?>">
</div>
<div class="form-group">
<label>Email *</label>
<input type="email" name="email" class="form-control" required value="<?php echo e(old('email', $user->email)); ?>">
</div>
<div class="form-group">
<label>Nuova Password <small>(lascia vuoto per non cambiare)</small></label>
<input type="password" name="password" class="form-control" minlength="8">
</div>
<div class="form-group">
<label>Conferma Password</label>
<input type="password" name="password_confirmation" class="form-control" minlength="8">
</div>
<div class="form-group">
<label>Stato</label>
<select name="status" class="form-control" required>
<option value="active" <?php echo e(old('status', $user->status) === 'active' ? 'selected' : ''); ?>>Attivo</option>
<option value="suspended" <?php echo e(old('status', $user->status) === 'suspended' ? 'selected' : ''); ?>>Sospeso</option>
<option value="pending" <?php echo e(old('status', $user->status) === 'pending' ? 'selected' : ''); ?>>In attesa</option>
</select>
</div>
<div class="form-group">
<label>Ruolo Predefinito</label>
<select name="role_preset_id" class="form-control" id="rolePresetSelect">
<option value="">Personalizzato</option>
<?php $__currentLoopData = $rolePresets; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $preset): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($preset->id); ?>" <?php echo e(old('role_preset_id', $user->role_preset_id) == $preset->id ? 'selected' : ''); ?>>
<?php echo e($preset->name); ?> - <?php echo e($preset->description); ?>
</option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<input type="hidden" name="is_admin" value="0">
<div class="form-group">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="isAdmin" name="is_admin" value="1" <?php echo e(old('is_admin', $user->isSuperAdmin() ? '1' : '0') === '1' ? 'checked' : ''); ?>>
<label class="custom-control-label" for="isAdmin">Superadmin (bypass ACL)</label>
</div>
</div>
<div id="permissionsSection" class="mt-4">
<h5>Permessi Granulari</h5>
<table class="table table-sm">
<thead>
<tr>
<th>Modulo</th>
<th>Nessuno</th>
<th>Lettura</th>
<th>Completo</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = \App\Models\User::MODULES; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $module): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td><strong><?php echo e(ucfirst($module)); ?></strong></td>
<td><input type="radio" name="permissions[<?php echo e($module); ?>]" value="0" <?php echo e(($user->permissions[$module] ?? 0) == 0 ? 'checked' : ''); ?>></td>
<td><input type="radio" name="permissions[<?php echo e($module); ?>]" value="1" <?php echo e(($user->permissions[$module] ?? 0) == 1 ? 'checked' : ''); ?>></td>
<td><input type="radio" name="permissions[<?php echo e($module); ?>]" value="2" <?php echo e(($user->permissions[$module] ?? 0) == 2 ? 'checked' : ''); ?>></td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
<div class="mt-4">
<button type="submit" class="btn btn-primary">
<i class="fas fa-save"></i> Salva
</button>
<a href="/admin/utenti" class="btn btn-secondary">Annulla</a>
</div>
</form>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script>
$('#rolePresetSelect').change(function() {
if ($(this).val()) {
$('#permissionsSection').hide();
} else {
$('#permissionsSection').show();
}
}).trigger('change');
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/admin/utenti/edit.blade.php ENDPATH**/ ?>
@@ -1,69 +0,0 @@
<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;
$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames((['routing']));
foreach ($attributes->all() as $__key => $__value) {
if (in_array($__key, $__propNames)) {
$$__key = $$__key ?? $__value;
} else {
$__newAttributes[$__key] = $__value;
}
}
$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);
unset($__propNames);
unset($__newAttributes);
foreach (array_filter((['routing']), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
$$__key = $$__key ?? $__value;
}
$__defined_vars = get_defined_vars();
foreach ($attributes->all() as $__key => $__value) {
if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}
unset($__defined_vars, $__key, $__value); ?>
<div class="flex flex-col gap-3">
<h2 class="text-lg font-semibold">Routing</h2>
<div class="flex flex-col">
<?php $__empty_1 = true; $__currentLoopData = $routing; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<div class="flex max-w-full items-baseline gap-2 h-10 text-sm font-mono">
<div class="uppercase text-neutral-500 dark:text-neutral-400 shrink-0"><?php echo e($key); ?></div>
<div class="min-w-6 grow h-3 border-b-2 border-dotted border-neutral-300 dark:border-white/20"></div>
<div class="truncate text-neutral-900 dark:text-white">
<span data-tippy-content="<?php echo e($value); ?>">
<?php echo e($value); ?>
</span>
</div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<?php if (isset($component)) { $__componentOriginal612ffe32146e3bd2ac6ba6076cca9520 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal612ffe32146e3bd2ac6ba6076cca9520 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.empty-state','data' => ['message' => 'No routing context']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::empty-state'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['message' => 'No routing context']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal612ffe32146e3bd2ac6ba6076cca9520)): ?>
<?php $attributes = $__attributesOriginal612ffe32146e3bd2ac6ba6076cca9520; ?>
<?php unset($__attributesOriginal612ffe32146e3bd2ac6ba6076cca9520); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal612ffe32146e3bd2ac6ba6076cca9520)): ?>
<?php $component = $__componentOriginal612ffe32146e3bd2ac6ba6076cca9520; ?>
<?php unset($__componentOriginal612ffe32146e3bd2ac6ba6076cca9520); ?>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/routing.blade.php ENDPATH**/ ?>
@@ -1,91 +0,0 @@
<?php if($paginator->hasPages()): ?>
<nav class="d-flex justify-items-center justify-content-between">
<div class="d-flex justify-content-between flex-fill d-sm-none">
<ul class="pagination">
<?php if($paginator->onFirstPage()): ?>
<li class="page-item disabled" aria-disabled="true">
<span class="page-link"><?php echo app('translator')->get('pagination.previous'); ?></span>
</li>
<?php else: ?>
<li class="page-item">
<a class="page-link" href="<?php echo e($paginator->previousPageUrl()); ?>" rel="prev"><?php echo app('translator')->get('pagination.previous'); ?></a>
</li>
<?php endif; ?>
<?php if($paginator->hasMorePages()): ?>
<li class="page-item">
<a class="page-link" href="<?php echo e($paginator->nextPageUrl()); ?>" rel="next"><?php echo app('translator')->get('pagination.next'); ?></a>
</li>
<?php else: ?>
<li class="page-item disabled" aria-disabled="true">
<span class="page-link"><?php echo app('translator')->get('pagination.next'); ?></span>
</li>
<?php endif; ?>
</ul>
</div>
<div class="d-none flex-sm-fill d-sm-flex align-items-sm-center justify-content-sm-between">
<div class="small text-muted">
<?php echo __('Showing'); ?>
<span class="fw-semibold"><?php echo e($paginator->firstItem()); ?></span>
<?php echo __('to'); ?>
<span class="fw-semibold"><?php echo e($paginator->lastItem()); ?></span>
<?php echo __('of'); ?>
<span class="fw-semibold"><?php echo e($paginator->total()); ?></span>
<?php echo __('results'); ?>
</div>
<div>
<ul class="pagination">
<?php if($paginator->onFirstPage()): ?>
<li class="page-item disabled" aria-disabled="true" aria-label="<?php echo app('translator')->get('pagination.previous'); ?>">
<span class="page-link" aria-hidden="true">&lsaquo;</span>
</li>
<?php else: ?>
<li class="page-item">
<a class="page-link" href="<?php echo e($paginator->previousPageUrl()); ?>" rel="prev" aria-label="<?php echo app('translator')->get('pagination.previous'); ?>">&lsaquo;</a>
</li>
<?php endif; ?>
<?php $__currentLoopData = $elements; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if(is_string($element)): ?>
<li class="page-item disabled" aria-disabled="true"><span class="page-link"><?php echo e($element); ?></span></li>
<?php endif; ?>
<?php if(is_array($element)): ?>
<?php $__currentLoopData = $element; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $page => $url): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if($page == $paginator->currentPage()): ?>
<li class="page-item active" aria-current="page"><span class="page-link"><?php echo e($page); ?></span></li>
<?php else: ?>
<li class="page-item"><a class="page-link" href="<?php echo e($url); ?>"><?php echo e($page); ?></a></li>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php if($paginator->hasMorePages()): ?>
<li class="page-item">
<a class="page-link" href="<?php echo e($paginator->nextPageUrl()); ?>" rel="next" aria-label="<?php echo app('translator')->get('pagination.next'); ?>">&rsaquo;</a>
</li>
<?php else: ?>
<li class="page-item disabled" aria-disabled="true" aria-label="<?php echo app('translator')->get('pagination.next'); ?>">
<span class="page-link" aria-hidden="true">&rsaquo;</span>
</li>
<?php endif; ?>
</ul>
</div>
</div>
</nav>
<?php endif; ?>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/bootstrap-5.blade.php ENDPATH**/ ?>
@@ -1,4 +0,0 @@
<div <?php echo e($attributes->merge(['class' => "h-0 w-full relative"])); ?>>
<div class="absolute top-[-1px] left-0 right-0 bottom-0 border-t border-dashed border-neutral-300 dark:border-white/[9%]"></div>
</div>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/separator.blade.php ENDPATH**/ ?>
@@ -1,351 +0,0 @@
<?php $__env->startSection('title', 'Modifica Mailing List'); ?>
<?php $__env->startSection('page_title', 'Modifica Mailing List'); ?>
<?php $__env->startSection('content'); ?>
<div class="card">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-edit mr-2"></i>Modifica Mailing List</h3>
</div>
<div class="card-body">
<form action="<?php echo e(url('/mailing-liste/' . $mailingList->id)); ?>" method="POST" id="ml-form">
<?php echo csrf_field(); ?> <?php echo method_field('PUT'); ?>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Nome *</label>
<input type="text" name="nome" class="form-control" value="<?php echo e($mailingList->nome); ?>" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<div class="custom-control custom-checkbox mt-4">
<input type="checkbox" class="custom-control-input" id="attiva" name="attiva" value="1" <?php echo e($mailingList->attiva ? 'checked' : ''); ?>>
<label class="custom-control-label" for="attiva">Lista attiva</label>
</div>
</div>
</div>
</div>
<div class="form-group">
<label>Descrizione</label>
<textarea name="descrizione" class="form-control" rows="2"><?php echo e($mailingList->descrizione); ?></textarea>
</div>
<hr>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Seleziona Gruppi</label>
<select name="gruppi[]" id="gruppi-select" class="form-control" multiple size="6">
</select>
<small class="text-muted">Seleziona con Ctrl/Cmd (ogni membro del gruppo sarà aggiunto)</small>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Seleziona Individui</label>
<select name="individui[]" id="individui-select" class="form-control" multiple size="6">
</select>
<small class="text-muted">Seleziona con Ctrl/Cmd</small>
</div>
</div>
</div>
<div class="form-group">
<button type="button" class="btn btn-primary" onclick="caricaSelezionati()">
<i class="fas fa-search mr-1"></i> Carica contatti
</button>
<button type="button" class="btn btn-secondary" onclick="selezionaTutti()">
<i class="fas fa-check-square mr-1"></i> Seleziona tutti
</button>
<button type="button" class="btn btn-warning" onclick="deselezionaTutti()">
<i class="fas fa-square mr-1"></i> Deseleziona tutti
</button>
</div>
<div class="form-group">
<label>Contatti da includere (<span id="contatti-count"><?php echo e($mailingList->contatti->count()); ?></span>)</label>
<div class="table-responsive" style="max-height: 400px; overflow-y: auto;">
<table class="table table-bordered table-sm">
<thead class="thead-light">
<tr>
<th style="width: 40px;">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="select-all" onchange="toggleSelectAll(this)">
<label class="custom-control-label" for="select-all"></label>
</div>
</th>
<th>Codice</th>
<th>Cognome</th>
<th>Nome</th>
<th>Email</th>
<th>Stato</th>
<th style="width: 50px;"></th>
</tr>
</thead>
<tbody id="contatti-tbody">
<?php $__currentLoopData = $mailingList->contatti; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $contact): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if($contact->individuo): ?>
<tr>
<td>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input contatto-checkbox" id="contatto-<?php echo e($contact->id); ?>" value="<?php echo e($contact->individuo->id); ?>" data-email="<?php echo e($contact->individuo->contatti->where('tipo', 'email')->first()?->valore); ?>" checked>
<label class="custom-control-label" for="contatto-<?php echo e($contact->id); ?>"></label>
</div>
</td>
<td><span class="badge badge-secondary"><?php echo e($contact->individuo->codice_id); ?></span></td>
<td><?php echo e($contact->individuo->cognome); ?></td>
<td><?php echo e($contact->individuo->nome); ?></td>
<td><?php echo e($contact->individuo->contatti->where('tipo', 'email')->first()?->valore ?: '-'); ?></td>
<td>
<?php if($contact->opt_in): ?>
<span class="badge badge-success">Iscritto</span>
<?php else: ?>
<span class="badge badge-danger">Disiscritto</span>
<?php endif; ?>
</td>
<td>
<button type="button" class="btn btn-xs btn-outline-danger" onclick="rimuoviContatto(this)">
<i class="fas fa-times"></i>
</button>
</td>
</tr>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
<small class="text-muted">Deseleziona le righe che non vuoi includere nella lista</small>
</div>
<button type="submit" class="btn btn-success">
<i class="fas fa-save mr-1"></i> Salva
</button>
<a href="<?php echo e(route('mailing-liste.index')); ?>" class="btn btn-secondary">Annulla</a>
</form>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script>
let contattiCaricati = [];
document.addEventListener('DOMContentLoaded', function() {
const csrfToken = document.querySelector('meta[name="csrf-token"]')?.content || '';
fetch('/gruppi/all', {
credentials: 'include',
headers: {
'X-CSRF-TOKEN': csrfToken,
'Accept': 'application/json'
}
})
.then(response => {
if (!response.ok) throw new Error('HTTP ' + response.status);
return response.json();
})
.then(data => {
const select = document.getElementById('gruppi-select');
console.log('Gruppi caricati:', data.length);
data.forEach(function(g) {
const option = document.createElement('option');
option.value = g.id;
option.textContent = g.full_path || g.nome;
select.appendChild(option);
});
})
.catch(function(err) {
console.error('Errore gruppi:', err);
});
fetch('/individui/all', {
credentials: 'include',
headers: {
'X-CSRF-TOKEN': csrfToken,
'Accept': 'application/json'
}
})
.then(response => {
if (!response.ok) throw new Error('HTTP ' + response.status);
return response.json();
})
.then(data => {
const select = document.getElementById('individui-select');
console.log('Individui caricati:', data.length);
data.forEach(function(ind) {
const option = document.createElement('option');
option.value = ind.id;
option.textContent = ind.codice_id + ' - ' + ind.cognome + ' ' + ind.nome;
select.appendChild(option);
});
})
.catch(function(err) {
console.error('Errore individui:', err);
});
contattiCaricati = Array.from(document.querySelectorAll('.contatto-checkbox')).map(cb => ({
individuo_id: parseInt(cb.value),
email: cb.dataset.email,
existing: true
}));
});
const csrfToken = document.querySelector('meta[name="csrf-token"]')?.content || '';
function caricaSelezionati() {
const gruppiIds = Array.from(document.getElementById('gruppi-select').selectedOptions).map(opt => parseInt(opt.value));
const individuiIds = Array.from(document.getElementById('individui-select').selectedOptions).map(opt => parseInt(opt.value));
if (gruppiIds.length === 0 && individuiIds.length === 0) {
alert('Seleziona almeno un gruppo o un individuo');
return;
}
const promises = [];
gruppiIds.forEach(function(gruppoId) {
promises.push(
fetch('/gruppi/' + gruppoId + '/individui-email', {
credentials: 'include',
headers: { 'X-CSRF-TOKEN': csrfToken }
})
.then(response => {
if (!response.ok) throw new Error('HTTP ' + response.status);
return response.json();
})
.then(data => {
data.forEach(function(ind) {
if (ind.emails && ind.emails.length > 0) {
if (!contattiCaricati.find(c => c.individuo_id === ind.id)) {
contattiCaricati.push({
individuo_id: ind.id,
codice_id: ind.codice_id,
cognome: ind.cogname,
nome: ind.nome,
email: ind.emails[0],
origini: ['Gruppo']
});
}
}
});
})
);
});
if (individuiIds.length > 0) {
promises.push(
fetch('/individui/email-list?ids=' + individuiIds.join(','), {
credentials: 'include',
headers: { 'X-CSRF-TOKEN': csrfToken }
})
.then(response => {
if (!response.ok) throw new Error('HTTP ' + response.status);
return response.json();
})
.then(data => {
data.forEach(function(ind) {
if (ind.emails && ind.emails.length > 0) {
if (!contattiCaricati.find(c => c.individuo_id === ind.id)) {
contattiCaricati.push({
individuo_id: ind.id,
codice_id: ind.codice_id,
cognome: ind.cogname,
nome: ind.nome,
email: ind.emails[0],
origini: [' Individuo']
});
}
}
});
})
);
}
Promise.all(promises).then(function() {
renderContattiTable();
}).catch(function() {
alert('Errore caricamento contatti');
});
}
function renderContattiTable() {
const tbody = document.getElementById('contatti-tbody');
tbody.innerHTML = '';
contattiCaricati.forEach(function(c, index) {
const tr = document.createElement('tr');
tr.innerHTML = `
<td>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input contatto-checkbox" id="contatto-${index}" value="${c.individuo_id}" data-email="${c.email}" checked>
<label class="custom-control-label" for="contatto-${index}"></label>
</div>
</td>
<td><span class="badge badge-secondary">${c.codice_id || ''}</span></td>
<td>${c.cognome || ''}</td>
<td>${c.nome || ''}</td>
<td>${c.email || ''}</td>
<td><small class="text-muted">${c.origini ? c.origini.join(', ') : 'Esistente'}</small></td>
<td>
<button type="button" class="btn btn-xs btn-outline-danger" onclick="rimuoviContatto(this)">
<i class="fas fa-times"></i>
</button>
</td>
`;
tbody.appendChild(tr);
});
document.getElementById('contatti-count').textContent = contattiCaricati.length;
}
function rimuoviContatto(btn) {
btn.closest('tr').remove();
const count = document.querySelectorAll('.contatto-checkbox').length;
document.getElementById('contatti-count').textContent = count;
}
function toggleSelectAll(source) {
document.querySelectorAll('.contatto-checkbox').forEach(function(cb) {
cb.checked = source.checked;
});
}
function selezionaTutti() {
document.querySelectorAll('.contatto-checkbox').forEach(function(cb) {
cb.checked = true;
});
document.getElementById('select-all').checked = true;
}
function deselezionaTutti() {
document.querySelectorAll('.contatto-checkbox').forEach(function(cb) {
cb.checked = false;
});
document.getElementById('select-all').checked = false;
}
document.getElementById('ml-form').addEventListener('submit', function(e) {
const selected = [];
document.querySelectorAll('.contatto-checkbox:checked').forEach(function(cb) {
selected.push({
individuo_id: parseInt(cb.value),
email: cb.dataset.email
});
});
if (selected.length === 0) {
e.preventDefault();
alert('Seleziona almeno un contatto con email');
return;
}
const input = document.createElement('input');
input.type = 'hidden';
input.name = 'contatti_json';
input.value = JSON.stringify(selected);
this.appendChild(input);
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/mailing-liste/edit.blade.php ENDPATH**/ ?>
@@ -1,28 +0,0 @@
<?php use \Illuminate\Foundation\Exceptions\Renderer\Renderer; ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">
<title><?php echo e(config('app.name', 'Laravel')); ?></title>
<link
rel="icon" type="image/svg+xml"
href="data:image/svg+xml,%3Csvg viewBox='0 -.11376601 49.74245785 51.31690859' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m49.626 11.564a.809.809 0 0 1 .028.209v10.972a.8.8 0 0 1 -.402.694l-9.209 5.302v10.509c0 .286-.152.55-.4.694l-19.223 11.066c-.044.025-.092.041-.14.058-.018.006-.035.017-.054.022a.805.805 0 0 1 -.41 0c-.022-.006-.042-.018-.063-.026-.044-.016-.09-.03-.132-.054l-19.219-11.066a.801.801 0 0 1 -.402-.694v-32.916c0-.072.01-.142.028-.21.006-.023.02-.044.028-.067.015-.042.029-.085.051-.124.015-.026.037-.047.055-.071.023-.032.044-.065.071-.093.023-.023.053-.04.079-.06.029-.024.055-.05.088-.069h.001l9.61-5.533a.802.802 0 0 1 .8 0l9.61 5.533h.002c.032.02.059.045.088.068.026.02.055.038.078.06.028.029.048.062.072.094.017.024.04.045.054.071.023.04.036.082.052.124.008.023.022.044.028.068a.809.809 0 0 1 .028.209v20.559l8.008-4.611v-10.51c0-.07.01-.141.028-.208.007-.024.02-.045.028-.068.016-.042.03-.085.052-.124.015-.026.037-.047.054-.071.024-.032.044-.065.072-.093.023-.023.052-.04.078-.06.03-.024.056-.05.088-.069h.001l9.611-5.533a.801.801 0 0 1 .8 0l9.61 5.533c.034.02.06.045.09.068.025.02.054.038.077.06.028.029.048.062.072.094.018.024.04.045.054.071.023.039.036.082.052.124.009.023.022.044.028.068zm-1.574 10.718v-9.124l-3.363 1.936-4.646 2.675v9.124l8.01-4.611zm-9.61 16.505v-9.13l-4.57 2.61-13.05 7.448v9.216zm-36.84-31.068v31.068l17.618 10.143v-9.214l-9.204-5.209-.003-.002-.004-.002c-.031-.018-.057-.044-.086-.066-.025-.02-.054-.036-.076-.058l-.002-.003c-.026-.025-.044-.056-.066-.084-.02-.027-.044-.05-.06-.078l-.001-.003c-.018-.03-.029-.066-.042-.1-.013-.03-.03-.058-.038-.09v-.001c-.01-.038-.012-.078-.016-.117-.004-.03-.012-.06-.012-.09v-21.483l-4.645-2.676-3.363-1.934zm8.81-5.994-8.007 4.609 8.005 4.609 8.006-4.61-8.006-4.608zm4.164 28.764 4.645-2.674v-20.096l-3.363 1.936-4.646 2.675v20.096zm24.667-23.325-8.006 4.609 8.006 4.609 8.005-4.61zm-.801 10.605-4.646-2.675-3.363-1.936v9.124l4.645 2.674 3.364 1.937zm-18.422 20.561 11.743-6.704 5.87-3.35-8-4.606-9.211 5.303-8.395 4.833z' fill='%23ff2d20'/%3E%3C/svg%3E"
/>
<?php echo Renderer::css(); ?>
</head>
<body class="font-sans antialiased overflow-x-hidden bg-neutral-50 dark:bg-neutral-900 dark:text-white scheme-light-dark">
<div class="min-h-dvh">
<?php echo e($slot); ?>
</div>
<?php echo Renderer::js(); ?>
</body>
</html>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/layout.blade.php ENDPATH**/ ?>
@@ -1,88 +0,0 @@
<?php $__env->startSection('title', 'Viste Report'); ?>
<?php $__env->startSection('page_title', 'Viste e Report Salvati'); ?>
<?php $__env->startSection('content'); ?>
<div class="card">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-table mr-2"></i>Le Tue Viste</h3>
</div>
<div class="card-body p-0">
<?php if($viste->count() > 0): ?>
<table class="table table-bordered table-hover table-striped mb-0">
<thead class="thead-light">
<tr>
<th>Nome</th>
<th style="width: 120px;">Tipo</th>
<th style="width: 100px;">Colonne</th>
<th style="width: 150px;">Creata il</th>
<th style="width: 120px;">Azioni</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $viste; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $vista): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td>
<?php if($vista->is_default): ?>
<i class="fas fa-star text-warning mr-1" title="Predefinita"></i>
<?php else: ?>
<i class="fas fa-file-alt text-primary mr-1"></i>
<?php endif; ?>
<?php echo e($vista->nome); ?>
</td>
<td>
<span class="badge badge-<?php echo e($vista->tipo === 'individui' ? 'info' : ($vista->tipo === 'gruppi' ? 'warning' : ($vista->tipo === 'documenti' ? 'success' : 'primary'))); ?>">
<?php echo e(ucfirst($vista->tipo)); ?>
</span>
</td>
<td>
<?php if($vista->colonne_visibili): ?>
<span class="badge badge-secondary"><?php echo e(count($vista->colonne_visibili)); ?></span>
<?php else: ?>
<span class="text-muted">Tutte</span>
<?php endif; ?>
</td>
<td><?php echo e($vista->created_at->format('d/m/Y H:i')); ?></td>
<td>
<a href="<?php echo e(url('/' . $vista->tipo . '?vista_id=' . $vista->id)); ?>" class="btn btn-xs btn-primary" title="Applica">
<i class="fas fa-play"></i>
</a>
<?php if(!$vista->is_default): ?>
<form action="<?php echo e(url('/viste/' . $vista->id . '/default')); ?>" method="POST" class="d-inline">
<?php echo csrf_field(); ?> <?php echo method_field('PATCH'); ?>
<button type="submit" class="btn btn-xs btn-warning" title="Imposta predefinita">
<i class="fas fa-star"></i>
</button>
</form>
<?php else: ?>
<span class="btn btn-xs btn-secondary" title="Predefinita">
<i class="fas fa-check"></i>
</span>
<?php endif; ?>
<form action="<?php echo e(url('/viste/' . $vista->id)); ?>" method="POST" class="d-inline">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Eliminare questa vista?')" title="Elimina">
<i class="fas fa-trash"></i>
</button>
</form>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
<?php else: ?>
<div class="text-center text-muted py-4">
<i class="fas fa-table fa-2x mb-2"></i>
<p class="mb-0">Nessuna vista salvata.<br>Configura una tabella e salva la vista.</p>
</div>
<?php endif; ?>
</div>
</div>
<div class="mt-3 text-muted small">
<i class="fas fa-info-circle mr-1"></i>
Per salvare una vista, configura le colonne, i filtri e l'ordinamento in una delle pagine elenco (Individui, Gruppi, Documenti, Eventi) e clicca su "Salva Vista".
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/viste/index.blade.php ENDPATH**/ ?>
@@ -1,400 +0,0 @@
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Stampa Report - <?php echo e($data['title'] ?? 'Report'); ?></title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-size: 12px;
line-height: 1.4;
color: #333;
background: #f5f5f5;
}
.toolbar {
background: #2c3e50;
color: #fff;
padding: 15px 20px;
display: flex;
align-items: center;
justify-content: space-between;
position: sticky;
top: 0;
z-index: 1000;
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.toolbar-left {
display: flex;
align-items: center;
gap: 15px;
}
.toolbar-title {
font-size: 18px;
font-weight: bold;
}
.toolbar-group {
display: flex;
align-items: center;
gap: 8px;
}
.toolbar label {
font-size: 13px;
opacity: 0.9;
}
.toolbar select {
padding: 6px 12px;
border: 1px solid #4a5568;
border-radius: 4px;
background: #4a5568;
color: #fff;
font-size: 13px;
cursor: pointer;
}
.toolbar select:focus {
outline: none;
border-color: #63b3ed;
}
.btn {
padding: 8px 16px;
border: none;
border-radius: 4px;
font-size: 13px;
font-weight: 600;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 6px;
transition: all 0.2s;
}
.btn-print {
background: #28a745;
color: #fff;
}
.btn-print:hover {
background: #218838;
}
.btn-close {
background: #dc3545;
color: #fff;
}
.btn-close:hover {
background: #c82333;
}
.btn-secondary {
background: #6c757d;
color: #fff;
}
.btn-secondary:hover {
background: #5a6268;
}
.preview-container {
max-width: 210mm;
margin: 20px auto;
background: #fff;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
padding: 20px;
}
.preview-container.portrait {
width: 210mm;
min-height: 297mm;
}
.preview-container.landscape {
width: 297mm;
min-height: 210mm;
}
.report-header {
text-align: center;
margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 2px solid #2c3e50;
}
.report-header h1 {
font-size: 24px;
color: #2c3e50;
margin-bottom: 5px;
}
.report-header .subtitle {
font-size: 14px;
color: #7f8c8d;
}
.report-summary {
background: #e8f4f8;
padding: 12px 15px;
margin-bottom: 20px;
border-left: 4px solid #17a2b8;
font-size: 13px;
}
.report-table {
width: 100%;
border-collapse: collapse;
margin-bottom: 20px;
font-size: 11px;
}
.report-table th,
.report-table td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}
.report-table th {
background: #f8f9fa;
font-weight: bold;
color: #2c3e50;
}
.report-table tr:nth-child(even) {
background: #fafafa;
}
.report-table tr:hover {
background: #f0f0f0;
}
.no-data {
text-align: center;
color: #999;
font-style: italic;
padding: 40px 20px;
}
.no-data i {
font-size: 48px;
margin-bottom: 10px;
display: block;
}
.report-footer {
margin-top: 30px;
padding-top: 15px;
border-top: 1px solid #ddd;
text-align: center;
font-size: 10px;
color: #999;
}
.row-count {
font-size: 12px;
color: #666;
margin-top: 10px;
text-align: right;
}
@page {
margin: 15mm;
}
@media print {
@page portrait {
size: portrait;
}
@page landscape {
size: landscape;
}
.toolbar {
display: none !important;
}
body {
background: #fff;
padding: 0;
}
.preview-container {
margin: 0;
box-shadow: none;
padding: 0;
max-width: none;
width: 100%;
}
.preview-container.portrait {
width: auto;
min-height: auto;
}
.preview-container.landscape {
width: auto;
min-height: auto;
}
.report-table {
page-break-inside: auto;
}
.report-table tr {
page-break-inside: avoid;
page-break-after: auto;
}
.report-table thead {
display: table-header-group;
}
.report-table tfoot {
display: table-footer-group;
}
}
</style>
</head>
<body>
<div class="toolbar" id="toolbar">
<div class="toolbar-left">
<span class="toolbar-title">Anteprima di Stampa</span>
<div class="toolbar-group">
<label for="orientation">Orientamento:</label>
<select id="orientation">
<option value="portrait">Verticale (Portrait)</option>
<option value="landscape">Orizzontale (Landscape)</option>
</select>
</div>
<div class="toolbar-group">
<label for="font-size">Dimensione font:</label>
<select id="font-size">
<option value="10">Piccolo (10px)</option>
<option value="11">Normale (11px)</option>
<option value="12" selected>Medio (12px)</option>
<option value="13">Grande (13px)</option>
</select>
</div>
</div>
<div>
<button class="btn btn-secondary" onclick="window.opener ? window.close() : window.location.href='<?php echo e(route('report.index')); ?>'">
Indietro
</button>
<button class="btn btn-print" onclick="printReport()">
Stampa
</button>
</div>
</div>
<div class="preview-container portrait" id="preview-container">
<div class="report-header">
<h1><?php echo e($data['title'] ?? 'Report'); ?></h1>
<div class="subtitle">Generato il <?php echo e(now()->format('d/m/Y H:i')); ?></div>
</div>
<?php if(!empty($data['summary'])): ?>
<div class="report-summary">
<strong><?php echo e($data['summary']); ?></strong>
</div>
<?php endif; ?>
<?php if(!empty($data['headers']) && !empty($data['rows'])): ?>
<table class="report-table" id="report-table">
<thead>
<tr>
<?php $__currentLoopData = $data['headers']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $header): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<th><?php echo e($header); ?></th>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $data['rows']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<?php $__currentLoopData = $row; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cell): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<td><?php echo e(is_array($cell) ? json_encode($cell) : $cell); ?></td>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
<div class="row-count">Totale righe: <?php echo e(count($data['rows'])); ?></div>
<?php else: ?>
<div class="no-data">
Nessun dato disponibile per questo report.
</div>
<?php endif; ?>
<div class="report-footer">
<p>Report generato automaticamente - Glastree</p>
</div>
</div>
<script>
const orientationSelect = document.getElementById('orientation');
const fontSizeSelect = document.getElementById('font-size');
const previewContainer = document.getElementById('preview-container');
const reportTable = document.getElementById('report-table');
function printReport() {
window.print();
}
orientationSelect.addEventListener('change', function() {
previewContainer.classList.remove('portrait', 'landscape');
previewContainer.classList.add(this.value);
if (this.value === 'landscape') {
document.body.classList.add('landscape-mode');
} else {
document.body.classList.remove('landscape-mode');
}
});
fontSizeSelect.addEventListener('change', function() {
const size = this.value;
document.body.style.fontSize = size + 'px';
if (reportTable) {
reportTable.style.fontSize = (parseInt(size) - 1) + 'px';
}
});
document.addEventListener('DOMContentLoaded', function() {
const savedOrientation = localStorage.getItem('report-print-orientation');
const savedFontSize = localStorage.getItem('report-print-font-size');
if (savedOrientation) {
orientationSelect.value = savedOrientation;
orientationSelect.dispatchEvent(new Event('change'));
}
if (savedFontSize) {
fontSizeSelect.value = savedFontSize;
fontSizeSelect.dispatchEvent(new Event('change'));
}
});
orientationSelect.addEventListener('change', function() {
localStorage.setItem('report-print-orientation', this.value);
});
fontSizeSelect.addEventListener('change', function() {
localStorage.setItem('report-print-font-size', this.value);
});
</script>
</body>
</html>
<?php /**PATH /var/www/html/glastree/resources/views/report/print-preview.blade.php ENDPATH**/ ?>
@@ -1,104 +0,0 @@
<?php $__env->startSection('title', 'Il Mio Profilo'); ?>
<?php $__env->startSection('page_title', 'Il Mio Profilo'); ?>
<?php $__env->startSection('breadcrumbs'); ?>
<li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>">Dashboard</a></li>
<li class="breadcrumb-item active">Profilo</li>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="row">
<div class="col-md-6">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-user mr-2"></i>Informazioni Account</h3>
</div>
<div class="card-body">
<dl class="row mb-0">
<dt class="col-sm-4">Nome</dt>
<dd class="col-sm-8"><?php echo e(e(Auth::user()->name)); ?></dd>
<dt class="col-sm-4">Email</dt>
<dd class="col-sm-8"><?php echo e(e(Auth::user()->email)); ?></dd>
<dt class="col-sm-4">Membro dal</dt>
<dd class="col-sm-8"><?php echo e(Auth::user()->created_at->format('d/m/Y')); ?></dd>
</dl>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card card-warning">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-key mr-2"></i>Cambia Password</h3>
</div>
<form method="POST" action="<?php echo e(route('profile.password')); ?>">
<?php echo csrf_field(); ?>
<?php echo method_field('PUT'); ?>
<div class="card-body">
<?php if(session('success')): ?>
<div class="alert alert-success"><?php echo e(session('success')); ?></div>
<?php endif; ?>
<?php if(session('error')): ?>
<div class="alert alert-danger"><?php echo e(session('error')); ?></div>
<?php endif; ?>
<div class="form-group">
<label for="current_password">Password attuale *</label>
<input type="password" name="current_password" id="current_password" class="form-control <?php $__errorArgs = ['current_password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" required>
<?php $__errorArgs = ['current_password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
<span class="invalid-feedback"><?php echo e($message); ?></span>
<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
</div>
<div class="form-group">
<label for="password">Nuova password *</label>
<input type="password" name="password" id="password" class="form-control <?php $__errorArgs = ['password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" required minlength="8">
<small class="text-muted">Minimo 8 caratteri</small>
<?php $__errorArgs = ['password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
<span class="invalid-feedback"><?php echo e($message); ?></span>
<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
</div>
<div class="form-group">
<label for="password_confirmation">Conferma nuova password *</label>
<input type="password" name="password_confirmation" id="password_confirmation" class="form-control" required minlength="8">
</div>
</div>
<div class="card-footer">
<button type="submit" class="btn btn-warning">
<i class="fas fa-save mr-1"></i> Aggiorna Password
</button>
</div>
</form>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/auth/profile.blade.php ENDPATH**/ ?>
@@ -1,178 +0,0 @@
<?php $__env->startSection('title', 'Invio Mailing'); ?>
<?php $__env->startSection('page_title', 'Invio Mailing'); ?>
<?php $__env->startSection('content'); ?>
<div class="row">
<div class="col-md-9">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-paper-plane mr-2"></i>Composizione Messaggio</h3>
</div>
<div class="card-body">
<form action="<?php echo e(route('mailing.invio.elabora')); ?>" method="POST" enctype="multipart/form-data">
<?php echo csrf_field(); ?>
<?php if(isset($senderAccounts) && $senderAccounts->count() > 0): ?>
<div class="form-group">
<label for="mittente_id">Mittente</label>
<select name="mittente_id" id="mittente_id" class="form-control">
<option value="">Sistema predefinito</option>
<?php $__currentLoopData = $senderAccounts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sender): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($sender->id); ?>"><?php echo e($sender->email_name ?: $sender->email_address); ?> &lt;<?php echo e($sender->email_address); ?>&gt;</option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<small class="text-muted">Seleziona un mittente per l'invio massivo.</small>
</div>
<?php endif; ?>
<div class="form-group">
<label>Liste Destinatari *</label>
<select name="liste[]" id="liste" class="form-control" multiple required size="4">
<?php $__empty_1 = true; $__currentLoopData = $liste; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lista): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<option value="<?php echo e($lista->id); ?>"><?php echo e($lista->nome); ?> (<?php echo e($lista->contatti->count()); ?> contatti)</option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<option value="">Nessuna lista disponibile</option>
<?php endif; ?>
</select>
<small class="text-muted">Seleziona una o più liste (tieni premuto Ctrl per selezioni multiple)</small>
</div>
<div class="form-group">
<label for="oggetto">Oggetto *</label>
<input type="text" name="oggetto" id="oggetto" class="form-control" required>
</div>
<div class="form-group">
<label for="corpo">Messaggio *</label>
<textarea name="corpo" id="corpo" class="form-control" rows="12" required></textarea>
</div>
<div class="form-group">
<label>Allegati</label>
<div class="border rounded p-3 bg-light">
<div class="mb-3">
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#documentiModal">
<i class="fas fa-folder-open mr-1"></i> Seleziona da Documenti
</button>
<label class="btn btn-sm btn-success mb-0">
<i class="fas fa-upload mr-1"></i> Carica nuovo file
<input type="file" name="allegato" id="allegato" class="d-none" onchange="handleFileUpload(this)">
</label>
</div>
<div id="allegati-list"></div>
<input type="hidden" name="documenti_selezionati" id="documenti_selezionati" value="">
</div>
</div>
<button type="submit" class="btn btn-primary">
<i class="fas fa-paper-plane mr-1"></i> Prepara Invio
</button>
</form>
</div>
</div>
</div>
</div>
<div class="modal fade" id="documentiModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-folder-open mr-2"></i>Seleziona Documenti</h5>
<button type="button" class="close" data-dismiss="modal">
<span>&times;</span>
</button>
</div>
<div class="modal-body">
<?php if($documenti->count() > 0): ?>
<div class="table-responsive">
<table class="table table-bordered table-hover table-sm">
<thead>
<tr>
<th style="width: 40px;"></th>
<th>Nome File</th>
<th>Tipologia</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $documenti; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $doc): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input doc-checkbox" id="doc-<?php echo e($doc->id); ?>" value="<?php echo e($doc->id); ?>" data-nome="<?php echo e($doc->nome_file); ?>">
<label class="custom-control-label" for="doc-<?php echo e($doc->id); ?>"></label>
</div>
</td>
<td><?php echo e($doc->nome_file); ?></td>
<td><span class="badge badge-info"><?php echo e($doc->tipologia ?: $doc->tipo); ?></span></td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
<?php else: ?>
<p class="text-muted">Nessun documento disponibile.</p>
<?php endif; ?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annulla</button>
<button type="button" class="btn btn-primary" onclick="aggiungiDocumenti()">
<i class="fas fa-plus mr-1"></i> Aggiungi
</button>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script>
let allegatiSelezionati = [];
function aggiungiDocumenti() {
const checkboxes = document.querySelectorAll('.doc-checkbox:checked');
checkboxes.forEach(function(cb) {
const id = parseInt(cb.value);
const nome = cb.dataset.nome;
if (!allegatiSelezionati.includes(id)) {
allegatiSelezionati.push(id);
const container = document.getElementById('allegati-list');
const div = document.createElement('div');
div.className = 'd-flex align-items-center justify-content-between bg-white p-2 mb-2 rounded';
div.id = 'allegato-' + id;
div.innerHTML = '<span><i class="fas fa-file mr-2"></i>' + nome + '</span>' +
'<button type="button" class="btn btn-xs btn-danger" onclick="removeAllegato(' + id + ')">' +
'<i class="fas fa-times"></i></button>';
container.appendChild(div);
}
cb.checked = false;
});
document.getElementById('documenti_selezionati').value = allegatiSelezionati.join(',');
$('#documentiModal').modal('hide');
}
function removeAllegato(id) {
allegatiSelezionati = allegatiSelezionati.filter(function(a) { return a !== id; });
const el = document.getElementById('allegato-' + id);
if (el) el.remove();
document.getElementById('documenti_selezionati').value = allegatiSelezionati.join(',');
}
function handleFileUpload(input) {
if (input.files && input.files[0]) {
const file = input.files[0];
const container = document.getElementById('allegati-list');
const div = document.createElement('div');
div.className = 'd-flex align-items-center justify-content-between bg-white p-2 mb-2 rounded';
div.innerHTML = '<span><i class="fas fa-file mr-2"></i>' + file.name + ' (' + (file.size / 1024).toFixed(1) + ' KB)</span>' +
'<button type="button" class="btn btn-xs btn-danger" onclick="this.parentElement.remove(); input.value=\'\';">' +
'<i class="fas fa-times"></i></button>';
container.appendChild(div);
}
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/mailing/invio.blade.php ENDPATH**/ ?>
@@ -1,79 +0,0 @@
<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;
$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames((['body']));
foreach ($attributes->all() as $__key => $__value) {
if (in_array($__key, $__propNames)) {
$$__key = $$__key ?? $__value;
} else {
$__newAttributes[$__key] = $__value;
}
}
$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);
unset($__propNames);
unset($__newAttributes);
foreach (array_filter((['body']), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
$$__key = $$__key ?? $__value;
}
$__defined_vars = get_defined_vars();
foreach ($attributes->all() as $__key => $__value) {
if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}
unset($__defined_vars, $__key, $__value); ?>
<div class="flex flex-col gap-3">
<h2 class="text-lg font-semibold">Body</h2>
<?php if($body): ?>
<div class="bg-white dark:bg-white/[2%] border border-neutral-200 dark:border-neutral-800 rounded-md overflow-x-auto p-5 text-sm font-mono shadow-xs">
<?php if (isset($component)) { $__componentOriginal12cb286571f553eebcbe98210b217f94 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal12cb286571f553eebcbe98210b217f94 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.syntax-highlight','data' => ['code' => $body,'language' => 'json']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::syntax-highlight'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['code' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($body),'language' => 'json']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal12cb286571f553eebcbe98210b217f94)): ?>
<?php $attributes = $__attributesOriginal12cb286571f553eebcbe98210b217f94; ?>
<?php unset($__attributesOriginal12cb286571f553eebcbe98210b217f94); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal12cb286571f553eebcbe98210b217f94)): ?>
<?php $component = $__componentOriginal12cb286571f553eebcbe98210b217f94; ?>
<?php unset($__componentOriginal12cb286571f553eebcbe98210b217f94); ?>
<?php endif; ?>
</div>
<?php else: ?>
<?php if (isset($component)) { $__componentOriginal612ffe32146e3bd2ac6ba6076cca9520 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal612ffe32146e3bd2ac6ba6076cca9520 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.empty-state','data' => ['message' => 'No request body']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::empty-state'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['message' => 'No request body']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal612ffe32146e3bd2ac6ba6076cca9520)): ?>
<?php $attributes = $__attributesOriginal612ffe32146e3bd2ac6ba6076cca9520; ?>
<?php unset($__attributesOriginal612ffe32146e3bd2ac6ba6076cca9520); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal612ffe32146e3bd2ac6ba6076cca9520)): ?>
<?php $component = $__componentOriginal612ffe32146e3bd2ac6ba6076cca9520; ?>
<?php unset($__componentOriginal612ffe32146e3bd2ac6ba6076cca9520); ?>
<?php endif; ?>
<?php endif; ?>
</div>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/request-body.blade.php ENDPATH**/ ?>
@@ -1,114 +0,0 @@
<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;
$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames((['exception']));
foreach ($attributes->all() as $__key => $__value) {
if (in_array($__key, $__propNames)) {
$$__key = $$__key ?? $__value;
} else {
$__newAttributes[$__key] = $__value;
}
}
$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);
unset($__propNames);
unset($__newAttributes);
foreach (array_filter((['exception']), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
$$__key = $$__key ?? $__value;
}
$__defined_vars = get_defined_vars();
foreach ($attributes->all() as $__key => $__value) {
if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}
unset($__defined_vars, $__key, $__value); ?>
<div class="flex flex-col gap-2.5 bg-neutral-50 dark:bg-white/1 border border-neutral-200 dark:border-neutral-800 rounded-xl p-2.5 shadow-xs">
<div class="flex items-center gap-2.5 p-2">
<div class="bg-white dark:bg-neutral-800 border border-neutral-200 dark:border-white/5 rounded-md w-6 h-6 flex items-center justify-center p-1">
<?php if (isset($component)) { $__componentOriginalebc8ec9a834a8051f56913d6745a7050 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalebc8ec9a834a8051f56913d6745a7050 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.icons.alert','data' => ['class' => 'w-2.5 h-2.5 text-blue-500 dark:text-emerald-500']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::icons.alert'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'w-2.5 h-2.5 text-blue-500 dark:text-emerald-500']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalebc8ec9a834a8051f56913d6745a7050)): ?>
<?php $attributes = $__attributesOriginalebc8ec9a834a8051f56913d6745a7050; ?>
<?php unset($__attributesOriginalebc8ec9a834a8051f56913d6745a7050); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalebc8ec9a834a8051f56913d6745a7050)): ?>
<?php $component = $__componentOriginalebc8ec9a834a8051f56913d6745a7050; ?>
<?php unset($__componentOriginalebc8ec9a834a8051f56913d6745a7050); ?>
<?php endif; ?>
</div>
<h3 class="text-base font-semibold text-neutral-900 dark:text-white">Exception trace</h3>
<?php if($exception->previousExceptions()->isNotEmpty()): ?>
<a href="#previous-exceptions" class="ml-auto text-sm text-neutral-500 dark:text-neutral-400 hover:text-blue-500 dark:hover:text-emerald-500 transition-colors">
<?php echo e($exception->previousExceptions()->count()); ?> previous <?php echo e(\Illuminate\Support\Str::plural('exception', $exception->previousExceptions()->count())); ?>
</a>
<?php endif; ?>
</div>
<div class="flex flex-col gap-1.5">
<?php $__currentLoopData = $exception->frameGroups(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $group): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if($group['is_vendor']): ?>
<?php if (isset($component)) { $__componentOriginal449787012edfba29f0e80f325065fad5 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal449787012edfba29f0e80f325065fad5 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.vendor-frames','data' => ['frames' => $group['frames']]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::vendor-frames'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['frames' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($group['frames'])]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal449787012edfba29f0e80f325065fad5)): ?>
<?php $attributes = $__attributesOriginal449787012edfba29f0e80f325065fad5; ?>
<?php unset($__attributesOriginal449787012edfba29f0e80f325065fad5); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal449787012edfba29f0e80f325065fad5)): ?>
<?php $component = $__componentOriginal449787012edfba29f0e80f325065fad5; ?>
<?php unset($__componentOriginal449787012edfba29f0e80f325065fad5); ?>
<?php endif; ?>
<?php else: ?>
<?php $__currentLoopData = $group['frames']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $frame): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if (isset($component)) { $__componentOriginalc7c58c6d16fe849872fb25ad6e9b8407 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalc7c58c6d16fe849872fb25ad6e9b8407 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.frame','data' => ['frame' => $frame]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::frame'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['frame' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($frame)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalc7c58c6d16fe849872fb25ad6e9b8407)): ?>
<?php $attributes = $__attributesOriginalc7c58c6d16fe849872fb25ad6e9b8407; ?>
<?php unset($__attributesOriginalc7c58c6d16fe849872fb25ad6e9b8407); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc7c58c6d16fe849872fb25ad6e9b8407)): ?>
<?php $component = $__componentOriginalc7c58c6d16fe849872fb25ad6e9b8407; ?>
<?php unset($__componentOriginalc7c58c6d16fe849872fb25ad6e9b8407); ?>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/trace.blade.php ENDPATH**/ ?>
@@ -1,6 +0,0 @@
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" <?php echo e($attributes); ?>>
<path d="M5.99996 10.6876C7.10936 10.6876 8.00871 8.58896 8.00871 6.00012C8.00871 3.41129 7.10936 1.31262 5.99996 1.31262C4.89056 1.31262 3.99121 3.41129 3.99121 6.00012C3.99121 8.58896 4.89056 10.6876 5.99996 10.6876Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M1.3125 6.00012H10.6875" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M6 10.6876C8.58883 10.6876 10.6875 8.58896 10.6875 6.00012C10.6875 3.41129 8.58883 1.31262 6 1.31262C3.41117 1.31262 1.3125 3.41129 1.3125 6.00012C1.3125 8.58896 3.41117 10.6876 6 10.6876Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/icons/globe.blade.php ENDPATH**/ ?>

Before

Width:  |  Height:  |  Size: 975 B

@@ -1,5 +0,0 @@
<?php $__env->startSection('title', __('Too Many Requests')); ?>
<?php $__env->startSection('code', '429'); ?>
<?php $__env->startSection('message', __('Too Many Requests')); ?>
<?php echo $__env->make('errors::minimal', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/429.blade.php ENDPATH**/ ?>
@@ -1,149 +0,0 @@
<?php $__env->startSection('title', 'Modifica Documento'); ?>
<?php $__env->startSection('page_title', 'Modifica Documento'); ?>
<?php $__env->startSection('content'); ?>
<form action="/documenti/<?php echo e($documento->id); ?>" method="POST">
<?php echo csrf_field(); ?> <?php echo method_field('PUT'); ?>
<div class="row">
<div class="col-md-8">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-file mr-2"></i>Dati Documento</h3>
</div>
<div class="card-body">
<div class="form-group">
<label>Nome *</label>
<input type="text" name="nome_file" class="form-control" value="<?php echo e(old('nome_file', $documento->nome_file)); ?>" required>
</div>
<div class="form-group">
<label>Tipologia *</label>
<select name="tipologia" class="form-control" required>
<?php $__currentLoopData = $tipologie; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tip): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($tip->nome); ?>" <?php echo e($documento->tipologia === $tip->nome ? 'selected' : ''); ?>><?php echo e($tip->descrizione ?? ucfirst($tip->nome)); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<div class="form-group">
<label>Contesto *</label>
<select name="contesto_tipo" id="contesto_tipo" class="form-control" onchange="aggiornaTarget()">
<option value="">Seleziona tipo...</option>
<option value="individuo" <?php echo e($documento->visibilita === 'individuo' ? 'selected' : ''); ?>>Individuo</option>
<option value="gruppo" <?php echo e($documento->visibilita === 'gruppo' ? 'selected' : ''); ?>>Gruppo</option>
<option value="evento" <?php echo e($documento->visibilita === 'evento' ? 'selected' : ''); ?>>Evento</option>
<option value="mailing" <?php echo e($documento->visibilita === 'mailing' ? 'selected' : ''); ?>>Mailing List</option>
</select>
<input type="hidden" name="visibilita" id="visibilita" value="<?php echo e($documento->visibilita); ?>">
</div>
<div class="form-group" id="target_container" style="<?php echo e(in_array($documento->visibilita, ['individuo', 'gruppo', 'evento', 'mailing']) ? '' : 'display:none;'); ?>">
<label>Riferimento *</label>
<select name="visibilita_target_id" id="visibilita_target_id" class="form-control">
<?php if($documento->visibilita === 'individuo'): ?>
<?php $__currentLoopData = $individui; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ind): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($ind->id); ?>" <?php echo e($documento->visibilita_target_id == $ind->id ? 'selected' : ''); ?>><?php echo e($ind->cognome); ?> <?php echo e($ind->nome); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php elseif($documento->visibilita === 'gruppo'): ?>
<?php $__currentLoopData = $gruppi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $grp): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($grp->id); ?>" <?php echo e($documento->visibilita_target_id == $grp->id ? 'selected' : ''); ?>><?php echo e($grp->nome); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php elseif($documento->visibilita === 'evento'): ?>
<?php $__currentLoopData = $eventi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $evt): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($evt->id); ?>" <?php echo e($documento->visibilita_target_id == $evt->id ? 'selected' : ''); ?>><?php echo e($evt->nome_evento); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php elseif($documento->visibilita === 'mailing'): ?>
<?php $__currentLoopData = $mailingLists; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ml): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($ml->id); ?>" <?php echo e($documento->visibilita_target_id == $ml->id ? 'selected' : ''); ?>><?php echo e($ml->nome); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
</select>
<input type="hidden" name="visibilita_target_type" id="visibilita_target_type" value="">
</div>
<div class="form-group">
<label>Note</label>
<textarea name="note" class="form-control" rows="3"><?php echo e(old('note', $documento->note)); ?></textarea>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-info-circle mr-2"></i>Informazioni</h3>
</div>
<div class="card-body">
<table class="table table-sm table-borderless">
<tr>
<td style="width: 100px;"><strong>File:</strong></td>
<td><?php echo e($documento->file_path); ?></td>
</tr>
<tr>
<td><strong>Tipo MIME:</strong></td>
<td><?php echo e($documento->mime_type ?? '-'); ?></td>
</tr>
<tr>
<td><strong>Dimensione:</strong></td>
<td><?php echo e($documento->dimensione ? number_format($documento->dimensione / 1024, 1) . ' KB' : '-'); ?></td>
</tr>
<tr>
<td><strong>Creato:</strong></td>
<td><?php echo e($documento->created_at->format('d/m/Y H:i')); ?></td>
</tr>
<?php if($documento->user): ?>
<tr>
<td><strong>Utente:</strong></td>
<td><?php echo e($documento->user->name); ?></td>
</tr>
<?php endif; ?>
</table>
<?php if($documento->file_path): ?>
<hr>
<a href="/documenti/<?php echo e($documento->id); ?>/download" class="btn btn-primary btn-block">
<i class="fas fa-download mr-1"></i> Scarica
</a>
<?php endif; ?>
</div>
</div>
</div>
</div>
<div class="mt-3">
<button type="submit" class="btn btn-success">
<i class="fas fa-save mr-1"></i> Salva Modifiche
</button>
<a href="/documenti" class="btn btn-secondary">
<i class="fas fa-arrow-left mr-1"></i> Torna all'elenco
</a>
</div>
</form>
<script>
function aggiornaTarget() {
var tipo = document.getElementById('contesto_tipo').value;
var container = document.getElementById('target_container');
var targetSelect = document.getElementById('visibilita_target_id');
var visibilita = document.getElementById('visibilita');
var targetType = document.getElementById('visibilita_target_type');
visibilita.value = tipo;
targetType.value = '';
if (tipo) {
container.style.display = 'block';
targetSelect.innerHTML = '<option value="">Caricamento...</option>';
var xhr = new XMLHttpRequest();
xhr.open('GET', '/documenti/options?tipo=' + tipo, true);
xhr.onload = function() {
if (xhr.status === 200) {
targetSelect.innerHTML = '<option value="">Seleziona...</option>' + xhr.responseText;
}
};
xhr.send();
} else {
container.style.display = 'none';
targetSelect.innerHTML = '<option value="">Seleziona prima il tipo...</option>';
targetSelect.value = '';
}
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/documenti/edit.blade.php ENDPATH**/ ?>
@@ -1,78 +0,0 @@
# <?php echo e($exception->class()); ?> - <?php echo $exception->title(); ?>
<?php echo $exception->message(); ?>
PHP <?php echo e(PHP_VERSION); ?>
Laravel <?php echo e(app()->version()); ?>
<?php echo e($exception->request()->httpHost()); ?>
## Stack Trace
<?php $__currentLoopData = $exception->frames(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $frame): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php echo e($index); ?> - <?php echo e($frame->file()); ?>:<?php echo e($frame->line()); ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php if($exception->previousExceptions()->isNotEmpty()): ?>
## Previous <?php echo e(\Illuminate\Support\Str::plural('exception', $exception->previousExceptions()->count())); ?>
<?php $__currentLoopData = $exception->previousExceptions(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $previous): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
### <?php echo e($index + 1); ?>. <?php echo e($previous->class()); ?>
<?php echo $previous->message(); ?>
<?php $__currentLoopData = $previous->frames(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $frame): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php echo e($index); ?> - <?php echo e($frame->file()); ?>:<?php echo e($frame->line()); ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
## Request
<?php echo e($exception->request()->method()); ?> <?php echo e(\Illuminate\Support\Str::start($exception->request()->path(), '/')); ?>
## Headers
<?php $__empty_1 = true; $__currentLoopData = $exception->requestHeaders(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
* **<?php echo e($key); ?>**: <?php echo $value; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
No header data available.
<?php endif; ?>
## Route Context
<?php $__empty_1 = true; $__currentLoopData = $exception->applicationRouteContext(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $name => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<?php echo e($name); ?>: <?php echo $value; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
No routing data available.
<?php endif; ?>
## Route Parameters
<?php if($routeParametersContext = $exception->applicationRouteParametersContext()): ?>
<?php echo $routeParametersContext; ?>
<?php else: ?>
No route parameter data available.
<?php endif; ?>
## Database Queries
<?php $__empty_1 = true; $__currentLoopData = $exception->applicationQueries(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as ['connectionName' => $connectionName, 'sql' => $sql, 'time' => $time]): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
* <?php echo e($connectionName); ?> - <?php echo $sql; ?> (<?php echo e($time); ?> ms)
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
No database queries detected.
<?php endif; ?>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/markdown.blade.php ENDPATH**/ ?>
@@ -1,61 +0,0 @@
<div
class="relative text-neutral-400 dark:text-neutral-400"
x-data="{ spotlight: { x: 0, y: 0 } }"
@mousemove="const rect = $el.getBoundingClientRect(); spotlight = { x: $event.clientX - rect.left, y: $event.clientY - rect.top }">
<div
class="absolute w-full text-neutral-800 dark:text-neutral-100"
x-data="{ isDark: window.matchMedia('(prefers-color-scheme: dark)').matches || document.documentElement.classList.contains('dark') }"
:style="
'mask-image: radial-gradient(circle at ' +
spotlight.x +
'px ' +
spotlight.y +
'px, black 0%, transparent ' + (isDark ? '150px' : '120px') + '); -webkit-mask-image: radial-gradient(circle at ' +
spotlight.x +
'px ' +
spotlight.y +
'px, black 0%, transparent ' + (isDark ? '600px' : '400px') + ');'
">
<?php if (isset($component)) { $__componentOriginal2a45ee13943eadc15ee63d255f492356 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal2a45ee13943eadc15ee63d255f492356 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.icons.laravel-ascii','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::icons.laravel-ascii'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal2a45ee13943eadc15ee63d255f492356)): ?>
<?php $attributes = $__attributesOriginal2a45ee13943eadc15ee63d255f492356; ?>
<?php unset($__attributesOriginal2a45ee13943eadc15ee63d255f492356); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal2a45ee13943eadc15ee63d255f492356)): ?>
<?php $component = $__componentOriginal2a45ee13943eadc15ee63d255f492356; ?>
<?php unset($__componentOriginal2a45ee13943eadc15ee63d255f492356); ?>
<?php endif; ?>
</div>
<?php if (isset($component)) { $__componentOriginal2a45ee13943eadc15ee63d255f492356 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal2a45ee13943eadc15ee63d255f492356 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.icons.laravel-ascii','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::icons.laravel-ascii'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal2a45ee13943eadc15ee63d255f492356)): ?>
<?php $attributes = $__attributesOriginal2a45ee13943eadc15ee63d255f492356; ?>
<?php unset($__attributesOriginal2a45ee13943eadc15ee63d255f492356); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal2a45ee13943eadc15ee63d255f492356)): ?>
<?php $component = $__componentOriginal2a45ee13943eadc15ee63d255f492356; ?>
<?php unset($__componentOriginal2a45ee13943eadc15ee63d255f492356); ?>
<?php endif; ?>
</div>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/laravel-ascii-spotlight.blade.php ENDPATH**/ ?>
@@ -1,4 +0,0 @@
<svg width="6" height="10" viewBox="0 0 6 10" fill="none" xmlns="http://www.w3.org/2000/svg" <?php echo e($attributes); ?>>
<path d="M0.875 9.25L5.125 5L0.875 0.75" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/icons/chevron-right.blade.php ENDPATH**/ ?>

Before

Width:  |  Height:  |  Size: 419 B

@@ -1,98 +0,0 @@
<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;
$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames(([
'code',
'language',
'editor' => false,
'startingLine' => 1,
'highlightedLine' => null,
'truncate' => false,
]));
foreach ($attributes->all() as $__key => $__value) {
if (in_array($__key, $__propNames)) {
$$__key = $$__key ?? $__value;
} else {
$__newAttributes[$__key] = $__value;
}
}
$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);
unset($__propNames);
unset($__newAttributes);
foreach (array_filter(([
'code',
'language',
'editor' => false,
'startingLine' => 1,
'highlightedLine' => null,
'truncate' => false,
]), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
$$__key = $$__key ?? $__value;
}
$__defined_vars = get_defined_vars();
foreach ($attributes->all() as $__key => $__value) {
if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}
unset($__defined_vars, $__key, $__value); ?>
<?php
$fallback = $truncate ? '<pre class="truncate"><code>' : '<pre><code>';
if ($editor) {
$lines = explode("\n", $code);
foreach ($lines as $index => $line) {
$lineNumber = $startingLine + $index;
$highlight = $highlightedLine === $index;
$lineClass = implode(' ', [
'block px-4 py-1 h-7 even:bg-white odd:bg-white/2 even:dark:bg-white/2 odd:dark:bg-white/4',
$highlight ? 'bg-rose-200! dark:bg-rose-900!' : '',
]);
$lineNumberClass = implode(' ', [
'mr-6 text-neutral-500! dark:text-neutral-600!',
$highlight ? 'dark:text-white!' : '',
]);
$fallback .= '<span class="' . $lineClass . '">';
$fallback .= '<span class="' . $lineNumberClass . '">' . $lineNumber . '</span>';
$fallback .= htmlspecialchars($line);
$fallback .= '</span>';
}
} else {
$fallback .= htmlspecialchars($code);
}
$fallback .= '</code></pre>';
?>
<div
x-data="{ highlightedCode: null }"
x-init="
highlightedCode = window.highlight(
<?php echo e(Illuminate\Support\Js::from($code)); ?>,
<?php echo e(Illuminate\Support\Js::from($language)); ?>,
<?php echo e(Illuminate\Support\Js::from($truncate)); ?>,
<?php echo e(Illuminate\Support\Js::from($editor)); ?>,
<?php echo e(Illuminate\Support\Js::from($startingLine)); ?>,
<?php echo e(Illuminate\Support\Js::from($highlightedLine)); ?>
);
"
<?php echo e($attributes); ?>
>
<div
x-cloak
x-html="highlightedCode"
></div>
<div x-show="!highlightedCode"><?php echo $fallback; ?></div>
</div>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/syntax-highlight.blade.php ENDPATH**/ ?>
@@ -1,5 +0,0 @@
<?php $__env->startSection('title', __('Service Unavailable')); ?>
<?php $__env->startSection('code', '503'); ?>
<?php $__env->startSection('message', __('Service Unavailable')); ?>
<?php echo $__env->make('errors::minimal', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/503.blade.php ENDPATH**/ ?>
@@ -1,170 +0,0 @@
<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;
$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames((['frames']));
foreach ($attributes->all() as $__key => $__value) {
if (in_array($__key, $__propNames)) {
$$__key = $$__key ?? $__value;
} else {
$__newAttributes[$__key] = $__value;
}
}
$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);
unset($__propNames);
unset($__newAttributes);
foreach (array_filter((['frames']), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
$$__key = $$__key ?? $__value;
}
$__defined_vars = get_defined_vars();
foreach ($attributes->all() as $__key => $__value) {
if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}
unset($__defined_vars, $__key, $__value); ?>
<?php use \Illuminate\Support\Str; ?>
<div
x-data="{ expanded: false }"
class="group rounded-lg border border-neutral-200 dark:border-white/5"
:class="{
'bg-white dark:bg-white/5 shadow-xs': expanded,
'border-dashed border-neutral-300 bg-neutral-50 opacity-90 dark:border-white/10 dark:bg-white/1': !expanded,
}"
>
<div
class="flex h-11 cursor-pointer items-center gap-3 rounded-lg pr-2.5 pl-4 hover:bg-white/50 dark:hover:bg-white/2"
@click="expanded = !expanded"
>
<?php if (isset($component)) { $__componentOriginal6936650fa23142238a13a0689c4bfe24 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal6936650fa23142238a13a0689c4bfe24 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.icons.folder','data' => ['class' => 'w-3 h-3 text-neutral-400','xShow' => '!expanded','xCloak' => true]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::icons.folder'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'w-3 h-3 text-neutral-400','x-show' => '!expanded','x-cloak' => true]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal6936650fa23142238a13a0689c4bfe24)): ?>
<?php $attributes = $__attributesOriginal6936650fa23142238a13a0689c4bfe24; ?>
<?php unset($__attributesOriginal6936650fa23142238a13a0689c4bfe24); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal6936650fa23142238a13a0689c4bfe24)): ?>
<?php $component = $__componentOriginal6936650fa23142238a13a0689c4bfe24; ?>
<?php unset($__componentOriginal6936650fa23142238a13a0689c4bfe24); ?>
<?php endif; ?>
<?php if (isset($component)) { $__componentOriginal94e6c9aa0eb2b7a85f88307a3371880e = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal94e6c9aa0eb2b7a85f88307a3371880e = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.icons.folder-open','data' => ['class' => 'w-3 h-3 text-blue-500 dark:text-emerald-500','xShow' => 'expanded']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::icons.folder-open'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'w-3 h-3 text-blue-500 dark:text-emerald-500','x-show' => 'expanded']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal94e6c9aa0eb2b7a85f88307a3371880e)): ?>
<?php $attributes = $__attributesOriginal94e6c9aa0eb2b7a85f88307a3371880e; ?>
<?php unset($__attributesOriginal94e6c9aa0eb2b7a85f88307a3371880e); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal94e6c9aa0eb2b7a85f88307a3371880e)): ?>
<?php $component = $__componentOriginal94e6c9aa0eb2b7a85f88307a3371880e; ?>
<?php unset($__componentOriginal94e6c9aa0eb2b7a85f88307a3371880e); ?>
<?php endif; ?>
<div class="flex-1 font-mono text-xs leading-3 text-neutral-900 dark:text-neutral-400">
<?php echo e(count($frames)); ?> vendor <?php echo e(Str::plural('frame', count($frames))); ?>
</div>
<button
x-cloak
type="button"
class="flex h-6 w-6 cursor-pointer items-center justify-center rounded-md dark:border dark:border-white/8 group-hover:text-blue-500 group-hover:dark:text-emerald-500"
:class="{
'text-blue-500 dark:text-emerald-500 dark:bg-white/5': expanded,
'text-neutral-500 dark:text-neutral-500 dark:bg-white/3': !expanded,
}"
>
<?php if (isset($component)) { $__componentOriginal4400c4a71d3ea90a0e0b846e7d689a28 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal4400c4a71d3ea90a0e0b846e7d689a28 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.icons.chevrons-down-up','data' => ['xShow' => 'expanded']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::icons.chevrons-down-up'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['x-show' => 'expanded']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal4400c4a71d3ea90a0e0b846e7d689a28)): ?>
<?php $attributes = $__attributesOriginal4400c4a71d3ea90a0e0b846e7d689a28; ?>
<?php unset($__attributesOriginal4400c4a71d3ea90a0e0b846e7d689a28); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal4400c4a71d3ea90a0e0b846e7d689a28)): ?>
<?php $component = $__componentOriginal4400c4a71d3ea90a0e0b846e7d689a28; ?>
<?php unset($__componentOriginal4400c4a71d3ea90a0e0b846e7d689a28); ?>
<?php endif; ?>
<?php if (isset($component)) { $__componentOriginal7348bb70f498d75e0a91acc6a707f136 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal7348bb70f498d75e0a91acc6a707f136 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.icons.chevrons-up-down','data' => ['xShow' => '!expanded']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::icons.chevrons-up-down'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['x-show' => '!expanded']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal7348bb70f498d75e0a91acc6a707f136)): ?>
<?php $attributes = $__attributesOriginal7348bb70f498d75e0a91acc6a707f136; ?>
<?php unset($__attributesOriginal7348bb70f498d75e0a91acc6a707f136); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal7348bb70f498d75e0a91acc6a707f136)): ?>
<?php $component = $__componentOriginal7348bb70f498d75e0a91acc6a707f136; ?>
<?php unset($__componentOriginal7348bb70f498d75e0a91acc6a707f136); ?>
<?php endif; ?>
</button>
</div>
<div x-cloak class="flex flex-col rounded-b-lg divide-y divide-neutral-200 border-t border-neutral-200 dark:divide-white/5 dark:border-white/5" x-show="expanded">
<?php $__currentLoopData = $frames; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $frame): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="flex flex-col divide-y divide-neutral-200 dark:divide-white/5">
<?php if (isset($component)) { $__componentOriginal96f0b6f4219e16dc62468d91b0335b32 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal96f0b6f4219e16dc62468d91b0335b32 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.vendor-frame','data' => ['frame' => $frame]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::vendor-frame'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['frame' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($frame)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal96f0b6f4219e16dc62468d91b0335b32)): ?>
<?php $attributes = $__attributesOriginal96f0b6f4219e16dc62468d91b0335b32; ?>
<?php unset($__attributesOriginal96f0b6f4219e16dc62468d91b0335b32); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal96f0b6f4219e16dc62468d91b0335b32)): ?>
<?php $component = $__componentOriginal96f0b6f4219e16dc62468d91b0335b32; ?>
<?php unset($__componentOriginal96f0b6f4219e16dc62468d91b0335b32); ?>
<?php endif; ?>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/vendor-frames.blade.php ENDPATH**/ ?>
@@ -1,398 +0,0 @@
<?php $__env->startSection('title', 'Modifica Evento'); ?>
<?php $__env->startSection('page_title', 'Modifica Evento'); ?>
<?php $__env->startSection('content'); ?>
<form action="/eventi/<?php echo e($evento->id); ?>" method="POST" id="mainForm">
<?php echo csrf_field(); ?> <?php echo method_field('PUT'); ?>
<div class="row">
<div class="col-md-8">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-calendar mr-2"></i>Dati Evento</h3>
</div>
<div class="card-body">
<div class="form-group">
<label>Nome Evento *</label>
<input type="text" name="nome_evento" class="form-control" value="<?php echo e(old('nome_evento', $evento->nome_evento)); ?>" required>
</div>
<div class="form-group">
<label>Descrizione Breve</label>
<input type="text" name="descrizione_evento" class="form-control" value="<?php echo e(old('descrizione_evento', $evento->descrizione_evento)); ?>">
</div>
<div class="form-group">
<label>Tipo Evento</label>
<select name="tipo_evento" class="form-control">
<option value="">Seleziona tipo...</option>
<?php $__currentLoopData = $tipologieEventi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tipo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($tipo->nome); ?>" <?php echo e(old('tipo_evento', $evento->tipo_evento) === $tipo->nome ? 'selected' : ''); ?>>
<?php echo e($tipo->descrizione ?: $tipo->nome); ?>
</option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php if($evento->tipo_evento && !\App\Models\TipologiaEvento::where('nome', $evento->tipo_evento)->exists()): ?>
<option value="<?php echo e($evento->tipo_evento); ?>" selected>
<?php echo e($evento->tipo_evento); ?> (disattivato)
</option>
<?php endif; ?>
</select>
</div>
<div class="form-group">
<label>Descrizione Completa</label>
<textarea name="descrizione" class="form-control" rows="3"><?php echo e(old('descrizione', $evento->descrizione)); ?></textarea>
</div>
<div class="form-group">
<label>Note</label>
<textarea name="note" class="form-control" rows="2"><?php echo e(old('note', $evento->note)); ?></textarea>
</div>
<div class="form-group">
<label>
<input type="checkbox" name="is_incontro_gruppo" value="1" <?php echo e($evento->is_incontro_gruppo ? 'checked' : ''); ?>>
Questo evento è il giorno di incontro del gruppo
</label>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-header"><h3 class="card-title"><i class="fas fa-clock mr-2"></i>Data e Orario</h3></div>
<div class="card-body">
<div class="form-group">
<label>Tipo Ricorrenza</label>
<select name="tipo_recorrenza" id="tipo_recorrenza" class="form-control" onchange="toggleRicorrenza()">
<option value="singolo" <?php echo e(old('tipo_recorrenza', $evento->tipo_recorrenza) === 'singolo' || old('tipo_recorrenza', $evento->tipo_recorrenza) === null ? 'selected' : ''); ?>>Singolo</option>
<option value="settimanale" <?php echo e(old('tipo_recorrenza', $evento->tipo_recorrenza) === 'settimanale' ? 'selected' : ''); ?>>Settimanale</option>
<option value="mensile" <?php echo e(old('tipo_recorrenza', $evento->tipo_recorrenza) === 'mensile' ? 'selected' : ''); ?>>Mensile</option>
<option value="annuale" <?php echo e(old('tipo_recorrenza', $evento->tipo_recorrenza) === 'annuale' ? 'selected' : ''); ?>>Annuale</option>
<option value="altro" <?php echo e(old('tipo_recorrenza', $evento->tipo_recorrenza) === 'altro' ? 'selected' : ''); ?>>Altro</option>
</select>
</div>
<div id="data_specifica_field" style="<?php echo e(in_array($evento->tipo_recorrenza, [null, 'singolo']) ? '' : 'display:none;'); ?>">
<div class="form-group">
<label>Data Evento</label>
<input type="date" name="data_specifica" class="form-control" value="<?php echo e(old('data_specifica', $evento->data_specifica?->format('Y-m-d'))); ?>">
</div>
</div>
<div id="settimanale_field" style="<?php echo e($evento->tipo_recorrenza === 'settimanale' ? '' : 'display:none;'); ?>">
<div class="form-group">
<label>Giorno della Settimana</label>
<select name="giorno_settimana" class="form-control">
<option value="">Seleziona...</option>
<option value="0" <?php echo e($evento->giorno_settimana == 0 ? 'selected' : ''); ?>>Domenica</option>
<option value="1" <?php echo e($evento->giorno_settimana == 1 ? 'selected' : ''); ?>>Lunedì</option>
<option value="2" <?php echo e($evento->giorno_settimana == 2 ? 'selected' : ''); ?>>Martedì</option>
<option value="3" <?php echo e($evento->giorno_settimana == 3 ? 'selected' : ''); ?>>Mercoledì</option>
<option value="4" <?php echo e($evento->giorno_settimana == 4 ? 'selected' : ''); ?>>Giovedì</option>
<option value="5" <?php echo e($evento->giorno_settimana == 5 ? 'selected' : ''); ?>>Venerdì</option>
<option value="6" <?php echo e($evento->giorno_settimana == 6 ? 'selected' : ''); ?>>Sabato</option>
</select>
</div>
</div>
<div id="mensile_field" style="<?php echo e($evento->tipo_recorrenza === 'mensile' ? '' : 'display:none;'); ?>">
<div class="form-group">
<label>Occorrenza nel mese</label>
<?php
$occorrenzaSelezionata = old('occorrenza_mese', $evento->occorrenza_mese);
?>
<select name="occorrenza_mese" class="form-control">
<option value="">Seleziona...</option>
<option value="1,1" <?php echo e($occorrenzaSelezionata === '1,1' ? 'selected' : ''); ?>>1° Lunedì</option>
<option value="1,2" <?php echo e($occorrenzaSelezionata === '1,2' ? 'selected' : ''); ?>>1° Martedì</option>
<option value="1,3" <?php echo e($occorrenzaSelezionata === '1,3' ? 'selected' : ''); ?>>1° Mercoledì</option>
<option value="1,4" <?php echo e($occorrenzaSelezionata === '1,4' ? 'selected' : ''); ?>>1° Giovedì</option>
<option value="1,5" <?php echo e($occorrenzaSelezionata === '1,5' ? 'selected' : ''); ?>>1° Venerdì</option>
<option value="1,6" <?php echo e($occorrenzaSelezionata === '1,6' ? 'selected' : ''); ?>>1° Sabato</option>
<option value="1,0" <?php echo e($occorrenzaSelezionata === '1,0' ? 'selected' : ''); ?>>1° Domenica</option>
<option value="2,1" <?php echo e($occorrenzaSelezionata === '2,1' ? 'selected' : ''); ?>>2° Lunedì</option>
<option value="2,2" <?php echo e($occorrenzaSelezionata === '2,2' ? 'selected' : ''); ?>>2° Martedì</option>
<option value="2,3" <?php echo e($occorrenzaSelezionata === '2,3' ? 'selected' : ''); ?>>2° Mercoledì</option>
<option value="2,4" <?php echo e($occorrenzaSelezionata === '2,4' ? 'selected' : ''); ?>>2° Giovedì</option>
<option value="2,5" <?php echo e($occorrenzaSelezionata === '2,5' ? 'selected' : ''); ?>>2° Venerdì</option>
<option value="2,6" <?php echo e($occorrenzaSelezionata === '2,6' ? 'selected' : ''); ?>>2° Sabato</option>
<option value="2,0" <?php echo e($occorrenzaSelezionata === '2,0' ? 'selected' : ''); ?>>2° Domenica</option>
<option value="3,1" <?php echo e($occorrenzaSelezionata === '3,1' ? 'selected' : ''); ?>>3° Lunedì</option>
<option value="3,2" <?php echo e($occorrenzaSelezionata === '3,2' ? 'selected' : ''); ?>>3° Martedì</option>
<option value="3,3" <?php echo e($occorrenzaSelezionata === '3,3' ? 'selected' : ''); ?>>3° Mercoledì</option>
<option value="3,4" <?php echo e($occorrenzaSelezionata === '3,4' ? 'selected' : ''); ?>>3° Giovedì</option>
<option value="3,5" <?php echo e($occorrenzaSelezionata === '3,5' ? 'selected' : ''); ?>>3° Venerdì</option>
<option value="3,6" <?php echo e($occorrenzaSelezionata === '3,6' ? 'selected' : ''); ?>>3° Sabato</option>
<option value="3,0" <?php echo e($occorrenzaSelezionata === '3,0' ? 'selected' : ''); ?>>3° Domenica</option>
<option value="4,1" <?php echo e($occorrenzaSelezionata === '4,1' ? 'selected' : ''); ?>>4° Lunedì</option>
<option value="4,2" <?php echo e($occorrenzaSelezionata === '4,2' ? 'selected' : ''); ?>>4° Martedì</option>
<option value="4,3" <?php echo e($occorrenzaSelezionata === '4,3' ? 'selected' : ''); ?>>4° Mercoledì</option>
<option value="4,4" <?php echo e($occorrenzaSelezionata === '4,4' ? 'selected' : ''); ?>>4° Giovedì</option>
<option value="4,5" <?php echo e($occorrenzaSelezionata === '4,5' ? 'selected' : ''); ?>>4° Venerdì</option>
<option value="4,6" <?php echo e($occorrenzaSelezionata === '4,6' ? 'selected' : ''); ?>>4° Sabato</option>
<option value="4,0" <?php echo e($occorrenzaSelezionata === '4,0' ? 'selected' : ''); ?>>4° Domenica</option>
</select>
</div>
<div class="form-group">
<label>Mesi (multipli)</label>
<?php
$mesiSelezionati = $evento->mesi_recorrenza ? explode(',', $evento->mesi_recorrenza) : [];
?>
<select name="mesi_recorrenza[]" class="form-control" multiple size="4">
<option value="1" <?php echo e(in_array('1', $mesiSelezionati) ? 'selected' : ''); ?>>Gennaio</option>
<option value="2" <?php echo e(in_array('2', $mesiSelezionati) ? 'selected' : ''); ?>>Febbraio</option>
<option value="3" <?php echo e(in_array('3', $mesiSelezionati) ? 'selected' : ''); ?>>Marzo</option>
<option value="4" <?php echo e(in_array('4', $mesiSelezionati) ? 'selected' : ''); ?>>Aprile</option>
<option value="5" <?php echo e(in_array('5', $mesiSelezionati) ? 'selected' : ''); ?>>Maggio</option>
<option value="6" <?php echo e(in_array('6', $mesiSelezionati) ? 'selected' : ''); ?>>Giugno</option>
<option value="7" <?php echo e(in_array('7', $mesiSelezionati) ? 'selected' : ''); ?>>Luglio</option>
<option value="8" <?php echo e(in_array('8', $mesiSelezionati) ? 'selected' : ''); ?>>Agosto</option>
<option value="9" <?php echo e(in_array('9', $mesiSelezionati) ? 'selected' : ''); ?>>Settembre</option>
<option value="10" <?php echo e(in_array('10', $mesiSelezionati) ? 'selected' : ''); ?>>Ottobre</option>
<option value="11" <?php echo e(in_array('11', $mesiSelezionati) ? 'selected' : ''); ?>>Novembre</option>
<option value="12" <?php echo e(in_array('12', $mesiSelezionati) ? 'selected' : ''); ?>>Dicembre</option>
</select>
<small class="form-text text-muted">Ctrl+clic per selezionare più mesi</small>
</div>
</div>
<div id="annuale_field" style="<?php echo e($evento->tipo_recorrenza === 'annuale' ? '' : 'display:none;'); ?>">
<div class="form-group">
<label>Mese</label>
<select name="mese_annuale" class="form-control">
<option value="">Seleziona mese...</option>
<option value="1" <?php echo e(old('mese_annuale', $evento->mese_annuale) == '1' ? 'selected' : ''); ?>>Gennaio</option>
<option value="2" <?php echo e(old('mese_annuale', $evento->mese_annuale) == '2' ? 'selected' : ''); ?>>Febbraio</option>
<option value="3" <?php echo e(old('mese_annuale', $evento->mese_annuale) == '3' ? 'selected' : ''); ?>>Marzo</option>
<option value="4" <?php echo e(old('mese_annuale', $evento->mese_annuale) == '4' ? 'selected' : ''); ?>>Aprile</option>
<option value="5" <?php echo e(old('mese_annuale', $evento->mese_annuale) == '5' ? 'selected' : ''); ?>>Maggio</option>
<option value="6" <?php echo e(old('mese_annuale', $evento->mese_annuale) == '6' ? 'selected' : ''); ?>>Giugno</option>
<option value="7" <?php echo e(old('mese_annuale', $evento->mese_annuale) == '7' ? 'selected' : ''); ?>>Luglio</option>
<option value="8" <?php echo e(old('mese_annuale', $evento->mese_annuale) == '8' ? 'selected' : ''); ?>>Agosto</option>
<option value="9" <?php echo e(old('mese_annuale', $evento->mese_annuale) == '9' ? 'selected' : ''); ?>>Settembre</option>
<option value="10" <?php echo e(old('mese_annuale', $evento->mese_annuale) == '10' ? 'selected' : ''); ?>>Ottobre</option>
<option value="11" <?php echo e(old('mese_annuale', $evento->mese_annuale) == '11' ? 'selected' : ''); ?>>Novembre</option>
<option value="12" <?php echo e(old('mese_annuale', $evento->mese_annuale) == '12' ? 'selected' : ''); ?>>Dicembre</option>
</select>
</div>
<div class="form-group">
<label>Giorno del Mese</label>
<select name="giorno_mese" class="form-control">
<option value="">Seleziona giorno...</option>
<?php for($d = 1; $d <= 31; $d++): ?>
<option value="<?php echo e($d); ?>" <?php echo e(old('giorno_mese', $evento->giorno_mese) == $d ? 'selected' : ''); ?>><?php echo e($d); ?></option>
<?php endfor; ?>
</select>
<small class="form-text text-muted">Se il giorno non esiste nel mese selezionato, verrà usato l'ultimo giorno disponibile</small>
</div>
</div>
<div class="form-group">
<label>Ora Inizio</label>
<input type="time" name="ora_inizio" class="form-control" value="<?php echo e(old('ora_inizio', $evento->ora_inizio?->format('H:i'))); ?>">
</div>
<div class="form-group mb-0">
<label>Durata (minuti)</label>
<input type="number" name="durata_minuti" class="form-control" value="<?php echo e(old('durata_minuti', $evento->durata_minuti ?? 60)); ?>" min="1">
</div>
</div>
</div>
<div class="card mt-3">
<div class="card-header"><h3 class="card-title"><i class="fas fa-map-marker-alt mr-2"></i>Dove</h3></div>
<div class="card-body">
<div class="form-group">
<label>Indirizzo</label>
<input type="text" name="luogo_indirizzo" class="form-control" value="<?php echo e(old('luogo_indirizzo', $evento->luogo_indirizzo)); ?>" placeholder="Via, numero civico, CAP, città">
</div>
<div class="form-group mb-0">
<label>URL Google Maps</label>
<input type="url" name="luogo_url_maps" class="form-control" value="<?php echo e(old('luogo_url_maps', $evento->luogo_url_maps)); ?>" placeholder="https://maps.google.com/...">
<small class="form-text text-muted">Incolla il link di Google Maps per attivare l'anteprima</small>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="card">
<div class="card-header"><h3 class="card-title"><i class="fas fa-folder mr-2"></i>Gruppi</h3></div>
<div class="card-body">
<div class="form-group mb-0">
<select name="gruppi[]" class="form-control" multiple size="8">
<?php $__currentLoopData = $gruppi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $g): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($g->id); ?>" <?php echo e($evento->gruppi->contains($g->id) ? 'selected' : ''); ?>>
<?php echo e($g->full_path); ?>
</option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<small class="form-text text-muted">Tieni premuto Ctrl per selezionare più gruppi</small>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-header"><h3 class="card-title"><i class="fas fa-user mr-2"></i>Responsabili</h3></div>
<div class="card-body">
<div class="form-group mb-0">
<select name="responsabili[]" class="form-control" multiple size="8">
<?php $__currentLoopData = $individui; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($i->id); ?>" <?php echo e($evento->responsabili->contains($i->id) ? 'selected' : ''); ?>>
<?php echo e($i->cognome); ?> <?php echo e($i->nome); ?>
<?php if($i->telefono_primario): ?>
(<?php echo e($i->telefono_primario); ?>)
<?php endif; ?>
</option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<small class="form-text text-muted">Tieni premuto Ctrl per selezionare più responsabili</small>
</div>
</div>
</div>
</div>
</div>
<div class="mt-3">
<button type="submit" class="btn btn-success">
<i class="fas fa-save mr-1"></i> Salva Modifiche
</button>
<a href="/eventi/<?php echo e($evento->id); ?>" class="btn btn-secondary">
<i class="fas fa-times mr-1"></i> Annulla
</a>
</div>
</form>
<div class="card mt-3">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-file mr-2"></i>Documenti</h3>
<button type="button" class="btn btn-xs btn-success float-right" onclick="showDocumentoForm()">
<i class="fas fa-plus mr-1"></i> Carica
</button>
</div>
<div class="card-body p-0">
<div id="documento-add-form" style="display:none;" class="p-3 bg-light border-bottom">
<form action="/eventi/<?php echo e($evento->id); ?>/documenti" method="POST" enctype="multipart/form-data" class="mb-0">
<?php echo csrf_field(); ?>
<div class="row">
<div class="col-md-4">
<input type="text" name="nome_file" class="form-control form-control-sm" placeholder="Nome documento" required>
</div>
<div class="col-md-3">
<select name="tipologia" class="form-control form-control-sm" required>
<option value="">Tipologia...</option>
<option value="documento">Documento</option>
<option value="programma">Programma</option>
<option value="locandina">Locandina</option>
<option value="altro">Altro</option>
</select>
</div>
<div class="col-md-4">
<input type="file" name="file" class="form-control form-control-sm" required>
</div>
<div class="col-md-1">
<button type="submit" class="btn btn-xs btn-success"><i class="fas fa-upload mr-1"></i>Carica</button>
<button type="button" class="btn btn-xs btn-secondary" onclick="hideDocumentoForm()"><i class="fas fa-times"></i></button>
</div>
</div>
</form>
</div>
<?php if($evento->documenti && $evento->documenti->count() > 0): ?>
<table class="table table-bordered table-hover table-striped mb-0">
<thead class="thead-light">
<tr>
<th>Nome</th>
<th style="width: 120px;">Tipologia</th>
<th style="width: 80px;">Dimensione</th>
<th style="width: 130px;">Data Upload</th>
<th style="width: 80px;">Azioni</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $evento->documenti; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $documento): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td>
<i class="fas fa-file text-secondary mr-1"></i>
<?php echo e($documento->nome_file); ?>
</td>
<td><?php echo e(ucfirst($documento->tipologia)); ?></td>
<td><?php echo e(number_format($documento->dimensione / 1024, 1)); ?> KB</td>
<td><?php echo e($documento->created_at->format('d/m/Y')); ?></td>
<td>
<?php if($documento->file_path): ?>
<button type="button" class="btn btn-xs btn-primary" onclick="previewDocumento(<?php echo e($documento->id); ?>)" title="Anteprima">
<i class="fas fa-eye"></i>
</button>
<?php endif; ?>
<form action="/eventi/<?php echo e($evento->id); ?>/documenti/<?php echo e($documento->id); ?>" method="POST" class="d-inline">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Eliminare questo documento?')" title="Elimina">
<i class="fas fa-trash"></i>
</button>
</form>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
<?php else: ?>
<div class="text-center text-muted py-4">
<i class="fas fa-file fa-2x mb-2"></i>
<p class="mb-0">Nessun documento</p>
</div>
<?php endif; ?>
</div>
</div>
<?php $__env->stopSection(); ?>
<div class="modal fade" id="previewModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document" style="max-width: 90vw;">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-file mr-2"></i><span id="previewModalTitle">Anteprima</span></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Chiudi">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body text-center p-0" style="min-height: 400px;">
<iframe id="previewFrame" src="" style="width: 100%; height: 70vh; border: none;"></iframe>
</div>
<div class="modal-footer">
<a id="previewDownloadBtn" href="#" class="btn btn-primary" download>
<i class="fas fa-download mr-1"></i> Scarica
</a>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Chiudi</button>
</div>
</div>
</div>
</div>
<?php $__env->startSection('scripts'); ?>
<script>
function toggleRicorrenza() {
var tipo = document.getElementById('tipo_recorrenza').value;
document.getElementById('data_specifica_field').style.display = tipo === 'singolo' ? 'block' : 'none';
document.getElementById('settimanale_field').style.display = tipo === 'settimanale' ? 'block' : 'none';
document.getElementById('mensile_field').style.display = tipo === 'mensile' ? 'block' : 'none';
document.getElementById('annuale_field').style.display = tipo === 'annuale' ? 'block' : 'none';
}
function showDocumentoForm() {
document.getElementById('documento-add-form').style.display = 'block';
}
function hideDocumentoForm() {
document.getElementById('documento-add-form').style.display = 'none';
}
function previewDocumento(id) {
document.getElementById('previewFrame').src = '/documenti/' + id + '/preview';
document.getElementById('previewDownloadBtn').href = '/documenti/' + id + '/download';
$('#previewModal').modal('show');
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/eventi/edit.blade.php ENDPATH**/ ?>
@@ -1,5 +0,0 @@
<?php $__env->startSection('title', __('Not Found')); ?>
<?php $__env->startSection('code', '404'); ?>
<?php $__env->startSection('message', __('Not Found')); ?>
<?php echo $__env->make('errors::minimal', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/404.blade.php ENDPATH**/ ?>
File diff suppressed because one or more lines are too long
@@ -1,131 +0,0 @@
<?php $__env->startSection('title', $message->subject ?: 'Email'); ?>
<?php $__env->startSection('page_title', 'Visualizza Email'); ?>
<?php $__env->startSection('content'); ?>
<div class="row">
<div class="col-md-3">
<div class="card card-primary">
<div class="card-body p-0">
<div class="list-group list-group-flush">
<a href="<?php echo e(route('email.compose')); ?>" class="list-group-item list-group-item-action">
<i class="fas fa-plus"></i> Nuova Email
</a>
<?php $__currentLoopData = $folders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $f): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<a href="<?php echo e(route('email.index', $f->type)); ?>"
class="list-group-item list-group-item-action <?php echo e($folder === $f->type ? 'active' : ''); ?>">
<i class="fas <?php echo e($f->icon); ?>"></i> <?php echo e($f->name); ?>
</a>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
</div>
</div>
<div class="col-md-9">
<div class="card card-primary card-outline">
<div class="card-header">
<h3 class="card-title"><?php echo e($message->subject ?: '(senza oggetto)'); ?></h3>
<div class="card-tools">
<?php if($message->is_starred): ?>
<button class="btn btn-xs btn-warning" onclick="toggleStar(<?php echo e($message->id); ?>)">
<i class="fas fa-star"></i>
</button>
<?php else: ?>
<button class="btn btn-xs btn-default" onclick="toggleStar(<?php echo e($message->id); ?>)">
<i class="far fa-star"></i>
</button>
<?php endif; ?>
<a href="<?php echo e(route('email.compose', ['reply_to' => $message->id])); ?>" class="btn btn-xs btn-default">
<i class="fas fa-reply"></i> Rispondi
</a>
<a href="<?php echo e(route('email.compose', ['forward' => $message->id])); ?>" class="btn btn-xs btn-default">
<i class="fas fa-forward"></i> Inoltra
</a>
<form method="POST" action="<?php echo e(route('email.destroy', $message->id)); ?>" class="d-inline">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Sposta nel cestino?')">
<i class="fas fa-trash"></i>
</button>
</form>
</div>
</div>
<div class="card-body">
<div class="mailbox-read-info">
<h6>
<strong>Da:</strong> <?php echo e($message->from_name); ?> &lt;<?php echo e($message->from_email); ?>&gt;
<span class="mailbox-read-time float-right">
<?php if($message->received_at): ?>
<?php echo e($message->received_at->format('d/m/Y H:i')); ?>
<?php elseif($message->sent_at): ?>
<?php echo e($message->sent_at->format('d/m/Y H:i')); ?>
<?php endif; ?>
</span>
</h6>
<h6>
<strong>A:</strong> <?php echo e($message->to_email); ?>
<?php if($message->cc): ?>
<br><strong>CC:</strong> <?php echo e($message->cc); ?>
<?php endif; ?>
</h6>
</div>
<hr>
<div class="mailbox-read-message">
<?php echo $message->body_for_display; ?>
</div>
<?php if($message->attachments->count() > 0): ?>
<hr>
<div class="mailbox-attachments">
<h4>Allegati:</h4>
<ul class="mailbox-attachments-links">
<?php $__currentLoopData = $message->attachments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attachment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<li>
<span class="mailbox-attachment-icon">
<i class="fas <?php echo e($attachment->icon); ?>"></i>
</span>
<div class="mailbox-attachment-info">
<a href="<?php echo e(route('email.attachment.download', $attachment->id)); ?>" class="mailbox-attachment-name">
<i class="fas fa-paperclip"></i> <?php echo e($attachment->filename); ?>
</a>
<span class="mailbox-attachment-size">
<?php echo e(number_format($attachment->size / 1024, 1)); ?> KB
</span>
<?php if(!$attachment->is_saved_to_documenti): ?>
<form method="POST" action="<?php echo e(route('email.attachment.save', [$message->id, $attachment->id])); ?>" class="d-inline">
<?php echo csrf_field(); ?>
<button type="submit" class="btn btn-xs btn-success" onclick="return confirm('Salvare allegato nei documenti?')">
<i class="fas fa-save"></i> Salva in Documenti
</button>
</form>
<?php else: ?>
<span class="badge badge-success"><i class="fas fa-check"></i> Salvato</span>
<?php endif; ?>
</div>
</li>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</ul>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script>
function toggleStar(id) {
fetch('/email/' + id + '/star', {
method: 'POST',
headers: { 'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>' }
}).then(() => location.reload());
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/email/show.blade.php ENDPATH**/ ?>
@@ -1,44 +0,0 @@
<?php $__env->startSection('title', 'Nuova Mailing List'); ?>
<?php $__env->startSection('page_title', 'Nuova Mailing List'); ?>
<?php $__env->startSection('content'); ?>
<div class="card">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-plus mr-2"></i>Crea Mailing List</h3>
</div>
<div class="card-body">
<form action="<?php echo e(route('mailing-liste.store')); ?>" method="POST">
<?php echo csrf_field(); ?>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Nome *</label>
<input type="text" name="nome" class="form-control" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<div class="custom-control custom-checkbox mt-4">
<input type="checkbox" class="custom-control-input" id="attiva" name="attiva" value="1" checked>
<label class="custom-control-label" for="attiva">Lista attiva</label>
</div>
</div>
</div>
</div>
<div class="form-group">
<label>Descrizione</label>
<textarea name="descrizione" class="form-control" rows="2"></textarea>
</div>
<div class="alert alert-info">
<i class="fas fa-info-circle mr-1"></i>
<strong>Come aggiungere contatti:</strong> vai su <em>Individui</em>, seleziona le righe desired, e usa il menu <em>Azioni &gt; Crea Mailing List</em> per creare una lista dai contatti selezionati.
</div>
<button type="submit" class="btn btn-success">
<i class="fas fa-save mr-1"></i> Salva Lista
</button>
<a href="<?php echo e(route('mailing-liste.index')); ?>" class="btn btn-secondary">Annulla</a>
</form>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/mailing-liste/create.blade.php ENDPATH**/ ?>
@@ -1,47 +0,0 @@
<?php if($paginator->hasPages()): ?>
<nav>
<ul class="pagination">
<?php if($paginator->onFirstPage()): ?>
<li class="page-item disabled" aria-disabled="true" aria-label="<?php echo app('translator')->get('pagination.previous'); ?>">
<span class="page-link" aria-hidden="true">&lsaquo;</span>
</li>
<?php else: ?>
<li class="page-item">
<a class="page-link" href="<?php echo e($paginator->previousPageUrl()); ?>" rel="prev" aria-label="<?php echo app('translator')->get('pagination.previous'); ?>">&lsaquo;</a>
</li>
<?php endif; ?>
<?php $__currentLoopData = $elements; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if(is_string($element)): ?>
<li class="page-item disabled" aria-disabled="true"><span class="page-link"><?php echo e($element); ?></span></li>
<?php endif; ?>
<?php if(is_array($element)): ?>
<?php $__currentLoopData = $element; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $page => $url): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if($page == $paginator->currentPage()): ?>
<li class="page-item active" aria-current="page"><span class="page-link"><?php echo e($page); ?></span></li>
<?php else: ?>
<li class="page-item"><a class="page-link" href="<?php echo e($url); ?>"><?php echo e($page); ?></a></li>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php if($paginator->hasMorePages()): ?>
<li class="page-item">
<a class="page-link" href="<?php echo e($paginator->nextPageUrl()); ?>" rel="next" aria-label="<?php echo app('translator')->get('pagination.next'); ?>">&rsaquo;</a>
</li>
<?php else: ?>
<li class="page-item disabled" aria-disabled="true" aria-label="<?php echo app('translator')->get('pagination.next'); ?>">
<span class="page-link" aria-hidden="true">&rsaquo;</span>
</li>
<?php endif; ?>
</ul>
</nav>
<?php endif; ?>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/bootstrap-4.blade.php ENDPATH**/ ?>
@@ -1,350 +0,0 @@
<?php $__env->startSection('title', 'Email - ' . ucfirst($folder)); ?>
<?php $__env->startSection('page_title', 'Email'); ?>
<?php
$currentFolder = $folders->firstWhere('type', $folder);
?>
<?php $__env->startSection('content'); ?>
<div class="card">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-envelope mr-2"></i>Email</h3>
<div class="card-tools">
<div class="btn-group mr-2">
<?php $__currentLoopData = $folders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $f): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<a href="<?php echo e(route('email.index', $f->type)); ?>"
class="btn btn-xs <?php echo e($folder === $f->type ? 'btn-primary' : 'btn-default'); ?>">
<i class="fas <?php echo e($f->icon); ?>"></i>
<?php echo e($f->name); ?>
<?php if($f->type === 'inbox' && $messages->where('is_read', false)->count() > 0): ?>
<span class="badge badge-light"><?php echo e($messages->where('is_read', false)->count()); ?></span>
<?php endif; ?>
</a>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
<a href="<?php echo e(route('email.compose')); ?>" class="btn btn-success btn-xs">
<i class="fas fa-plus"></i> Nuova Email
</a>
<button class="btn btn-primary btn-xs" onclick="syncEmails()" id="syncBtn">
<i class="fas fa-sync"></i> Ricevi/Invia
</button>
</div>
</div>
<div class="card-body p-0">
<div class="card-header pb-0">
<div class="row align-items-center">
<div class="col-md-6">
<div class="form-inline">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="selectAll" onchange="toggleAll(this)">
<label class="custom-control-label" for="selectAll">Seleziona tutto</label>
</div>
<span class="ml-3 text-muted" id="selectedCount">0 selezionati</span>
</div>
</div>
<div class="col-md-6">
<div class="input-group input-group-sm float-right" style="width: 220px;">
<select class="form-control" id="bulkAction">
<option value="">Azioni di massa...</option>
<?php if($folder !== 'trash'): ?>
<option value="mark_read">Marca come letto</option>
<option value="mark_unread">Marca come non letto</option>
<option value="star">Aggiungi a preferiti</option>
<option value="unstar">Rimuovi da preferiti</option>
<option value="move_trash">Sposta nel cestino</option>
<?php else: ?>
<option value="empty_trash">Svuota cestino</option>
<?php endif; ?>
</select>
<div class="input-group-append">
<button class="btn btn-secondary" type="button" onclick="executeBulkAction()">Applica</button>
</div>
</div>
</div>
</div>
</div>
<div class="table-responsive">
<table class="table table-hover table-striped">
<thead>
<tr>
<th style="width: 30px;"></th>
<th style="width: 30px;"></th>
<th style="width: 150px;">
<?php $sort = request('sort'); $dir = request('direction'); ?>
<?php if($folder === 'sent' || $folder === 'inviate'): ?>
<a href="<?php echo e(request()->fullUrlWithQuery(['sort' => 'to_email', 'direction' => $sort === 'to_email' && $dir === 'asc' ? 'desc' : 'asc'])); ?>" class="text-dark text-decoration-none">
Destinatario <?php echo $sort === 'to_email' ? ($dir === 'asc' ? '▲' : '▼') : ''; ?>
</a>
<?php else: ?>
<a href="<?php echo e(request()->fullUrlWithQuery(['sort' => 'from_email', 'direction' => $sort === 'from_email' && $dir === 'asc' ? 'desc' : 'asc'])); ?>" class="text-dark text-decoration-none">
Mittente <?php echo $sort === 'from_email' ? ($dir === 'asc' ? '▲' : '▼') : ''; ?>
</a>
<?php endif; ?>
</th>
<th>
<a href="<?php echo e(request()->fullUrlWithQuery(['sort' => 'subject', 'direction' => $sort === 'subject' && $dir === 'asc' ? 'desc' : 'asc'])); ?>" class="text-dark text-decoration-none">
Oggetto <?php echo $sort === 'subject' ? ($dir === 'asc' ? '▲' : '▼') : ''; ?>
</a>
</th>
<th style="width: 120px;">
<a href="<?php echo e(request()->fullUrlWithQuery(['sort' => 'received_at', 'direction' => $sort === 'received_at' && $dir === 'asc' ? 'desc' : 'asc'])); ?>" class="text-dark text-decoration-none">
Data <?php echo $sort === 'received_at' ? ($dir === 'asc' ? '▲' : '▼') : ''; ?>
</a>
</th>
</tr>
</thead>
<tbody>
<?php $__empty_1 = true; $__currentLoopData = $messages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $message): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<tr class="<?php echo e($message->is_read ? '' : 'font-weight-bold'); ?>">
<td style="width: 30px;" onclick="event.stopPropagation()">
<input type="checkbox" class="email-checkbox" value="<?php echo e($message->id); ?>" onchange="updateCount()">
</td>
<td style="width: 30px;" onclick="event.stopPropagation(); window.location='<?php echo e(route('email.show', [$folder, $message->id])); ?>'">
<?php if($message->is_starred): ?>
<i class="fas fa-star text-warning"></i>
<?php endif; ?>
</td>
<td onclick="window.location='<?php echo e(route('email.show', [$folder, $message->id])); ?>'">
<?php echo e($message->is_sent ? 'A: ' . $message->to_email : ($message->from_name ?: $message->from_email)); ?>
</td>
<td onclick="window.location='<?php echo e(route('email.show', [$folder, $message->id])); ?>'">
<?php echo e($message->subject ?? '(senza oggetto)'); ?>
</td>
<td>
<?php if($message->received_at): ?>
<?php echo e($message->received_at->format('d/m/Y')); ?>
<?php elseif($message->sent_at): ?>
<?php echo e($message->sent_at->format('d/m/Y')); ?>
<?php endif; ?>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<tr>
<td colspan="5" class="text-center text-muted py-4">
<i class="fas fa-inbox fa-2x mb-2"></i>
<p>Nessuna email</p>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
<div class="card-footer">
<?php echo e($messages->withQueryString()->links('vendor.pagination.simple-bootstrap-4')); ?>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('styles'); ?>
<style>
/* Bootstrap 4 Pagination override */
.pagination {
display: flex !important;
padding-left: 0;
list-style: none;
border-radius: 0.25rem;
margin: 0;
justify-content: center;
}
.page-item {
display: inline-block;
}
.page-link {
position: relative;
display: block;
padding: 0.5rem 0.75rem;
margin-left: -1px;
line-height: 1.25;
color: #007bff;
background-color: #fff;
border: 1px solid #dee2e6;
text-decoration: none;
font-size: 0.875rem;
}
.page-item.active .page-link {
z-index: 3;
color: #fff;
background-color: #007bff;
border-color: #007bff;
}
.page-item.disabled .page-link {
color: #6c757d;
pointer-events: none;
background-color: #fff;
border-color: #dee2e6;
}
.page-link:hover {
color: #0056b3;
background-color: #e9ecef;
border-color: #dee2e6;
}
/* Icons as text characters */
.pagination .page-link::before,
.pagination .page-link::after {
display: none;
}
</style>
<?php $__env->stopPush(); ?>
<?php if($syncInterval > 0 && $folder === 'inbox'): ?>
<?php $__env->startPush('scripts'); ?>
<script>
let syncInterval = <?php echo e($syncInterval * 60 * 1000); ?>;
let syncTimeout;
function autoSync() {
fetch('<?php echo e(url('email/sync/quick')); ?>', {
method: 'POST',
headers: {
'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>',
'Content-Type': 'application/json'
}
}).then(() => {
console.log('Auto sync completed');
}).catch(() => {
console.log('Auto sync failed');
});
}
function startAutoSync() {
if (syncInterval > 0) {
syncTimeout = setInterval(autoSync, syncInterval);
}
}
function stopAutoSync() {
if (syncTimeout) {
clearInterval(syncTimeout);
}
}
document.addEventListener('DOMContentLoaded', function() {
startAutoSync();
document.addEventListener('visibilitychange', function() {
if (document.hidden) {
stopAutoSync();
} else {
startAutoSync();
}
});
});
</script>
<?php $__env->stopPush(); ?>
<?php endif; ?>
<?php $__env->startSection('scripts'); ?>
<script>
function toggleAll(checkbox) {
const checkboxes = document.querySelectorAll('.email-checkbox');
checkboxes.forEach(function(cb) {
cb.checked = checkbox.checked;
});
updateCount();
}
function updateCount() {
const checkboxes = document.querySelectorAll('.email-checkbox:checked');
document.getElementById('selectedCount').textContent = checkboxes.length + ' selezionati';
}
function executeBulkAction() {
const select = document.getElementById('bulkAction');
const action = select.value;
if (!action) {
alert('Seleziona un\'azione');
return;
}
if (action === 'empty_trash') {
if (!confirm('Sei sicuro di voler svuotare il cestino? Questa azione non è reversibile.')) {
return;
}
}
const checkboxes = document.querySelectorAll('.email-checkbox:checked');
if (action !== 'empty_trash' && checkboxes.length === 0) {
alert('Seleziona almeno una email');
return;
}
let ids = [];
if (action !== 'empty_trash') {
ids = Array.from(checkboxes).map(function(cb) {
return cb.value;
});
}
fetch('<?php echo e(route('email.bulk')); ?>', {
method: 'POST',
headers: {
'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>',
'Content-Type': 'application/json'
},
body: JSON.stringify({ ids: ids, action: action })
}).then(function(response) {
return response.json();
}).then(function(data) {
if (data.success) {
// Reset checkboxes before reload to avoid ghost selection
document.querySelectorAll('.email-checkbox').forEach(function(cb) {
cb.checked = false;
});
document.getElementById('selectAll').checked = false;
updateCount();
window.location.href = window.location.href;
} else {
alert(data.message || 'Errore');
}
}).catch(function() {
alert('Errore');
});
}
function syncEmails() {
const btn = document.getElementById('syncBtn');
btn.disabled = true;
btn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Sincronizzazione...';
fetch('<?php echo e(url('email/sync/quick')); ?>', {
method: 'POST',
headers: {
'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>',
'Content-Type': 'application/json'
}
}).then(function(response) {
return response.json();
}).then(function(data) {
if (data.success) {
location.reload();
} else {
alert(data.message || 'Errore durante la sincronizzazione');
btn.disabled = false;
btn.innerHTML = '<i class="fas fa-sync"></i> Ricevi/Invia';
}
}).catch(function(error) {
alert('Errore di connessione');
btn.disabled = false;
btn.innerHTML = '<i class="fas fa-sync"></i> Ricevi/Invia';
});
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/email/index.blade.php ENDPATH**/ ?>
@@ -1,438 +0,0 @@
<?php $__env->startSection('title', 'Gruppi'); ?>
<?php $__env->startSection('page_title', 'Elenco Gruppi'); ?>
<?php
$canWriteGruppi = Auth::user()->canManage('gruppi');
$canDeleteGruppi = Auth::user()->canDelete('gruppi');
$columnLabels = [
'nome' => 'Nome',
'descrizione' => 'Descrizione',
'diocesi' => 'Diocesi',
'livello' => 'Livello',
'padre' => 'Gruppo Padre',
'membri' => 'Membri',
'responsabili' => 'Responsabili',
'indirizzo' => 'Indirizzo',
'citta' => 'Città',
'telefono' => 'Telefono',
'email' => 'Email',
];
$vistaDefaultJson = $vista ? $vista->toJson() : 'null';
$allColumnsJson = json_encode($allColumns);
$visibleColumnsJson = json_encode($visibleColumns);
?>
<?php $__env->startSection('content'); ?>
<?php if(session('success')): ?>
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<?php echo e(session('success')); ?>
</div>
<?php endif; ?>
<?php if(session('error')): ?>
<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<?php echo e(session('error')); ?>
</div>
<?php endif; ?>
<div class="card">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-sitemap mr-2"></i>Elenco Gruppi</h3>
<div class="card-tools">
<div class="btn-group mr-2">
<button type="button" class="btn btn-sm btn-outline-primary <?php echo e($viewMode === 'table' ? 'active' : ''); ?>" onclick="switchView('table')" id="btn-table-view">
<i class="fas fa-table mr-1"></i> Tabella
</button>
<button type="button" class="btn btn-sm btn-outline-primary <?php echo e($viewMode === 'tree' ? 'active' : ''); ?>" onclick="switchView('tree')" id="btn-tree-view">
<i class="fas fa-sitemap mr-1"></i> Albero
</button>
</div>
<button type="button" class="btn btn-primary btn-sm mr-1" onclick="showSaveVistaModal()">
<i class="fas fa-save mr-1"></i> Salva Vista
</button>
<?php if($canWriteGruppi): ?>
<a href="<?php echo e(route('gruppi.create')); ?>" class="btn btn-success btn-sm">
<i class="fas fa-plus"></i> Nuovo Gruppo
</a>
<?php endif; ?>
</div>
</div>
<?php if($viewMode === 'table'): ?>
<div class="card-body p-0">
<table class="table table-bordered table-hover table-striped mb-0" id="gruppi-table">
<thead class="thead-light">
<tr>
<?php if(in_array('nome', $visibleColumns)): ?>
<th data-sortable="true" onclick="sortTable('nome')" style="cursor:pointer;">Nome <i class="fas fa-sort float-right text-muted"></i></th>
<?php endif; ?>
<?php if(in_array('descrizione', $visibleColumns)): ?>
<th data-sortable="true" onclick="sortTable('descrizione')" style="cursor:pointer;">Descrizione <i class="fas fa-sort float-right text-muted"></i></th>
<?php endif; ?>
<?php if(in_array('diocesi', $visibleColumns)): ?>
<th>Diocesi</th>
<?php endif; ?>
<?php if(in_array('livello', $visibleColumns)): ?>
<th style="width: 80px;">Livello</th>
<?php endif; ?>
<?php if(in_array('padre', $visibleColumns)): ?>
<th>Gruppo Padre</th>
<?php endif; ?>
<?php if(in_array('membri', $visibleColumns)): ?>
<th style="width: 100px;">Membri</th>
<?php endif; ?>
<?php if(in_array('responsabili', $visibleColumns)): ?>
<th>Responsabili</th>
<?php endif; ?>
<?php if(in_array('indirizzo', $visibleColumns)): ?>
<th>Indirizzo</th>
<?php endif; ?>
<?php if(in_array('citta', $visibleColumns)): ?>
<th>Città</th>
<?php endif; ?>
<?php if(in_array('telefono', $visibleColumns)): ?>
<th>Telefono</th>
<?php endif; ?>
<?php if(in_array('email', $visibleColumns)): ?>
<th>Email</th>
<?php endif; ?>
<th style="width: 120px;">Azioni</th>
</tr>
</thead>
<tbody id="table-body">
<?php $__currentLoopData = $gruppi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $gruppo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr data-id="<?php echo e($gruppo->id); ?>">
<?php if(in_array('nome', $visibleColumns)): ?>
<td>
<span style="padding-left: <?php echo e(($gruppo->depth ?? 0) * 20); ?>px;">
<i class="fas fa-<?php echo e($gruppo->children->count() > 0 ? 'folder' : 'folder-open'); ?> text-<?php echo e(($gruppo->depth ?? 0) == 0 ? 'warning' : 'secondary'); ?> mr-1"></i>
<a href="<?php echo e(route('gruppi.show', $gruppo->id)); ?>"><?php echo e($gruppo->nome); ?></a>
</span>
</td>
<?php endif; ?>
<?php if(in_array('descrizione', $visibleColumns)): ?>
<td><?php echo e(Str::limit($gruppo->descrizione, 50) ?: '-'); ?></td>
<?php endif; ?>
<?php if(in_array('diocesi', $visibleColumns)): ?>
<td><?php echo e($gruppo->diocesi?->nome ?? '-'); ?></td>
<?php endif; ?>
<?php if(in_array('livello', $visibleColumns)): ?>
<td><span class="badge badge-<?php echo e(($gruppo->depth ?? 0) == 0 ? 'primary' : 'secondary'); ?>"><?php echo e($gruppo->depth ?? 0); ?></span></td>
<?php endif; ?>
<?php if(in_array('padre', $visibleColumns)): ?>
<td><?php echo e($gruppo->parent?->nome ?? '-'); ?></td>
<?php endif; ?>
<?php if(in_array('membri', $visibleColumns)): ?>
<td><span class="badge badge-info"><?php echo e($gruppo->individui->count()); ?></span></td>
<?php endif; ?>
<?php if(in_array('responsabili', $visibleColumns)): ?>
<td>
<?php $resp = $gruppo->getResponsabili() ?>
<?php if($resp->count() > 0): ?>
<?php echo e($resp->pluck('cognome')->implode(', ')); ?>
<?php else: ?>
-
<?php endif; ?>
</td>
<?php endif; ?>
<?php if(in_array('indirizzo', $visibleColumns)): ?>
<td><?php echo e($gruppo->indirizzo_incontro ?: '-'); ?></td>
<?php endif; ?>
<?php if(in_array('citta', $visibleColumns)): ?>
<td><?php echo e($gruppo->città_incontro ?: '-'); ?></td>
<?php endif; ?>
<?php if(in_array('telefono', $visibleColumns)): ?>
<td>-</td>
<?php endif; ?>
<?php if(in_array('email', $visibleColumns)): ?>
<td>-</td>
<?php endif; ?>
<td>
<a href="<?php echo e(route('gruppi.show', $gruppo->id)); ?>" class="btn btn-xs btn-info" title="Visualizza">
<i class="fas fa-eye"></i>
</a>
<?php if($canWriteGruppi): ?>
<a href="<?php echo e(url('/gruppi/' . $gruppo->id . '/edit')); ?>" class="btn btn-xs btn-warning" title="Modifica">
<i class="fas fa-edit"></i>
</a>
<?php endif; ?>
<?php if($canDeleteGruppi): ?>
<form action="<?php echo e(url('/gruppi/' . $gruppo->id)); ?>" method="POST" class="d-inline">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Confermi l\'eliminazione?')" title="Elimina">
<i class="fas fa-trash"></i>
</button>
</form>
<?php endif; ?>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
<?php else: ?>
<div class="card-body p-0">
<div class="tree-view" style="padding: 15px;">
<?php $rootGruppi = $gruppi->filter(fn($g) => $g->parent_id === null) ?>
<?php $__empty_1 = true; $__currentLoopData = $rootGruppi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $gruppo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<?php echo $__env->make('gruppi.partials.tree-item', ['gruppo' => $gruppo, 'isRoot' => true], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<div class="text-center text-muted py-4">
<i class="fas fa-folder-open fa-2x mb-2"></i>
<p>Nessun gruppo presente.
<?php if($canWriteGruppi): ?>
<a href="<?php echo e(route('gruppi.create')); ?>">Crea il primo gruppo</a>
<?php endif; ?>
</p>
</div>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
</div>
<div class="modal fade" id="saveVistaModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-save mr-2"></i>Salva Vista</h5>
<button type="button" class="close" data-dismiss="modal">
<span>&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Nome Vista *</label>
<input type="text" id="vista-nome" class="form-control" placeholder="Es. Elenco gruppi attivi">
</div>
<div class="form-group">
<label>Colonne visibili</label>
<div class="row" id="colonne-checkboxes">
<?php $__currentLoopData = $allColumns; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $col): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="col-md-4 mb-2">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input col-checkbox" id="col-<?php echo e($col); ?>" value="<?php echo e($col); ?>" <?php echo e(in_array($col, $visibleColumns) ? 'checked' : ''); ?>>
<label class="custom-control-label" for="col-<?php echo e($col); ?>"><?php echo e($columnLabels[$col] ?? $col); ?></label>
</div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
<div class="form-group">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="vista-default">
<label class="custom-control-label" for="vista-default">Imposta come vista predefinita</label>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annulla</button>
<button type="button" class="btn btn-primary" onclick="saveVista()">
<i class="fas fa-save mr-1"></i> Salva
</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="vistaListModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-bookmark mr-2"></i>Viste Salvate</h5>
<button type="button" class="close" data-dismiss="modal">
<span>&times;</span>
</button>
</div>
<div class="modal-body">
<?php
$visteSalvate = \App\Models\VistaReport::where('user_id', Auth::id())
->where('tipo', 'gruppi')
->orderBy('is_default', 'desc')
->orderBy('nome')
->get();
?>
<?php if($visteSalvate->count() > 0): ?>
<div class="list-group">
<?php $__currentLoopData = $visteSalvate; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $v): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="list-group-item d-flex justify-content-between align-items-center">
<div>
<a href="?vista_id=<?php echo e($v->id); ?>"><?php echo e($v->nome); ?></a>
<?php if($v->is_default): ?>
<span class="badge badge-success ml-1">Predefinita</span>
<?php endif; ?>
</div>
<form action="<?php echo e(route('gruppi.delete-vista', $v->id)); ?>" method="POST" class="d-inline">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Eliminare questa vista?')">
<i class="fas fa-trash"></i>
</button>
</form>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
<?php else: ?>
<p class="text-muted text-center">Nessuna vista salvata</p>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script>
function switchView(mode) {
window.location.href = '?view=' + mode;
}
function toggleItem(id) {
const el = document.getElementById('group-' + id);
const icon = document.getElementById('icon-' + id);
if (el.style.display === 'none') {
el.style.display = 'block';
icon.classList.remove('fa-chevron-right');
icon.classList.add('fa-chevron-down');
} else {
el.style.display = 'none';
icon.classList.remove('fa-chevron-down');
icon.classList.add('fa-chevron-right');
}
}
function toggleAllGroups() {
const collapsed = document.querySelectorAll('.tree-children[style*="display: none"]').length > 0;
document.querySelectorAll('.tree-children').forEach(el => {
el.style.display = collapsed ? 'block' : 'none';
});
document.querySelectorAll('.tree-toggle i').forEach(icon => {
if (collapsed) {
icon.classList.remove('fa-chevron-right');
icon.classList.add('fa-chevron-down');
} else {
icon.classList.remove('fa-chevron-down');
icon.classList.add('fa-chevron-right');
}
});
}
let sortDirection = {};
function sortTable(column) {
const tbody = document.getElementById('table-body');
const rows = Array.from(tbody.querySelectorAll('tr'));
sortDirection[column] = sortDirection[column] === 'asc' ? 'desc' : 'asc';
const dir = sortDirection[column];
rows.sort(function(a, b) {
const cellA = a.querySelector(`td:nth-child(${getColumnIndex(column)})`)?.textContent.trim() || '';
const cellB = b.querySelector(`td:nth-child(${getColumnIndex(column)})`)?.textContent.trim() || '';
if (dir === 'asc') {
return cellA.localeCompare(cellB, 'it');
}
return cellB.localeCompare(cellA, 'it');
});
rows.forEach(row => tbody.appendChild(row));
document.querySelectorAll('th i.fa-sort').forEach(icon => {
icon.className = 'fas fa-sort float-right text-muted';
});
const th = document.querySelector(`th[data-sortable][onclick="sortTable('${column}')"] i`);
if (th) {
th.className = `fas fa-sort-${dir === 'asc' ? 'up' : 'down'} float-right`;
}
}
function getColumnIndex(column) {
const th = document.querySelector(`th[onclick="sortTable('${column}')"]`);
if (th) {
return Array.from(th.parentNode.children).indexOf(th) + 1;
}
return 1;
}
function showSaveVistaModal() {
document.getElementById('vista-nome').value = '';
document.getElementById('vista-default').checked = false;
$('#saveVistaModal').modal('show');
}
function saveVista() {
const nome = document.getElementById('vista-nome').value.trim();
if (!nome) {
alert('Inserisci un nome per la vista');
return;
}
const colonneVisibili = Array.from(document.querySelectorAll('.col-checkbox:checked')).map(cb => cb.value);
const isDefault = document.getElementById('vista-default').checked;
fetch('/gruppi/save-vista', {
method: 'POST',
headers: {
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content,
'Content-Type': 'application/json',
'Accept': 'application/json',
},
body: JSON.stringify({
nome: nome,
colonne_visibili: colonneVisibili,
is_default: isDefault,
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
$('#saveVistaModal').modal('hide');
window.location.reload();
} else {
alert('Errore nel salvataggio della vista');
}
})
.catch(error => {
alert('Errore: ' + error.message);
});
}
</script>
<style>
.tree-item { margin-bottom: 5px; }
.tree-children {
margin-left: 25px;
border-left: 1px dashed #dee2e6;
padding-left: 10px;
}
.tree-toggle {
cursor: pointer;
padding: 3px 8px;
border-radius: 4px;
}
.tree-toggle:hover {
background-color: #f8f9fa;
}
.tree-label {
display: inline-flex;
align-items: center;
gap: 8px;
}
.badge-level {
font-size: 0.7em;
padding: 2px 5px;
}
.btn-group .btn.active {
background-color: #007bff;
color: white;
border-color: #007bff;
}
</style>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/gruppi/index.blade.php ENDPATH**/ ?>
@@ -1,288 +0,0 @@
<?php $__env->startSection('title', 'Nuovo Evento'); ?>
<?php $__env->startSection('page_title', 'Nuovo Evento'); ?>
<?php $__env->startSection('content'); ?>
<form action="/eventi" method="POST">
<?php echo csrf_field(); ?>
<div class="row">
<div class="col-md-8">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-calendar mr-2"></i>Dati Evento</h3>
</div>
<div class="card-body">
<div class="form-group">
<label>Nome Evento *</label>
<input type="text" name="nome_evento" class="form-control <?php $__errorArgs = ['nome_evento'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('nome_evento')); ?>" required>
<?php $__errorArgs = ['nome_evento'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
<span class="invalid-feedback"><?php echo e($message); ?></span>
<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
</div>
<div class="form-group">
<label>Descrizione Breve</label>
<input type="text" name="descrizione_evento" class="form-control" value="<?php echo e(old('descrizione_evento')); ?>" placeholder="Breve descrizione">
</div>
<div class="form-group">
<label>Tipo Evento</label>
<select name="tipo_evento" class="form-control">
<option value="">Seleziona tipo...</option>
<?php $__currentLoopData = $tipologieEventi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tipo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($tipo->nome); ?>" <?php echo e(old('tipo_evento') === $tipo->nome ? 'selected' : ''); ?>>
<?php echo e($tipo->descrizione ?: $tipo->nome); ?>
</option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<div class="form-group">
<label>Descrizione Completa</label>
<textarea name="descrizione" class="form-control" rows="3"><?php echo e(old('descrizione')); ?></textarea>
</div>
<div class="form-group">
<label>
<input type="checkbox" name="is_incontro_gruppo" value="1" <?php echo e(old('is_incontro_gruppo') ? 'checked' : ''); ?>>
Questo evento è il giorno di incontro del gruppo
</label>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-header"><h3 class="card-title"><i class="fas fa-clock mr-2"></i>Data e Orario</h3></div>
<div class="card-body">
<div class="form-group">
<label>Tipo Ricorrenza</label>
<select name="tipo_recorrenza" id="tipo_recorrenza" class="form-control" onchange="toggleRicorrenza()">
<option value="singolo" <?php echo e(old('tipo_recorrenza', 'singolo') === 'singolo' ? 'selected' : ''); ?>>Singolo</option>
<option value="settimanale" <?php echo e(old('tipo_recorrenza') === 'settimanale' ? 'selected' : ''); ?>>Settimanale</option>
<option value="mensile" <?php echo e(old('tipo_recorrenza') === 'mensile' ? 'selected' : ''); ?>>Mensile</option>
<option value="annuale" <?php echo e(old('tipo_recorrenza') === 'annuale' ? 'selected' : ''); ?>>Annuale</option>
<option value="altro" <?php echo e(old('tipo_recorrenza') === 'altro' ? 'selected' : ''); ?>>Altro</option>
</select>
</div>
<div id="data_specifica_field" style="<?php echo e(old('tipo_recorrenza') === 'singolo' || old('tipo_recorrenza') === null ? '' : 'display:none;'); ?>">
<div class="form-group">
<label>Data Evento</label>
<input type="date" name="data_specifica" class="form-control" value="<?php echo e(old('data_specifica')); ?>">
</div>
</div>
<div id="settimanale_field" style="<?php echo e(old('tipo_recorrenza') === 'settimanale' ? '' : 'display:none;'); ?>">
<div class="form-group">
<label>Giorno della Settimana</label>
<select name="giorno_settimana" class="form-control">
<option value="">Seleziona...</option>
<option value="0" <?php echo e(old('giorno_settimana') === '0' ? 'selected' : ''); ?>>Domenica</option>
<option value="1" <?php echo e(old('giorno_settimana') == '1' ? 'selected' : ''); ?>>Lunedì</option>
<option value="2" <?php echo e(old('giorno_settimana') == '2' ? 'selected' : ''); ?>>Martedì</option>
<option value="3" <?php echo e(old('giorno_settimana') == '3' ? 'selected' : ''); ?>>Mercoledì</option>
<option value="4" <?php echo e(old('giorno_settimana') == '4' ? 'selected' : ''); ?>>Giovedì</option>
<option value="5" <?php echo e(old('giorno_settimana') == '5' ? 'selected' : ''); ?>>Venerdì</option>
<option value="6" <?php echo e(old('giorno_settimana') == '6' ? 'selected' : ''); ?>>Sabato</option>
</select>
</div>
</div>
<div id="mensile_field" style="<?php echo e(old('tipo_recorrenza') === 'mensile' ? '' : 'display:none;'); ?>">
<div class="form-group">
<label>Occorrenza nel mese</label>
<select name="occorrenza_mese" class="form-control">
<option value="">Seleziona...</option>
<option value="1,1" <?php echo e(old('occorrenza_mese') === '1,1' ? 'selected' : ''); ?>>1° Lunedì</option>
<option value="1,2" <?php echo e(old('occorrenza_mese') === '1,2' ? 'selected' : ''); ?>>1° Martedì</option>
<option value="1,3" <?php echo e(old('occorrenza_mese') === '1,3' ? 'selected' : ''); ?>>1° Mercoledì</option>
<option value="1,4" <?php echo e(old('occorrenza_mese') === '1,4' ? 'selected' : ''); ?>>1° Giovedì</option>
<option value="1,5" <?php echo e(old('occorrenza_mese') === '1,5' ? 'selected' : ''); ?>>1° Venerdì</option>
<option value="1,6" <?php echo e(old('occorrenza_mese') === '1,6' ? 'selected' : ''); ?>>1° Sabato</option>
<option value="1,0" <?php echo e(old('occorrenza_mese') === '1,0' ? 'selected' : ''); ?>>1° Domenica</option>
<option value="2,1" <?php echo e(old('occorrenza_mese') === '2,1' ? 'selected' : ''); ?>>2° Lunedì</option>
<option value="2,2" <?php echo e(old('occorrenza_mese') === '2,2' ? 'selected' : ''); ?>>2° Martedì</option>
<option value="2,3" <?php echo e(old('occorrenza_mese') === '2,3' ? 'selected' : ''); ?>>2° Mercoledì</option>
<option value="2,4" <?php echo e(old('occorrenza_mese') === '2,4' ? 'selected' : ''); ?>>2° Giovedì</option>
<option value="2,5" <?php echo e(old('occorrenza_mese') === '2,5' ? 'selected' : ''); ?>>2° Venerdì</option>
<option value="2,6" <?php echo e(old('occorrenza_mese') === '2,6' ? 'selected' : ''); ?>>2° Sabato</option>
<option value="2,0" <?php echo e(old('occorrenza_mese') === '2,0' ? 'selected' : ''); ?>>2° Domenica</option>
<option value="3,1" <?php echo e(old('occorrenza_mese') === '3,1' ? 'selected' : ''); ?>>3° Lunedì</option>
<option value="3,2" <?php echo e(old('occorrenza_mese') === '3,2' ? 'selected' : ''); ?>>3° Martedì</option>
<option value="3,3" <?php echo e(old('occorrenza_mese') === '3,3' ? 'selected' : ''); ?>>3° Mercoledì</option>
<option value="3,4" <?php echo e(old('occorrenza_mese') === '3,4' ? 'selected' : ''); ?>>3° Giovedì</option>
<option value="3,5" <?php echo e(old('occorrenza_mese') === '3,5' ? 'selected' : ''); ?>>3° Venerdì</option>
<option value="3,6" <?php echo e(old('occorrenza_mese') === '3,6' ? 'selected' : ''); ?>>3° Sabato</option>
<option value="3,0" <?php echo e(old('occorrenza_mese') === '3,0' ? 'selected' : ''); ?>>3° Domenica</option>
<option value="4,1" <?php echo e(old('occorrenza_mese') === '4,1' ? 'selected' : ''); ?>>4° Lunedì</option>
<option value="4,2" <?php echo e(old('occorrenza_mese') === '4,2' ? 'selected' : ''); ?>>4° Martedì</option>
<option value="4,3" <?php echo e(old('occorrenza_mese') === '4,3' ? 'selected' : ''); ?>>4° Mercoledì</option>
<option value="4,4" <?php echo e(old('occorrenza_mese') === '4,4' ? 'selected' : ''); ?>>4° Giovedì</option>
<option value="4,5" <?php echo e(old('occorrenza_mese') === '4,5' ? 'selected' : ''); ?>>4° Venerdì</option>
<option value="4,6" <?php echo e(old('occorrenza_mese') === '4,6' ? 'selected' : ''); ?>>4° Sabato</option>
<option value="4,0" <?php echo e(old('occorrenza_mese') === '4,0' ? 'selected' : ''); ?>>4° Domenica</option>
</select>
</div>
<div class="form-group">
<label>Mesi (multipli)</label>
<select name="mesi_recorrenza[]" class="form-control" multiple size="4">
<option value="1" <?php echo e(is_array(old('mesi_recorrenza')) && in_array('1', old('mesi_recorrenza')) ? 'selected' : ''); ?>>Gennaio</option>
<option value="2" <?php echo e(is_array(old('mesi_recorrenza')) && in_array('2', old('mesi_recorrenza')) ? 'selected' : ''); ?>>Febbraio</option>
<option value="3" <?php echo e(is_array(old('mesi_recorrenza')) && in_array('3', old('mesi_recorrenza')) ? 'selected' : ''); ?>>Marzo</option>
<option value="4" <?php echo e(is_array(old('mesi_recorrenza')) && in_array('4', old('mesi_recorrenza')) ? 'selected' : ''); ?>>Aprile</option>
<option value="5" <?php echo e(is_array(old('mesi_recorrenza')) && in_array('5', old('mesi_recorrenza')) ? 'selected' : ''); ?>>Maggio</option>
<option value="6" <?php echo e(is_array(old('mesi_recorrenza')) && in_array('6', old('mesi_recorrenza')) ? 'selected' : ''); ?>>Giugno</option>
<option value="7" <?php echo e(is_array(old('mesi_recorrenza')) && in_array('7', old('mesi_recorrenza')) ? 'selected' : ''); ?>>Luglio</option>
<option value="8" <?php echo e(is_array(old('mesi_recorrenza')) && in_array('8', old('mesi_recorrenza')) ? 'selected' : ''); ?>>Agosto</option>
<option value="9" <?php echo e(is_array(old('mesi_recorrenza')) && in_array('9', old('mesi_recorrenza')) ? 'selected' : ''); ?>>Settembre</option>
<option value="10" <?php echo e(is_array(old('mesi_recorrenza')) && in_array('10', old('mesi_recorrenza')) ? 'selected' : ''); ?>>Ottobre</option>
<option value="11" <?php echo e(is_array(old('mesi_recorrenza')) && in_array('11', old('mesi_recorrenza')) ? 'selected' : ''); ?>>Novembre</option>
<option value="12" <?php echo e(is_array(old('mesi_recorrenza')) && in_array('12', old('mesi_recorrenza')) ? 'selected' : ''); ?>>Dicembre</option>
</select>
<small class="form-text text-muted">Ctrl+clic per selezionare più mesi</small>
</div>
</div>
<div id="annuale_field" style="<?php echo e(old('tipo_recorrenza') === 'annuale' ? '' : 'display:none;'); ?>">
<div class="form-group">
<label>Mese</label>
<select name="mese_annuale" class="form-control">
<option value="">Seleziona mese...</option>
<option value="1" <?php echo e(old('mese_annuale') == '1' ? 'selected' : ''); ?>>Gennaio</option>
<option value="2" <?php echo e(old('mese_annuale') == '2' ? 'selected' : ''); ?>>Febbraio</option>
<option value="3" <?php echo e(old('mese_annuale') == '3' ? 'selected' : ''); ?>>Marzo</option>
<option value="4" <?php echo e(old('mese_annuale') == '4' ? 'selected' : ''); ?>>Aprile</option>
<option value="5" <?php echo e(old('mese_annuale') == '5' ? 'selected' : ''); ?>>Maggio</option>
<option value="6" <?php echo e(old('mese_annuale') == '6' ? 'selected' : ''); ?>>Giugno</option>
<option value="7" <?php echo e(old('mese_annuale') == '7' ? 'selected' : ''); ?>>Luglio</option>
<option value="8" <?php echo e(old('mese_annuale') == '8' ? 'selected' : ''); ?>>Agosto</option>
<option value="9" <?php echo e(old('mese_annuale') == '9' ? 'selected' : ''); ?>>Settembre</option>
<option value="10" <?php echo e(old('mese_annuale') == '10' ? 'selected' : ''); ?>>Ottobre</option>
<option value="11" <?php echo e(old('mese_annuale') == '11' ? 'selected' : ''); ?>>Novembre</option>
<option value="12" <?php echo e(old('mese_annuale') == '12' ? 'selected' : ''); ?>>Dicembre</option>
</select>
</div>
<div class="form-group">
<label>Giorno del Mese</label>
<select name="giorno_mese" class="form-control">
<option value="">Seleziona giorno...</option>
<?php for($d = 1; $d <= 31; $d++): ?>
<option value="<?php echo e($d); ?>" <?php echo e(old('giorno_mese') == $d ? 'selected' : ''); ?>><?php echo e($d); ?></option>
<?php endfor; ?>
</select>
<small class="form-text text-muted">Se il giorno non esiste nel mese selezionato, verrà usato l'ultimo giorno disponibile</small>
</div>
</div>
<div class="form-group">
<label>Ora Inizio</label>
<input type="time" name="ora_inizio" class="form-control" value="<?php echo e(old('ora_inizio')); ?>">
</div>
<div class="form-group mb-0">
<label>Durata (minuti)</label>
<input type="number" name="durata_minuti" class="form-control" value="<?php echo e(old('durata_minuti', 60)); ?>" min="1">
</div>
</div>
</div>
<div class="card mt-3">
<div class="card-header"><h3 class="card-title"><i class="fas fa-map-marker-alt mr-2"></i>Dove</h3></div>
<div class="card-body">
<div class="form-group">
<label>Indirizzo</label>
<input type="text" name="luogo_indirizzo" class="form-control" value="<?php echo e(old('luogo_indirizzo')); ?>" placeholder="Via, numero civico, CAP, città">
</div>
<div class="form-group mb-0">
<label>URL Google Maps</label>
<input type="url" name="luogo_url_maps" class="form-control" value="<?php echo e(old('luogo_url_maps')); ?>" placeholder="https://maps.google.com/...">
<small class="form-text text-muted">Incolla il link di Google Maps per attivare l'anteprima</small>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="card">
<div class="card-header"><h3 class="card-title"><i class="fas fa-folder mr-2"></i>Gruppi</h3></div>
<div class="card-body">
<div class="form-group mb-0">
<select name="gruppi[]" class="form-control" multiple size="8">
<?php $__currentLoopData = $gruppi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $g): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($g->id); ?>" <?php echo e((old('gruppi') && in_array($g->id, old('gruppi'))) || ($selectedGruppo && $selectedGruppo->id == $g->id) ? 'selected' : ''); ?>>
<?php echo e($g->full_path); ?>
</option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<small class="form-text text-muted">Tieni premuto Ctrl per selezionare più gruppi</small>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-header"><h3 class="card-title"><i class="fas fa-user mr-2"></i>Responsabili</h3></div>
<div class="card-body">
<div class="form-group mb-0">
<select name="responsabili[]" class="form-control" multiple size="8">
<?php $__currentLoopData = $individui; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($i->id); ?>" <?php echo e(old('responsabili') && in_array($i->id, old('responsabili')) ? 'selected' : ''); ?>>
<?php echo e($i->cognome); ?> <?php echo e($i->nome); ?>
<?php if($i->telefono_primario): ?>
(<?php echo e($i->telefono_primario); ?>)
<?php endif; ?>
</option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<small class="form-text text-muted">Tieni premuto Ctrl per selezionare più responsabili</small>
</div>
</div>
</div>
</div>
</div>
<div class="card mt-3">
<div class="card-header"><h3 class="card-title"><i class="fas fa-sticky-note mr-2"></i>Note</h3></div>
<div class="card-body">
<textarea name="note" class="form-control" rows="2"><?php echo e(old('note')); ?></textarea>
</div>
</div>
<div class="mt-3">
<button type="submit" class="btn btn-success">
<i class="fas fa-save mr-1"></i> Salva
</button>
<a href="/eventi" class="btn btn-secondary">
<i class="fas fa-times mr-1"></i> Annulla
</a>
</div>
</form>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script>
function toggleRicorrenza() {
var tipo = document.getElementById('tipo_recorrenza').value;
document.getElementById('data_specifica_field').style.display = tipo === 'singolo' ? 'block' : 'none';
document.getElementById('settimanale_field').style.display = tipo === 'settimanale' ? 'block' : 'none';
document.getElementById('mensile_field').style.display = tipo === 'mensile' ? 'block' : 'none';
document.getElementById('annuale_field').style.display = tipo === 'annuale' ? 'block' : 'none';
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/eventi/create.blade.php ENDPATH**/ ?>
@@ -1,12 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="8" height="12" viewBox="0 0 8 12" fill="none" <?php echo e($attributes); ?>>
<g clip-path="url(#clip0_14550_6168)">
<path d="M6.75 11.0001L4 8.25012L1.25 11.0001" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M6.75 1.50012L4 4.25012L1.25 1.50012" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
</g>
<defs>
<clipPath id="clip0_14550_6168">
<rect width="8" height="11" fill="white" style="fill:white;fill-opacity:1;" transform="translate(0 0.500122)"/>
</clipPath>
</defs>
</svg>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/icons/chevrons-down-up.blade.php ENDPATH**/ ?>

Before

Width:  |  Height:  |  Size: 788 B

@@ -1,35 +0,0 @@
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="utf-8">
<style>
body { font-family: 'Segoe UI', Tahoma, sans-serif; line-height: 1.6; color: #333; }
.container { max-width: 600px; margin: 0 auto; padding: 20px; }
.header { background: #28a745; color: white; padding: 20px; text-align: center; border-radius: 5px 5px 0 0; }
.body { padding: 30px; background: #f9f9f9; border: 1px solid #ddd; }
.button { display: inline-block; padding: 12px 30px; background: #28a745; color: white; text-decoration: none; border-radius: 5px; font-weight: bold; }
.footer { margin-top: 20px; font-size: 12px; color: #999; text-align: center; }
</style>
</head>
<body>
<div class="container">
<div class="header">
<h2><?php echo e(e($appName)); ?></h2>
</div>
<div class="body">
<p>Ciao <strong><?php echo e(e($user->name)); ?></strong>,</p>
<p>Hai richiesto il reset della password per il tuo account.</p>
<p style="text-align: center; margin: 30px 0;">
<a href="<?php echo e($resetUrl); ?>" class="button">Reimposta Password</a>
</p>
<p>Se non hai richiesto tu il reset, ignora questa email.</p>
<p>Il link è valido per 60 minuti.</p>
</div>
<div class="footer">
&copy; <?php echo e(date('Y')); ?> <?php echo e(e($appName)); ?>
</div>
</div>
</body>
</html>
<?php /**PATH /var/www/html/glastree/resources/views/auth/emails/reset-password.blade.php ENDPATH**/ ?>
@@ -1,85 +0,0 @@
<?php
use App\Models\AppSetting;
$appName = AppSetting::getAppName() ?? 'Glastree';
?>
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Reimposta Password - <?php echo e(e($appName)); ?></title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@3.2/dist/css/adminlte.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body class="hold-transition login-page">
<div class="login-box">
<div class="login-logo">
<a href="/"><b><?php echo e(e($appName)); ?></b></a>
</div>
<div class="card">
<div class="card-body login-card-body">
<p class="login-box-msg">Scegli una nuova password</p>
<?php $__errorArgs = ['email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
<div class="alert alert-danger"><?php echo e($message); ?></div>
<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
<form action="<?php echo e(route('password.update')); ?>" method="POST">
<?php echo csrf_field(); ?>
<input type="hidden" name="token" value="<?php echo e($token); ?>">
<div class="input-group mb-3">
<input type="email" name="email" class="form-control" placeholder="Email" required value="<?php echo e(old('email')); ?>">
<div class="input-group-append">
<div class="input-group-text"><span class="fas fa-envelope"></span></div>
</div>
</div>
<div class="input-group mb-3">
<input type="password" name="password" class="form-control <?php $__errorArgs = ['password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" placeholder="Nuova password" required minlength="8">
<div class="input-group-append">
<div class="input-group-text"><span class="fas fa-lock"></span></div>
</div>
<?php $__errorArgs = ['password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
<span class="invalid-feedback"><?php echo e($message); ?></span>
<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
</div>
<div class="input-group mb-3">
<input type="password" name="password_confirmation" class="form-control" placeholder="Conferma password" required minlength="8">
<div class="input-group-append">
<div class="input-group-text"><span class="fas fa-lock"></span></div>
</div>
</div>
<div class="row">
<div class="col-12">
<button type="submit" class="btn btn-success btn-block">Reimposta Password</button>
</div>
</div>
</form>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
<?php /**PATH /var/www/html/glastree/resources/views/auth/reset-password.blade.php ENDPATH**/ ?>
@@ -60,6 +60,12 @@
<p>Ruoli</p>
</a>
</li>
<li class="nav-item">
<a href="/admin/backup" class="nav-link <?php echo e(request()->is('admin/backup*') ? 'active' : ''); ?>">
<i class="nav-icon fas fa-hdd"></i>
<p>Backup</p>
</a>
</li>
<li class="nav-item">
<a href="/admin/activity-logs" class="nav-link <?php echo e(request()->is('admin/activity-logs*') ? 'active' : ''); ?>">
<i class="nav-icon fas fa-history"></i>
@@ -1,57 +0,0 @@
<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;
$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames((['code', 'highlightedLine']));
foreach ($attributes->all() as $__key => $__value) {
if (in_array($__key, $__propNames)) {
$$__key = $$__key ?? $__value;
} else {
$__newAttributes[$__key] = $__value;
}
}
$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);
unset($__propNames);
unset($__newAttributes);
foreach (array_filter((['code', 'highlightedLine']), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
$$__key = $$__key ?? $__value;
}
$__defined_vars = get_defined_vars();
foreach ($attributes->all() as $__key => $__value) {
if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}
unset($__defined_vars, $__key, $__value); ?>
<div
class="text-sm rounded-b-lg bg-neutral-50 border-t border-neutral-100 dark:bg-neutral-900 dark:border-white/10"
<?php echo e($attributes); ?>
>
<?php if (isset($component)) { $__componentOriginal12cb286571f553eebcbe98210b217f94 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal12cb286571f553eebcbe98210b217f94 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.syntax-highlight','data' => ['code' => $code,'language' => 'php','editor' => true,'startingLine' => max(1, $highlightedLine - 5),'highlightedLine' => min(5, $highlightedLine - 1),'class' => 'overflow-x-auto']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::syntax-highlight'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['code' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($code),'language' => 'php','editor' => true,'starting-line' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(max(1, $highlightedLine - 5)),'highlighted-line' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(min(5, $highlightedLine - 1)),'class' => 'overflow-x-auto']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal12cb286571f553eebcbe98210b217f94)): ?>
<?php $attributes = $__attributesOriginal12cb286571f553eebcbe98210b217f94; ?>
<?php unset($__attributesOriginal12cb286571f553eebcbe98210b217f94); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal12cb286571f553eebcbe98210b217f94)): ?>
<?php $component = $__componentOriginal12cb286571f553eebcbe98210b217f94; ?>
<?php unset($__componentOriginal12cb286571f553eebcbe98210b217f94); ?>
<?php endif; ?>
</div>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/frame-code.blade.php ENDPATH**/ ?>
@@ -1,215 +0,0 @@
<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;
$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames((['exception']));
foreach ($attributes->all() as $__key => $__value) {
if (in_array($__key, $__propNames)) {
$$__key = $$__key ?? $__value;
} else {
$__newAttributes[$__key] = $__value;
}
}
$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);
unset($__propNames);
unset($__newAttributes);
foreach (array_filter((['exception']), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
$$__key = $$__key ?? $__value;
}
$__defined_vars = get_defined_vars();
foreach ($attributes->all() as $__key => $__value) {
if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}
unset($__defined_vars, $__key, $__value); ?>
<div id="previous-exceptions" class="flex flex-col gap-2.5 bg-neutral-50 dark:bg-white/1 border border-neutral-200 dark:border-neutral-800 rounded-xl p-2.5 shadow-xs">
<div class="flex items-center gap-2.5 p-2">
<div class="bg-white dark:bg-neutral-800 border border-neutral-200 dark:border-white/5 rounded-md w-6 h-6 flex items-center justify-center p-1">
<?php if (isset($component)) { $__componentOriginalebc8ec9a834a8051f56913d6745a7050 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalebc8ec9a834a8051f56913d6745a7050 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.icons.alert','data' => ['class' => 'w-2.5 h-2.5 text-blue-500 dark:text-emerald-500']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::icons.alert'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'w-2.5 h-2.5 text-blue-500 dark:text-emerald-500']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalebc8ec9a834a8051f56913d6745a7050)): ?>
<?php $attributes = $__attributesOriginalebc8ec9a834a8051f56913d6745a7050; ?>
<?php unset($__attributesOriginalebc8ec9a834a8051f56913d6745a7050); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalebc8ec9a834a8051f56913d6745a7050)): ?>
<?php $component = $__componentOriginalebc8ec9a834a8051f56913d6745a7050; ?>
<?php unset($__componentOriginalebc8ec9a834a8051f56913d6745a7050); ?>
<?php endif; ?>
</div>
<h3 class="text-base font-semibold text-neutral-900 dark:text-white">Previous <?php echo e(\Illuminate\Support\Str::plural('exception', $exception->previousExceptions()->count())); ?></h3>
</div>
<div class="flex flex-col">
<?php $__currentLoopData = $exception->previousExceptions(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $previous): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="flex gap-2.5 px-2">
<?php if($exception->previousExceptions()->count() > 1): ?>
<div class="flex flex-col items-center w-6 flex-shrink-0 self-stretch">
<?php if($index > 0): ?>
<div class="h-[23.5px] w-px border-l border-dashed border-emerald-900"></div>
<?php else: ?>
<div class="h-[23.5px]"></div>
<?php endif; ?>
<div class="size-[9px] flex-shrink-0 rounded-full bg-emerald-800"></div>
<?php if($index < $exception->previousExceptions()->count() - 1): ?>
<div class="flex-1 w-px border-l border-dashed border-emerald-900"></div>
<?php else: ?>
<div class="flex-1"></div>
<?php endif; ?>
</div>
<?php endif; ?>
<div
x-data="{ expanded: false }"
class="group/exception flex-1 min-w-0 rounded-lg my-1.5"
:class="{
'border border-neutral-200 bg-white/50 dark:bg-white/2 dark:border-white/5': expanded,
<?php if($exception->previousExceptions()->count() === 1): ?>
'border border-neutral-200 dark:border-transparent dark:bg-white/2': !expanded,
<?php else: ?>
'hover:border hover:border-neutral-200 dark:hover:border-none': !expanded,
<?php endif; ?>
}"
>
<div
class="flex gap-2.5 p-3 cursor-pointer rounded-lg"
:class="{ 'hover:bg-white/50 dark:hover:bg-white/2': !expanded }"
@click="expanded = !expanded"
>
<div
class="flex-1 min-w-0"
:class="expanded ? 'flex flex-col' : 'flex items-baseline gap-2'"
>
<h4 class="font-mono text-sm font-medium text-neutral-900 dark:text-white flex-shrink-0 max-w-full truncate"><?php echo e($previous->class()); ?></h4>
<p
class="text-sm text-neutral-500 dark:text-neutral-400"
:class="expanded ? 'mt-1 break-words' : 'truncate'"
><?php echo e($previous->message()); ?></p>
</div>
<button
type="button"
class="flex h-6 w-6 flex-shrink-0 cursor-pointer items-center justify-center rounded-md border border-neutral-200 dark:border-white/8 group-hover/exception:text-blue-500 group-hover/exception:dark:text-emerald-500"
:class="{
'text-blue-500 dark:text-emerald-500 dark:bg-white/5': expanded,
'text-neutral-500 dark:text-neutral-500 dark:bg-white/3': !expanded,
}"
>
<?php if (isset($component)) { $__componentOriginal4400c4a71d3ea90a0e0b846e7d689a28 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal4400c4a71d3ea90a0e0b846e7d689a28 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.icons.chevrons-down-up','data' => ['xShow' => 'expanded']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::icons.chevrons-down-up'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['x-show' => 'expanded']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal4400c4a71d3ea90a0e0b846e7d689a28)): ?>
<?php $attributes = $__attributesOriginal4400c4a71d3ea90a0e0b846e7d689a28; ?>
<?php unset($__attributesOriginal4400c4a71d3ea90a0e0b846e7d689a28); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal4400c4a71d3ea90a0e0b846e7d689a28)): ?>
<?php $component = $__componentOriginal4400c4a71d3ea90a0e0b846e7d689a28; ?>
<?php unset($__componentOriginal4400c4a71d3ea90a0e0b846e7d689a28); ?>
<?php endif; ?>
<?php if (isset($component)) { $__componentOriginal7348bb70f498d75e0a91acc6a707f136 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal7348bb70f498d75e0a91acc6a707f136 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.icons.chevrons-up-down','data' => ['xShow' => '!expanded','xCloak' => true]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::icons.chevrons-up-down'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['x-show' => '!expanded','x-cloak' => true]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal7348bb70f498d75e0a91acc6a707f136)): ?>
<?php $attributes = $__attributesOriginal7348bb70f498d75e0a91acc6a707f136; ?>
<?php unset($__attributesOriginal7348bb70f498d75e0a91acc6a707f136); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal7348bb70f498d75e0a91acc6a707f136)): ?>
<?php $component = $__componentOriginal7348bb70f498d75e0a91acc6a707f136; ?>
<?php unset($__componentOriginal7348bb70f498d75e0a91acc6a707f136); ?>
<?php endif; ?>
</button>
</div>
<div x-show="expanded" x-cloak class="flex flex-col gap-1.5 p-3">
<?php $__currentLoopData = $previous->frameGroups(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $group): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if($group['is_vendor']): ?>
<?php if (isset($component)) { $__componentOriginal449787012edfba29f0e80f325065fad5 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal449787012edfba29f0e80f325065fad5 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.vendor-frames','data' => ['frames' => $group['frames']]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::vendor-frames'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['frames' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($group['frames'])]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal449787012edfba29f0e80f325065fad5)): ?>
<?php $attributes = $__attributesOriginal449787012edfba29f0e80f325065fad5; ?>
<?php unset($__attributesOriginal449787012edfba29f0e80f325065fad5); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal449787012edfba29f0e80f325065fad5)): ?>
<?php $component = $__componentOriginal449787012edfba29f0e80f325065fad5; ?>
<?php unset($__componentOriginal449787012edfba29f0e80f325065fad5); ?>
<?php endif; ?>
<?php else: ?>
<?php $__currentLoopData = $group['frames']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $frame): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if (isset($component)) { $__componentOriginalc7c58c6d16fe849872fb25ad6e9b8407 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalc7c58c6d16fe849872fb25ad6e9b8407 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.frame','data' => ['frame' => $frame]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::frame'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['frame' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($frame)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalc7c58c6d16fe849872fb25ad6e9b8407)): ?>
<?php $attributes = $__attributesOriginalc7c58c6d16fe849872fb25ad6e9b8407; ?>
<?php unset($__attributesOriginalc7c58c6d16fe849872fb25ad6e9b8407); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc7c58c6d16fe849872fb25ad6e9b8407)): ?>
<?php $component = $__componentOriginalc7c58c6d16fe849872fb25ad6e9b8407; ?>
<?php unset($__componentOriginalc7c58c6d16fe849872fb25ad6e9b8407); ?>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/previous-exceptions.blade.php ENDPATH**/ ?>
@@ -1,78 +0,0 @@
<?php $__env->startSection('title', 'Importa Individui'); ?>
<?php $__env->startSection('page_title', 'Importa Individui da CSV'); ?>
<?php $__env->startSection('content'); ?>
<div class="row">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-upload mr-2"></i>Carica file CSV</h3>
</div>
<div class="card-body">
<form action="<?php echo e(route('individui.import.store')); ?>" method="POST" enctype="multipart/form-data">
<?php echo csrf_field(); ?>
<div class="form-group">
<label for="file">Seleziona file CSV *</label>
<input type="file" name="file" id="file" class="form-control" accept=".csv,.txt" required>
<small class="form-text text-muted">
Il file deve essere in formato CSV con separatore virgola.
</small>
</div>
<button type="submit" class="btn btn-primary">
<i class="fas fa-upload mr-1"></i> Importa
</button>
<a href="<?php echo e(route('individui.index')); ?>" class="btn btn-secondary ml-2">
Annulla
</a>
</form>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-header bg-info">
<h3 class="card-title text-white"><i class="fas fa-download mr-2"></i>Template</h3>
</div>
<div class="card-body">
<p>Scarica il template CSV per l'importazione:</p>
<a href="<?php echo e(route('individui.template')); ?>" class="btn btn-success btn-block">
<i class="fas fa-file-csv mr-1"></i> Scarica Template
</a>
</div>
</div>
<div class="card mt-3">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-info-circle mr-2"></i>Formato CSV</h3>
</div>
<div class="card-body">
<h6>Campi obbligatori:</h6>
<ul>
<li><code>cognome</code></li>
<li><code>nome</code></li>
</ul>
<h6>Campi opzionali:</h6>
<ul>
<li><code>data_nascita</code> (formato YYYY-MM-DD)</li>
<li><code>indirizzo</code></li>
<li><code>cap</code></li>
<li><code>città</code></li>
<li><code>sigla_provincia</code> (2 lettere)</li>
<li><code>genere</code> (M o F)</li>
<li><code>tipo_documento</code> (carta_identita, patente)</li>
<li><code>numero_documento</code></li>
<li><code>scadenza_documento</code> (YYYY-MM-DD)</li>
<li><code>note</code></li>
</ul>
<h6>Contatti (fino a 2):</h6>
<ul>
<li><code>contatto_1_tipo</code> (email, telefono, cellulare)</li>
<li><code>contatto_1_valore</code></li>
<li><code>contatto_1_etichetta</code> (personale, lavoro)</li>
<li><code>contatto_2_*</code> (secondo contatto)</li>
</ul>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/individui/import.blade.php ENDPATH**/ ?>
@@ -1,63 +0,0 @@
<?php $__env->startSection('title', 'Crea Ruolo'); ?>
<?php $__env->startSection('page_title', 'Crea Nuovo Ruolo'); ?>
<?php $__env->startSection('breadcrumbs'); ?>
<li class="breadcrumb-item"><a href="/admin/ruoli">Admin</a></li>
<li class="breadcrumb-item"><a href="/admin/ruoli">Ruoli</a></li>
<li class="breadcrumb-item active">Nuovo</li>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="row">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<h3 class="card-title">Nuovo Ruolo</h3>
</div>
<div class="card-body">
<form method="POST" action="/admin/ruoli">
<?php echo csrf_field(); ?>
<div class="form-group">
<label>Nome *</label>
<input type="text" name="name" class="form-control" required maxlength="50" placeholder="es. Segretario">
</div>
<div class="form-group">
<label>Descrizione</label>
<input type="text" name="description" class="form-control" maxlength="255" placeholder="es. Accesso per segretari">
</div>
<h5 class="mt-4">Permessi</h5>
<table class="table table-sm">
<thead>
<tr>
<th>Modulo</th>
<th>Nessuno</th>
<th>Lettura</th>
<th>Completo</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = ['individui', 'gruppi', 'eventi', 'documenti', 'mailing', 'viste']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $module): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td><strong><?php echo e(ucfirst($module)); ?></strong></td>
<td class="text-center"><input type="radio" name="permissions[<?php echo e($module); ?>]" value="0" checked></td>
<td class="text-center"><input type="radio" name="permissions[<?php echo e($module); ?>]" value="1"></td>
<td class="text-center"><input type="radio" name="permissions[<?php echo e($module); ?>]" value="2"></td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
<div class="mt-4">
<button type="submit" class="btn btn-primary">
<i class="fas fa-save"></i> Salva
</button>
<a href="/admin/ruoli" class="btn btn-secondary">Annulla</a>
</div>
</form>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/admin/ruoli/create.blade.php ENDPATH**/ ?>
@@ -1,362 +0,0 @@
<?php $__env->startSection('title', $evento->nome_evento); ?>
<?php $__env->startSection('page_title', 'Dettaglio Evento'); ?>
<?php $__env->startSection('breadcrumbs'); ?>
<li class="breadcrumb-item"><a href="/eventi">Eventi</a></li>
<li class="breadcrumb-item active"><?php echo e($evento->nome_evento); ?></li>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="row">
<div class="col-md-8">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">
<i class="fas fa-calendar mr-2"></i>
<?php echo e($evento->nome_evento); ?>
</h3>
</div>
<div class="card-body">
<?php if($evento->descrizione_evento): ?>
<p class="lead"><?php echo e($evento->descrizione_evento); ?></p>
<?php endif; ?>
<?php if($evento->descrizione): ?>
<div class="mt-3">
<h5>Descrizione Completa</h5>
<p><?php echo nl2br(e($evento->descrizione)); ?></p>
</div>
<?php endif; ?>
<?php if($evento->is_incontro_gruppo): ?>
<div class="alert alert-success mt-3">
<i class="fas fa-info-circle mr-1"></i>
<strong>Evento di incontro gruppo</strong>
</div>
<?php endif; ?>
</div>
</div>
<div class="card mt-3">
<div class="card-header"><h3 class="card-title"><i class="fas fa-clock mr-2"></i>Data e Orario</h3></div>
<div class="card-body">
<table class="table table-sm table-borderless mb-0">
<tr>
<td style="width: 150px;"><strong>Ricorrenza:</strong></td>
<td>
<?php if($evento->tipo_recorrenza && $evento->tipo_recorrenza !== 'singolo'): ?>
<span class="badge badge-info"><?php echo e($evento->periodicita_label); ?></span>
<?php else: ?>
<span class="badge badge-secondary">Singolo</span>
<?php endif; ?>
</td>
</tr>
<?php if($evento->tipo_evento): ?>
<tr>
<td><strong>Tipologia:</strong></td>
<td>
<?php
$tipologia = \App\Models\TipologiaEvento::where('nome', $evento->tipo_evento)->first();
?>
<?php if($tipologia): ?>
<span class="badge badge-primary"><?php echo e($tipologia->descrizione ?: $tipologia->nome); ?></span>
<?php else: ?>
<span class="badge badge-secondary"><?php echo e($evento->tipo_evento); ?></span>
<?php endif; ?>
</td>
</tr>
<?php endif; ?>
<?php if($evento->tipo_recorrenza === 'settimanale'): ?>
<tr>
<td><strong>Giorno:</strong></td>
<td><?php echo e($evento->giorno_settimana_label); ?></td>
</tr>
<?php elseif($evento->tipo_recorrenza === 'mensile'): ?>
<tr>
<td><strong>Occorrenza:</strong></td>
<td><?php echo e($evento->occorrenza_mensile_label); ?></td>
</tr>
<tr>
<td><strong>Mesi:</strong></td>
<td><?php echo e($evento->mesi_recorrenza_label); ?></td>
</tr>
<?php elseif($evento->tipo_recorrenza === 'annuale'): ?>
<tr>
<td><strong>Mese:</strong></td>
<td><?php echo e($evento->mese_annuale_label); ?></td>
</tr>
<?php elseif($evento->tipo_recorrenza === 'altro'): ?>
<tr>
<td><strong>Giorno:</strong></td>
<td><?php echo e($evento->giorno_settimana_label); ?></td>
</tr>
<?php else: ?>
<tr>
<td><strong>Data:</strong></td>
<td><?php echo e($evento->data_specifica?->format('d/m/Y') ?: '-'); ?></td>
</tr>
<?php endif; ?>
<?php if($evento->ora_inizio): ?>
<tr>
<td><strong>Ora Inizio:</strong></td>
<td><?php echo e($evento->ora_inizio->format('H:i')); ?></td>
</tr>
<?php endif; ?>
<?php if($evento->durata_minuti): ?>
<tr>
<td><strong>Durata:</strong></td>
<td><?php echo e($evento->durata_minuti); ?> minuti</td>
</tr>
<?php endif; ?>
</table>
</div>
</div>
<?php if($evento->luogo_indirizzo || $evento->luogo_url_maps): ?>
<div class="card mt-3">
<div class="card-header"><h3 class="card-title"><i class="fas fa-map-marker-alt mr-2"></i>Luogo</h3></div>
<div class="card-body">
<?php if($evento->luogo_indirizzo): ?>
<p class="mb-2"><i class="fas fa-location-dot text-danger mr-1"></i> <strong><?php echo e($evento->luogo_indirizzo); ?></strong></p>
<?php endif; ?>
<?php if($evento->luogo_url_maps): ?>
<div class="mb-2">
<a href="<?php echo e($evento->luogo_url_maps); ?>" target="_blank" class="btn btn-sm btn-outline-primary">
<i class="fas fa-external-link-alt mr-1"></i> Apri in Google Maps
</a>
</div>
<iframe
src="https://www.google.com/maps?q=<?php echo e(urlencode($evento->luogo_indirizzo ?: $evento->luogo_url_maps)); ?>&output=embed"
width="100%" height="200" style="border:0; border-radius: 8px;" allowfullscreen loading="lazy">
</iframe>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-header"><h3 class="card-title"><i class="fas fa-folder mr-2"></i>Gruppi</h3></div>
<div class="card-body p-0">
<?php if($evento->gruppi->count() > 0): ?>
<table class="table table-sm mb-0">
<tbody>
<?php $__currentLoopData = $evento->gruppi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $gruppo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td>
<a href="/gruppi/<?php echo e($gruppo->id); ?>">
<i class="fas fa-folder text-warning mr-1"></i>
<?php echo e($gruppo->nome); ?>
</a>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
<?php else: ?>
<div class="text-center text-muted py-3 mb-0">
<span>Nessun gruppo associato</span>
</div>
<?php endif; ?>
</div>
</div>
<div class="card mt-3">
<div class="card-header"><h3 class="card-title"><i class="fas fa-user-tie mr-2"></i>Responsabili</h3></div>
<div class="card-body p-0">
<?php if($evento->responsabili->count() > 0): ?>
<table class="table table-sm mb-0">
<thead>
<tr>
<th>Nome</th>
<th>Contatto</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $evento->responsabili; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $resp): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td>
<a href="/individui/<?php echo e($resp->id); ?>">
<i class="fas fa-user text-info mr-1"></i>
<?php echo e($resp->cognome); ?> <?php echo e($resp->nome); ?>
</a>
</td>
<td>
<?php if($resp->telefono_primario): ?>
<small class="text-success"><?php echo e($resp->telefono_primario); ?></small>
<?php else: ?>
<span class="text-muted">-</span>
<?php endif; ?>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
<?php else: ?>
<div class="text-center text-muted py-3 mb-0">
<span>Nessun responsabile</span>
</div>
<?php endif; ?>
</div>
</div>
<?php if($evento->note): ?>
<div class="card mt-3">
<div class="card-header"><h3 class="card-title"><i class="fas fa-sticky-note mr-2"></i>Note</h3></div>
<div class="card-body">
<p class="mb-0"><?php echo nl2br(e($evento->note)); ?></p>
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
<div class="card mt-3">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-file mr-2"></i>Documenti</h3>
<button type="button" class="btn btn-xs btn-success float-right" onclick="showDocumentoForm()">
<i class="fas fa-plus mr-1"></i> Carica
</button>
</div>
<div class="card-body p-0">
<div id="documento-add-form" style="display:none;" class="p-3 bg-light border-bottom">
<form action="/eventi/<?php echo e($evento->id); ?>/documenti" method="POST" enctype="multipart/form-data" class="mb-0">
<?php echo csrf_field(); ?>
<div class="row">
<div class="col-md-4">
<input type="text" name="nome_file" class="form-control form-control-sm" placeholder="Nome documento" required>
</div>
<div class="col-md-3">
<select name="tipologia" class="form-control form-control-sm" required>
<option value="">Tipologia...</option>
<option value="documento">Documento</option>
<option value="programma">Programma</option>
<option value="locandina">Locandina</option>
<option value="altro">Altro</option>
</select>
</div>
<div class="col-md-4">
<input type="file" name="file" class="form-control form-control-sm" required>
</div>
<div class="col-md-1">
<button type="submit" class="btn btn-xs btn-success"><i class="fas fa-upload mr-1"></i>Carica</button>
<button type="button" class="btn btn-xs btn-secondary" onclick="hideDocumentoForm()"><i class="fas fa-times"></i></button>
</div>
</div>
</form>
</div>
<?php if($evento->documenti && $evento->documenti->count() > 0): ?>
<table class="table table-bordered table-hover table-striped mb-0">
<thead class="thead-light">
<tr>
<th>Nome</th>
<th style="width: 120px;">Tipologia</th>
<th style="width: 80px;">Dimensione</th>
<th style="width: 130px;">Data Upload</th>
<th style="width: 80px;">Azioni</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $evento->documenti; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $documento): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td>
<i class="fas fa-file text-secondary mr-1"></i>
<?php echo e($documento->nome_file); ?>
</td>
<td><?php echo e(ucfirst($documento->tipologia)); ?></td>
<td><?php echo e(number_format($documento->dimensione / 1024, 1)); ?> KB</td>
<td><?php echo e($documento->created_at->format('d/m/Y')); ?></td>
<td>
<?php if($documento->file_path): ?>
<button type="button" class="btn btn-xs btn-primary" onclick="previewDocumento(<?php echo e($documento->id); ?>)" title="Anteprima">
<i class="fas fa-eye"></i>
</button>
<?php endif; ?>
<form action="/eventi/<?php echo e($evento->id); ?>/documenti/<?php echo e($documento->id); ?>" method="POST" class="d-inline">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Eliminare questo documento?')" title="Elimina">
<i class="fas fa-trash"></i>
</button>
</form>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
<?php else: ?>
<div class="text-center text-muted py-4">
<i class="fas fa-file fa-2x mb-2"></i>
<p class="mb-0">Nessun documento</p>
</div>
<?php endif; ?>
</div>
</div>
<div class="mt-3">
<a href="/eventi/<?php echo e($evento->id); ?>/edit" class="btn btn-warning">
<i class="fas fa-edit mr-1"></i> Modifica
</a>
<form action="/eventi/<?php echo e($evento->id); ?>" method="POST" class="d-inline">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-danger" onclick="return confirm('Confermi l\'eliminazione di <?php echo e($evento->nome_evento); ?>?')">
<i class="fas fa-trash mr-1"></i> Elimina
</button>
</form>
<a href="/eventi/<?php echo e($evento->id); ?>/export-ics" class="btn btn-success">
<i class="fas fa-calendar-plus mr-1"></i> Esporta ICS
</a>
<a href="/eventi" class="btn btn-secondary">
<i class="fas fa-arrow-left mr-1"></i> Torna all'elenco
</a>
</div>
<?php $__env->stopSection(); ?>
<div class="modal fade" id="previewModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document" style="max-width: 90vw;">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-file mr-2"></i><span id="previewModalTitle">Anteprima</span></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Chiudi">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body text-center p-0" style="min-height: 400px;">
<iframe id="previewFrame" src="" style="width: 100%; height: 70vh; border: none;"></iframe>
</div>
<div class="modal-footer">
<a id="previewDownloadBtn" href="#" class="btn btn-primary" download>
<i class="fas fa-download mr-1"></i> Scarica
</a>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Chiudi</button>
</div>
</div>
</div>
</div>
<?php $__env->startSection('scripts'); ?>
<script>
function showDocumentoForm() {
document.getElementById('documento-add-form').style.display = 'block';
}
function hideDocumentoForm() {
document.getElementById('documento-add-form').style.display = 'none';
}
function previewDocumento(id) {
document.getElementById('previewFrame').src = '/documenti/' + id + '/preview';
document.getElementById('previewDownloadBtn').href = '/documenti/' + id + '/download';
$('#previewModal').modal('show');
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/eventi/show.blade.php ENDPATH**/ ?>
@@ -1,674 +0,0 @@
<?php $__env->startSection('title', 'Dettaglio Individuo'); ?>
<?php $__env->startSection('page_title', 'Dettaglio Individuo'); ?>
<?php $__env->startSection('breadcrumbs'); ?>
<li class="breadcrumb-item"><a href="<?php echo e(route('individui.index')); ?>">Individui</a></li>
<li class="breadcrumb-item active"><?php echo e($individuo->nome_completo); ?></li>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="row">
<div class="col-md-6">
<div class="card card-success">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-user mr-2"></i><?php echo e($individuo->nome_completo); ?></h3>
</div>
<div class="card-body">
<p><strong>Codice:</strong> <span class="badge badge-secondary"><?php echo e($individuo->codice_id); ?></span></p>
<p><strong>Data di nascita:</strong> <?php echo e($individuo->data_nascita?->format('d/m/Y') ?: '-'); ?></p>
<p><strong>Genere:</strong> <?php echo e($individuo->genere === 'M' ? 'Maschio' : ($individuo->genere === 'F' ? 'Femmina' : '-')); ?></p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card card-secondary">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-camera mr-2"></i>Avatar</h3>
</div>
<div class="card-body text-center">
<?php if($individuo->avatar): ?>
<img src="<?php echo e(url('/individui/' . $individuo->id . '/avatar')); ?>"
alt="Avatar"
class="img-thumbnail mb-2"
style="max-width: 120px; max-height: 120px; object-fit: cover; border-radius: 50%;">
<br>
<button type="button" class="btn btn-danger btn-sm" onclick="deleteAvatar()">
<i class="fas fa-trash mr-1"></i>Rimuovi
</button>
<?php else: ?>
<div class="bg-secondary d-flex align-items-center justify-content-center mb-3"
style="width: 120px; height: 120px; margin: 0 auto; border-radius: 50%;">
<i class="fas fa-user fa-4x text-white"></i>
</div>
<?php endif; ?>
<form id="avatar-upload-form" enctype="multipart/form-data">
<?php echo csrf_field(); ?>
<div class="custom-file mb-2">
<input type="file" class="custom-file-input" id="avatar-input" name="avatar" accept="image/jpeg,image/png,image/gif">
<label class="custom-file-label" for="avatar-input">Scegli immagine...</label>
</div>
<button type="button" class="btn btn-primary btn-sm" onclick="uploadAvatar()">
<i class="fas fa-upload mr-1"></i>Carica
</button>
</form>
<div id="avatar-message" class="mt-2"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="card">
<div class="card-header"><h3 class="card-title"><i class="fas fa-map-marker-alt mr-2"></i>Residenza</h3></div>
<div class="card-body">
<p><strong>Indirizzo:</strong> <?php echo e($individuo->indirizzo ?: '-'); ?></p>
<p><strong>CAP:</strong> <?php echo e($individuo->cap ?: '-'); ?></p>
<p><strong>Città:</strong> <?php echo e($individuo->città ?: '-'); ?></p>
<p><strong>Provincia:</strong> <?php echo e($individuo->sigla_provincia ?: '-'); ?></p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-header"><h3 class="card-title"><i class="fas fa-id-card mr-2"></i>Documento di identità</h3></div>
<div class="card-body">
<p><strong>Tipo:</strong> <?php echo e($individuo->tipo_documento ? ucfirst(str_replace('_', ' ', $individuo->tipo_documento)) : '-'); ?></p>
<p><strong>Numero:</strong> <?php echo e($individuo->numero_documento ?: '-'); ?></p>
<p><strong>Scadenza:</strong> <?php echo e($individuo->scadenza_documento?->format('d/m/Y') ?: '-'); ?></p>
<?php if($individuo->hasDocumentoScaduto()): ?>
<p><span class="badge badge-danger"><i class="fas fa-exclamation-triangle mr-1"></i> Documento scaduto da <?php echo e($individuo->giorni_scadenza_documento); ?> giorni</span></p>
<?php elseif($individuo->hasDocumentoScadeEntroGiorni(30)): ?>
<p><span class="badge badge-warning"><i class="fas fa-exclamation-circle mr-1"></i> Scade tra <?php echo e($individuo->giorni_scadenza_documento); ?> giorni</span></p>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php if($individuo->note): ?>
<div class="row mt-3">
<div class="col-md-8">
<div class="card">
<div class="card-header"><h3 class="card-title"><i class="fas fa-sticky-note mr-2"></i>Note</h3></div>
<div class="card-body">
<p class="mb-0"><?php echo nl2br(e($individuo->note)); ?></p>
</div>
</div>
</div>
</div>
<?php endif; ?>
<div class="card mt-3">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-address-book mr-2"></i>Contatti</h3>
</div>
<div class="card-body p-0">
<?php if($individuo->contatti->count() > 0): ?>
<table class="table table-bordered table-hover table-striped mb-0">
<thead class="thead-light">
<tr>
<th style="width: 20%;">Tipo</th>
<th style="width: 30%;">Valore</th>
<th style="width: 20%;">Etichetta</th>
<th style="width: 10%;">Primario</th>
<th style="width: 80px;">Azioni</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $individuo->contatti; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $contatto): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php
$protocols = ['http://', 'https://', 'ftp://', 'ssh://', 'sftp://', 'telnet://'];
$isUrl = false;
if (in_array($contatto->tipo, ['web', 'telegram'])) {
foreach ($protocols as $p) {
if (str_starts_with(strtolower($contatto->valore), $p)) {
$isUrl = true;
break;
}
}
}
?>
<tr id="contatto-row-<?php echo e($contatto->id); ?>">
<td><span class="text-capitalize"><?php echo e($contatto->tipo); ?></span></td>
<td>
<?php if($contatto->tipo === 'email'): ?>
<a href="mailto:<?php echo e($contatto->valore); ?>"><?php echo e($contatto->valore); ?></a>
<?php elseif(in_array($contatto->tipo, ['telefono', 'cellulare', 'whatsapp'])): ?>
<a href="tel:<?php echo e($contatto->valore); ?>"><?php echo e($contatto->valore); ?></a>
<?php elseif($isUrl): ?>
<a href="<?php echo e($contatto->valore); ?>" target="_blank"><?php echo e($contatto->valore); ?></a>
<?php else: ?>
<?php echo e($contatto->valore); ?>
<?php endif; ?>
</td>
<td><?php echo e($contatto->etichetta ?: '-'); ?></td>
<td>
<?php if($contatto->is_primary): ?>
<span class="badge badge-success"><i class="fas fa-check mr-1"></i> Sì</span>
<?php else: ?>
<span class="text-muted">No</span>
<?php endif; ?>
</td>
<td>
<button type="button" class="btn btn-xs btn-warning" onclick="editContattoInline(<?php echo e($contatto->id); ?>)" title="Modifica">
<i class="fas fa-edit"></i>
</button>
<form action="<?php echo e(url('/contatti/' . $contatto->id)); ?>" method="POST" class="d-inline">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<input type="hidden" name="_redirect" value="<?php echo e(url('/individui/' . $individuo->id)); ?>">
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Eliminare questo contatto?')" title="Elimina">
<i class="fas fa-trash"></i>
</button>
</form>
</td>
</tr>
<tr id="contatto-edit-<?php echo e($contatto->id); ?>" style="display:none;">
<td colspan="5">
<form action="<?php echo e(url('/contatti/' . $contatto->id)); ?>" method="POST" class="mb-0">
<?php echo csrf_field(); ?> <?php echo method_field('PUT'); ?>
<input type="hidden" name="_redirect" value="<?php echo e(url('/individui/' . $individuo->id)); ?>">
<input type="hidden" name="individuo_id" value="<?php echo e($individuo->id); ?>">
<div class="row">
<div class="col-md-3">
<select name="tipo" class="form-control form-control-sm" required>
<option value="telefono" <?php echo e($contatto->tipo === 'telefono' ? 'selected' : ''); ?>>Telefono</option>
<option value="cellulare" <?php echo e($contatto->tipo === 'cellulare' ? 'selected' : ''); ?>>Cellulare</option>
<option value="email" <?php echo e($contatto->tipo === 'email' ? 'selected' : ''); ?>>Email</option>
<option value="fax" <?php echo e($contatto->tipo === 'fax' ? 'selected' : ''); ?>>Fax</option>
<option value="web" <?php echo e($contatto->tipo === 'web' ? 'selected' : ''); ?>>Web</option>
<option value="telegram" <?php echo e($contatto->tipo === 'telegram' ? 'selected' : ''); ?>>Telegram</option>
<option value="whatsapp" <?php echo e($contatto->tipo === 'whatsapp' ? 'selected' : ''); ?>>WhatsApp</option>
<option value="altro" <?php echo e($contatto->tipo === 'altro' ? 'selected' : ''); ?>>Altro</option>
</select>
</div>
<div class="col-md-4">
<input type="text" name="valore" class="form-control form-control-sm" value="<?php echo e($contatto->valore); ?>" required>
</div>
<div class="col-md-2">
<input type="text" name="etichetta" class="form-control form-control-sm" value="<?php echo e($contatto->etichetta); ?>" placeholder="Etichetta">
</div>
<div class="col-md-1 text-center">
<input type="checkbox" name="is_primary" value="1" <?php echo e($contatto->is_primary ? 'checked' : ''); ?>>
</div>
<div class="col-md-2">
<button type="submit" class="btn btn-xs btn-success"><i class="fas fa-check mr-1"></i>Salva</button>
<button type="button" class="btn btn-xs btn-secondary" onclick="cancelEditContatto(<?php echo e($contatto->id); ?>)"><i class="fas fa-times"></i></button>
</div>
</div>
</form>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
<?php else: ?>
<div class="text-center text-muted py-4">
<i class="fas fa-address-book fa-2x mb-2"></i>
<p class="mb-0">Nessun contatto</p>
</div>
<?php endif; ?>
</div>
</div>
<div class="card mt-3">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-folder mr-2"></i>Gruppi</h3>
<button type="button" class="btn btn-xs btn-success float-right" onclick="showGruppoForm()">
<i class="fas fa-plus mr-1"></i> Aggiungi
</button>
</div>
<div class="card-body p-0">
<?php if($individuo->gruppi->count() > 0): ?>
<table class="table table-bordered table-hover table-striped mb-0">
<thead class="thead-light">
<tr>
<th>Nome</th>
<th>Diocesi</th>
<th>Responsabile</th>
<th style="width: 130px;">Ruolo</th>
<th style="width: 110px;">Data Adesione</th>
<th style="width: 80px;">Azioni</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $individuo->gruppi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $gruppo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr id="gruppo-row-<?php echo e($gruppo->id); ?>">
<td>
<i class="fas fa-folder text-warning mr-1"></i>
<a href="<?php echo e(url('/gruppi/' . $gruppo->id)); ?>"><?php echo e($gruppo->nome); ?></a>
</td>
<td><?php echo e($gruppo->diocesi?->nome ?: '-'); ?></td>
<td><?php echo e($gruppo->getResponsabili()->isNotEmpty() ? $gruppo->getResponsabili()->first()->nome_completo : '-'); ?></td>
<td>
<?php
$ruoloIds = $gruppo->pivot->ruolo_ids ? json_decode($gruppo->pivot->ruolo_ids, true) : [];
$ruoli = \App\Models\Ruolo::findByIds($ruoloIds);
?>
<?php if($ruoli->count() > 0): ?>
<?php $__currentLoopData = $ruoli; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ruolo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<span class="badge badge-info mr-1"><?php echo e($ruolo->nome); ?></span>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php else: ?>
<span class="text-muted">-</span>
<?php endif; ?>
</td>
<td><?php echo e($gruppo->pivot->data_adesione ? \Carbon\Carbon::parse($gruppo->pivot->data_adesione)->format('d/m/Y') : '-'); ?></td>
<td>
<button type="button" class="btn btn-xs btn-warning" onclick="editGruppoInline(<?php echo e($gruppo->id); ?>)" title="Modifica ruolo">
<i class="fas fa-edit"></i>
</button>
<button type="button" class="btn btn-xs btn-danger" onclick="deleteGruppo(<?php echo e($gruppo->id); ?>)" title="Rimuovi">
<i class="fas fa-trash"></i>
</button>
</td>
</tr>
<tr id="gruppo-edit-<?php echo e($gruppo->id); ?>" style="display:none;">
<td colspan="6">
<form action="<?php echo e(url('/individui/' . $individuo->id . '/gruppi/' . $gruppo->id)); ?>" method="POST" class="mb-0">
<?php echo csrf_field(); ?> <?php echo method_field('PUT'); ?>
<div class="row">
<div class="col-md-4">
<input type="text" class="form-control form-control-sm" value="<?php echo e($gruppo->nome); ?>" disabled>
</div>
<div class="col-md-3">
<select name="ruolo_ids[]" class="form-control form-control-sm" multiple size="3">
<?php $selectedRuoliIds = $gruppo->pivot->ruolo_ids ? json_decode($gruppo->pivot->ruolo_ids, true) : [] ?>
<?php $__currentLoopData = \App\Models\Ruolo::attive(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ruolo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($ruolo->id); ?>" <?php echo e(in_array($ruolo->id, $selectedRuoliIds) ? 'selected' : ''); ?>><?php echo e($ruolo->nome); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<div class="col-md-3">
<input type="date" name="data_adesione" class="form-control form-control-sm" value="<?php echo e($gruppo->pivot->data_adesione); ?>">
</div>
<div class="col-md-2">
<button type="submit" class="btn btn-xs btn-success"><i class="fas fa-check mr-1"></i>Salva</button>
<button type="button" class="btn btn-xs btn-secondary" onclick="cancelEditGruppo(<?php echo e($gruppo->id); ?>)"><i class="fas fa-times"></i></button>
</div>
</div>
</form>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
<?php else: ?>
<div class="text-center text-muted py-4">
<i class="fas fa-users fa-2x mb-2"></i>
<p class="mb-0">Nessun gruppo associato</p>
</div>
<?php endif; ?>
</div>
</div>
<div class="card mt-3" id="gruppo-add-card" style="display:none; background-color: #fff3cd; border-color: #ffc107;">
<div class="card-header bg-warning">
<h3 class="card-title"><i class="fas fa-folder-plus mr-2"></i>Aggiungi a Gruppo</h3>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-4">
<select id="new-gruppo-id" class="form-control form-control-sm">
<option value="">Seleziona gruppo...</option>
<?php $__currentLoopData = \App\Models\Gruppo::orderBy('nome')->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $g): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if(!$individuo->gruppi->contains($g->id)): ?>
<option value="<?php echo e($g->id); ?>"><?php echo e($g->full_path); ?></option>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<div class="col-md-3">
<select id="new-gruppo-ruolo" class="form-control form-control-sm" multiple size="3">
<?php $__currentLoopData = \App\Models\Ruolo::attive(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ruolo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($ruolo->id); ?>"><?php echo e($ruolo->nome); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<small class="text-muted">Ctrl+click per selezionare più ruoli</small>
</div>
<div class="col-md-3">
<input type="date" id="new-gruppo-data" class="form-control form-control-sm">
</div>
<div class="col-md-2">
<button type="button" class="btn btn-success btn-sm" onclick="submitGruppoForm()">
<i class="fas fa-check mr-1"></i> Associa
</button>
<button type="button" class="btn btn-secondary btn-sm" onclick="hideGruppoForm()">
<i class="fas fa-times"></i>
</button>
</div>
</div>
</div>
</div>
<div class="card mt-3">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-file mr-2"></i>Documenti</h3>
<button type="button" class="btn btn-xs btn-success float-right" onclick="showDocumentoForm()">
<i class="fas fa-plus mr-1"></i> Carica
</button>
</div>
<div class="card-body p-0">
<div id="documento-add-form" style="display:none;" class="p-3 bg-light border-bottom">
<form action="/documenti" method="POST" enctype="multipart/form-data" class="mb-0">
<?php echo csrf_field(); ?>
<input type="hidden" name="visibilita" value="individuo">
<input type="hidden" name="visibilita_target_id" value="<?php echo e($individuo->id); ?>">
<input type="hidden" name="visibilita_target_type" value="App\Models\Individuo">
<input type="hidden" name="redirect_to" value="<?php echo e(url('/individui/' . $individuo->id)); ?>">
<div class="row">
<div class="col-md-3">
<input type="text" name="nome_file" class="form-control form-control-sm" placeholder="Nome documento" required>
</div>
<div class="col-md-3">
<select name="tipologia" class="form-control form-control-sm" required>
<option value="">Tipologia...</option>
<option value="documento">Documento</option>
<option value="avatar">Avatar</option>
<option value="galleria">Galleria</option>
<option value="statuto">Statuto</option>
<option value="altro">Altro</option>
</select>
</div>
<div class="col-md-4">
<input type="file" name="file" class="form-control form-control-sm" required>
</div>
<div class="col-md-2">
<button type="submit" class="btn btn-xs btn-success"><i class="fas fa-upload mr-1"></i>Carica</button>
<button type="button" class="btn btn-xs btn-secondary" onclick="hideDocumentoForm()"><i class="fas fa-times"></i></button>
</div>
</div>
</form>
</div>
<?php if($individuo->documenti->count() > 0): ?>
<table class="table table-bordered table-hover table-striped mb-0">
<thead class="thead-light">
<tr>
<th>Nome</th>
<th style="width: 120px;">Tipologia</th>
<th style="width: 80px;">Dimensione</th>
<th style="width: 130px;">Data Upload</th>
<th style="width: 80px;">Azioni</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $individuo->documenti; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $documento): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td>
<a href="#" onclick="event.preventDefault(); previewDocumento(<?php echo e($documento->id); ?>, '<?php echo e($documento->mime_type); ?>');">
<i class="fas fa-file text-secondary mr-1"></i>
<?php echo e($documento->nome_file); ?>
</a>
</td>
<td><?php echo e(ucfirst(str_replace('_', ' ', $documento->tipologia))); ?></td>
<td><?php echo e(number_format($documento->dimensione / 1024, 1)); ?> KB</td>
<td><?php echo e($documento->created_at->format('d/m/Y')); ?></td>
<td>
<?php if($documento->file_path): ?>
<button type="button" class="btn btn-xs btn-primary" onclick="previewDocumento(<?php echo e($documento->id); ?>, '<?php echo e($documento->mime_type); ?>')" title="Anteprima">
<i class="fas fa-eye"></i>
</button>
<?php endif; ?>
<form action="<?php echo e(url('/documenti/' . $documento->id)); ?>" method="POST" class="d-inline">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<input type="hidden" name="_redirect" value="<?php echo e(url('/individui/' . $individuo->id)); ?>">
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Eliminare questo documento?')" title="Elimina">
<i class="fas fa-trash"></i>
</button>
</form>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
<?php else: ?>
<div class="text-center text-muted py-4">
<i class="fas fa-file fa-2x mb-2"></i>
<p class="mb-0">Nessun documento</p>
</div>
<?php endif; ?>
</div>
</div>
<div class="mt-3">
<a href="<?php echo e(url('/individui/' . $individuo->id . '/edit')); ?>" class="btn btn-warning">
<i class="fas fa-edit mr-1"></i> Modifica
</a>
<form action="<?php echo e(url('/individui/' . $individuo->id)); ?>" method="POST" class="d-inline">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-danger" onclick="return confirm('Confermi l\'eliminazione di <?php echo e($individuo->nome_completo); ?>?')">
<i class="fas fa-trash mr-1"></i> Elimina
</button>
</form>
<a href="<?php echo e(route('individui.index')); ?>" class="btn btn-secondary">
<i class="fas fa-arrow-left mr-1"></i> Torna all'elenco
</a>
</div>
<div class="modal fade" id="previewModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document" style="max-width: 90vw;">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-file mr-2"></i><span id="previewModalTitle">Anteprima</span></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Chiudi">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body text-center p-0" style="min-height: 400px;">
<iframe id="previewFrame" src="" style="width: 100%; height: 70vh; border: none;"></iframe>
</div>
<div class="modal-footer">
<a id="previewDownloadBtn" href="#" class="btn btn-primary" download>
<i class="fas fa-download mr-1"></i> Scarica
</a>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Chiudi</button>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script>
function editContattoInline(id) {
document.getElementById('contatto-row-' + id).style.display = 'none';
document.getElementById('contatto-edit-' + id).style.display = 'table-row';
}
function cancelEditContatto(id) {
document.getElementById('contatto-row-' + id).style.display = 'table-row';
document.getElementById('contatto-edit-' + id).style.display = 'none';
}
function showGruppoForm() {
var card = document.getElementById('gruppo-add-card');
if (card) {
card.style.display = 'block';
card.scrollIntoView({ behavior: 'smooth', block: 'start' });
}
}
function hideGruppoForm() {
var card = document.getElementById('gruppo-add-card');
if (card) {
card.style.display = 'none';
}
}
function submitGruppoForm() {
var gruppoId = document.getElementById('new-gruppo-id').value;
var ruoloSelect = document.getElementById('new-gruppo-ruolo');
var dataAdesione = document.getElementById('new-gruppo-data').value;
if (!gruppoId) {
alert('Seleziona un gruppo');
return;
}
var formData = new URLSearchParams();
formData.append('gruppo_id', gruppoId);
var selectedRuoli = Array.from(ruoloSelect.selectedOptions).map(opt => opt.value).filter(v => v);
selectedRuoli.forEach(function(ruoloId) {
formData.append('ruolo_ids[]', ruoloId);
});
formData.append('data_adesione', dataAdesione);
fetch('<?php echo e(url('/individui/' . $individuo->id . '/gruppi')); ?>', {
method: 'POST',
headers: {
'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>',
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: formData
})
.then(response => {
if (!response.ok) {
return response.text().then(text => { throw new Error(text); });
}
return response.json();
})
.then(data => {
if (data.success) {
hideGruppoForm();
window.location.reload();
} else {
alert(data.error || 'Errore');
}
})
.catch(error => {
alert('Errore: ' + error.message);
});
}
function editGruppoInline(id) {
document.getElementById('gruppo-row-' + id).style.display = 'none';
document.getElementById('gruppo-edit-' + id).style.display = 'table-row';
}
function cancelEditGruppo(id) {
document.getElementById('gruppo-row-' + id).style.display = 'table-row';
document.getElementById('gruppo-edit-' + id).style.display = 'none';
}
function deleteGruppo(gruppoId) {
if (!confirm('Rimuovere da questo gruppo?')) return;
fetch('<?php echo e(url('/individui/' . $individuo->id . '/gruppi')); ?>/' + gruppoId, {
method: 'DELETE',
headers: {
'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>',
'Accept': 'application/json'
}
})
.then(response => {
if (!response.ok) {
return response.text().then(text => { throw new Error(text); });
}
return response.json();
})
.then(data => {
if (data.success) {
window.location.reload();
} else {
alert(data.error || 'Errore');
}
})
.catch(error => {
alert('Errore: ' + error.message);
});
}
function showDocumentoForm() {
document.getElementById('documento-add-form').style.display = 'block';
}
function hideDocumentoForm() {
document.getElementById('documento-add-form').style.display = 'none';
}
function previewDocumento(id, mimeType) {
var previewUrl = '/documenti/' + id + '/preview';
var downloadUrl = '/documenti/' + id + '/download';
document.getElementById('previewFrame').src = previewUrl;
document.getElementById('previewDownloadBtn').href = downloadUrl;
document.getElementById('previewModalTitle').textContent = 'Anteprima';
if (mimeType && mimeType.startsWith('image/')) {
document.getElementById('previewDownloadBtn').style.display = 'inline-block';
} else {
document.getElementById('previewDownloadBtn').style.display = 'none';
}
$('#previewModal').modal('show');
}
document.getElementById('avatar-input').addEventListener('change', function(e) {
var fileName = e.target.files[0]?.name || 'Scegli file...';
e.target.nextElementSibling.textContent = fileName;
});
function uploadAvatar() {
var input = document.getElementById('avatar-input');
if (!input.files[0]) {
document.getElementById('avatar-message').innerHTML = '<span class="text-danger">Seleziona un\'immagine</span>';
return;
}
var formData = new FormData();
formData.append('avatar', input.files[0]);
formData.append('_token', '<?php echo e(csrf_token()); ?>');
document.getElementById('avatar-message').innerHTML = '<span class="text-info"><i class="fas fa-spinner fa-spin"></i> Caricamento...</span>';
fetch('<?php echo e(url('/individui/' . $individuo->id . '/avatar')); ?>', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => {
if (data.success) {
document.getElementById('avatar-message').innerHTML = '<span class="text-success">Avatar caricato!</span>';
setTimeout(function() { window.location.reload(); }, 500);
} else {
document.getElementById('avatar-message').innerHTML = '<span class="text-danger">' + (data.message || 'Errore') + '</span>';
}
})
.catch(error => {
document.getElementById('avatar-message').innerHTML = '<span class="text-danger">Errore: ' + error + '</span>';
});
}
function deleteAvatar() {
if (!confirm('Rimuovere l\'avatar?')) return;
fetch('<?php echo e(url('/individui/' . $individuo->id . '/avatar')); ?>', {
method: 'DELETE',
headers: {
'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>',
'Accept': 'application/json'
}
})
.then(response => response.json())
.then(data => {
if (data.success) {
window.location.reload();
} else {
alert(data.message || 'Errore');
}
})
.catch(error => {
alert('Errore: ' + error);
});
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/individui/show.blade.php ENDPATH**/ ?>
@@ -1,4 +0,0 @@
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" <?php echo e($attributes); ?>>
<path d="M9.75 2.56944C9.75 3.29815 8.07107 3.88889 6 3.88889C3.92893 3.88889 2.25 3.29815 2.25 2.56944M9.75 2.56944C9.75 1.84074 8.07107 1.25 6 1.25C3.92893 1.25 2.25 1.84074 2.25 2.56944M9.75 2.56944V9.43056C9.75 10.1593 8.07107 10.75 6 10.75C3.92893 10.75 2.25 10.1593 2.25 9.43056V2.56944M9.75 5.94434C9.75 6.67304 8.07107 7.26378 6 7.26378C3.92893 7.26378 2.25 6.67304 2.25 5.94434" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/icons/database.blade.php ENDPATH**/ ?>

Before

Width:  |  Height:  |  Size: 763 B

@@ -1,220 +0,0 @@
<?php $__env->startSection('title', 'Nuovo Individuo'); ?>
<?php $__env->startSection('page_title', 'Nuovo Individuo'); ?>
<?php $__env->startSection('content'); ?>
<form action="/individui" method="POST">
<?php echo csrf_field(); ?>
<div class="row">
<div class="col-md-6">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-user mr-2"></i>Dati Anagrafici</h3>
</div>
<div class="card-body">
<div class="form-group">
<label>Codice ID</label>
<input type="text" class="form-control" value="sarà generato automaticamente" disabled>
</div>
<div class="form-group">
<label>Cognome *</label>
<input type="text" name="cognome" class="form-control <?php $__errorArgs = ['cognome'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('cognome')); ?>" required>
<?php $__errorArgs = ['cognome'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
<span class="invalid-feedback"><?php echo e($message); ?></span>
<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
</div>
<div class="form-group">
<label>Nome *</label>
<input type="text" name="nome" class="form-control <?php $__errorArgs = ['nome'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('nome')); ?>" required>
<?php $__errorArgs = ['nome'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
<span class="invalid-feedback"><?php echo e($message); ?></span>
<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
</div>
<div class="form-group">
<label>Data di nascita</label>
<input type="date" name="data_nascita" class="form-control" value="<?php echo e(old('data_nascita')); ?>">
</div>
<div class="form-group">
<label>Genere</label>
<select name="genere" class="form-control">
<option value="">Seleziona...</option>
<option value="M" <?php echo e(old('genere') === 'M' ? 'selected' : ''); ?>>Maschio</option>
<option value="F" <?php echo e(old('genere') === 'F' ? 'selected' : ''); ?>>Femmina</option>
</select>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-header"><h3 class="card-title"><i class="fas fa-map-marker-alt mr-2"></i>Residenza</h3></div>
<div class="card-body">
<div class="form-group">
<label>Indirizzo</label>
<input type="text" name="indirizzo" class="form-control" value="<?php echo e(old('indirizzo')); ?>">
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label>CAP</label>
<input type="text" name="cap" class="form-control" value="<?php echo e(old('cap')); ?>">
</div>
<div class="form-group col-md-5">
<label>Città</label>
<input type="text" name="città" class="form-control" value="<?php echo e(old('città')); ?>">
</div>
<div class="form-group col-md-3">
<label>Provincia</label>
<input type="text" name="sigla_provincia" class="form-control" maxlength="2" value="<?php echo e(old('sigla_provincia')); ?>">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row mt-3">
<div class="col-md-6">
<div class="card">
<div class="card-header"><h3 class="card-title"><i class="fas fa-id-card mr-2"></i>Documento di identità</h3></div>
<div class="card-body">
<div class="form-group">
<label>Tipo documento</label>
<select name="tipo_documento" class="form-control">
<option value="">Seleziona...</option>
<option value="carta_identita" <?php echo e(old('tipo_documento') === 'carta_identita' ? 'selected' : ''); ?>>Carta d'Identità</option>
<option value="patente" <?php echo e(old('tipo_documento') === 'patente' ? 'selected' : ''); ?>>Patente</option>
</select>
</div>
<div class="form-group">
<label>Numero documento</label>
<input type="text" name="numero_documento" class="form-control" value="<?php echo e(old('numero_documento')); ?>">
</div>
<div class="form-group">
<label>Scadenza documento</label>
<input type="date" name="scadenza_documento" class="form-control" value="<?php echo e(old('scadenza_documento')); ?>">
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-header"><h3 class="card-title"><i class="fas fa-sticky-note mr-2"></i>Note</h3></div>
<div class="card-body">
<div class="form-group mb-0">
<textarea name="note" class="form-control" rows="4"><?php echo e(old('note')); ?></textarea>
</div>
</div>
</div>
</div>
</div>
<div class="card mt-3">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-address-book mr-2"></i>Contatti</h3>
<button type="button" class="btn btn-xs btn-success float-right" onclick="aggiungiRigaContatto()">
<i class="fas fa-plus mr-1"></i> Aggiungi
</button>
</div>
<div class="card-body p-0">
<table class="table table-bordered mb-0" id="contatti-table">
<thead class="thead-light">
<tr>
<th style="width: 20%;">Tipo</th>
<th style="width: 30%;">Valore</th>
<th style="width: 20%;">Etichetta</th>
<th style="width: 10%;">Primario</th>
<th style="width: 50px;"></th>
</tr>
</thead>
<tbody id="contatti-tbody">
</tbody>
</table>
<div id="no-contatti-msg" class="text-center text-muted py-4">
<p class="mb-0">Nessun contatto. Clicca su "Aggiungi" per aggiungerne uno.</p>
</div>
</div>
</div>
<div class="mt-3">
<button type="submit" class="btn btn-success">
<i class="fas fa-save mr-1"></i> Salva
</button>
<a href="/individui" class="btn btn-secondary">
<i class="fas fa-times mr-1"></i> Annulla
</a>
</div>
</form>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script>
let contattoIndex = 0;
function aggiungiRigaContatto() {
const tbody = document.getElementById('contatti-tbody');
const noMsg = document.getElementById('no-contatti-msg');
if (noMsg) noMsg.style.display = 'none';
const row = document.createElement('tr');
row.innerHTML = `
<td>
<select name="contatti[${contattoIndex}][tipo]" class="form-control">
<option value="">Seleziona...</option>
<option value="telefono">Telefono</option>
<option value="cellulare">Cellulare</option>
<option value="email">Email</option>
<option value="fax">Fax</option>
<option value="web">Web</option>
<option value="telegram">Telegram</option>
<option value="whatsapp">WhatsApp</option>
<option value="altro">Altro</option>
</select>
</td>
<td><input type="text" name="contatti[${contattoIndex}][valore]" class="form-control" placeholder="Valore"></td>
<td><input type="text" name="contatti[${contattoIndex}][etichetta]" class="form-control" placeholder="Etichetta"></td>
<td class="text-center"><input type="checkbox" name="contatti[${contattoIndex}][is_primary]" value="1"></td>
<td><button type="button" class="btn btn-danger btn-xs" onclick="rimuoviRiga(this)"><i class="fas fa-trash"></i></button></td>
`;
tbody.appendChild(row);
contattoIndex++;
}
function rimuoviRiga(btn) {
const row = btn.closest('tr');
row.remove();
if (document.getElementById('contatti-tbody').children.length === 0) {
const noMsg = document.getElementById('no-contatti-msg');
if (noMsg) noMsg.style.display = 'block';
}
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/individui/create.blade.php ENDPATH**/ ?>
@@ -1,3 +1,4 @@
<?php $appName = \App\Models\AppSetting::getAppName() ?? 'Glastree'; ?>
<?php $__env->startSection('title', 'Backup - ' . $appName); ?>
<?php $__env->startSection('page_title', 'Backup e Migrazione'); ?>
<?php $__env->startSection('breadcrumbs'); ?>
@@ -244,4 +245,4 @@
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/admin/backup/index.blade.php ENDPATH**/ ?>
<?php echo $__env->make('admin.layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/admin/backup/index.blade.php ENDPATH**/ ?>
@@ -1,79 +0,0 @@
<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;
$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames((['routeParameters']));
foreach ($attributes->all() as $__key => $__value) {
if (in_array($__key, $__propNames)) {
$$__key = $$__key ?? $__value;
} else {
$__newAttributes[$__key] = $__value;
}
}
$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);
unset($__propNames);
unset($__newAttributes);
foreach (array_filter((['routeParameters']), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
$$__key = $$__key ?? $__value;
}
$__defined_vars = get_defined_vars();
foreach ($attributes->all() as $__key => $__value) {
if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}
unset($__defined_vars, $__key, $__value); ?>
<div class="flex flex-col gap-3">
<h2 class="text-lg font-semibold">Routing parameters</h2>
<?php if($routeParameters): ?>
<div class="bg-white dark:bg-white/[2%] border border-neutral-200 dark:border-neutral-800 rounded-md overflow-x-auto p-5 text-sm font-mono shadow-xs">
<?php if (isset($component)) { $__componentOriginal12cb286571f553eebcbe98210b217f94 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal12cb286571f553eebcbe98210b217f94 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.syntax-highlight','data' => ['code' => $routeParameters,'language' => 'json']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::syntax-highlight'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['code' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($routeParameters),'language' => 'json']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal12cb286571f553eebcbe98210b217f94)): ?>
<?php $attributes = $__attributesOriginal12cb286571f553eebcbe98210b217f94; ?>
<?php unset($__attributesOriginal12cb286571f553eebcbe98210b217f94); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal12cb286571f553eebcbe98210b217f94)): ?>
<?php $component = $__componentOriginal12cb286571f553eebcbe98210b217f94; ?>
<?php unset($__componentOriginal12cb286571f553eebcbe98210b217f94); ?>
<?php endif; ?>
</div>
<?php else: ?>
<?php if (isset($component)) { $__componentOriginal612ffe32146e3bd2ac6ba6076cca9520 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal612ffe32146e3bd2ac6ba6076cca9520 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.empty-state','data' => ['message' => 'No routing parameters']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::empty-state'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['message' => 'No routing parameters']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal612ffe32146e3bd2ac6ba6076cca9520)): ?>
<?php $attributes = $__attributesOriginal612ffe32146e3bd2ac6ba6076cca9520; ?>
<?php unset($__attributesOriginal612ffe32146e3bd2ac6ba6076cca9520); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal612ffe32146e3bd2ac6ba6076cca9520)): ?>
<?php $component = $__componentOriginal612ffe32146e3bd2ac6ba6076cca9520; ?>
<?php unset($__componentOriginal612ffe32146e3bd2ac6ba6076cca9520); ?>
<?php endif; ?>
<?php endif; ?>
</div>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/routing-parameter.blade.php ENDPATH**/ ?>
@@ -1,5 +0,0 @@
<?php $__env->startSection('title', __('Page Expired')); ?>
<?php $__env->startSection('code', '419'); ?>
<?php $__env->startSection('message', __('Page Expired')); ?>
<?php echo $__env->make('errors::minimal', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/419.blade.php ENDPATH**/ ?>
@@ -1,6 +0,0 @@
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" <?php echo e($attributes); ?>>
<path d="M2.75 2.75H5.614L5.316 2.114C5.069 1.587 4.54 1.25 3.958 1.25H2.25C1.422 1.25 0.75 1.922 0.75 2.75V4.75C0.75 3.645 1.645 2.75 2.75 2.75Z" />
<path d="M0.75 4.75V2.75C0.75 1.922 1.422 1.25 2.25 1.25H3.958C4.54 1.25 5.069 1.587 5.316 2.114L5.614 2.75" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M2.75 2.75H9.25C10.355 2.75 11.25 3.645 11.25 4.75V8.25C11.25 9.355 10.355 10.25 9.25 10.25H2.75C1.645 10.25 0.75 9.355 0.75 8.25V4.75C0.75 3.645 1.645 2.75 2.75 2.75Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/icons/folder.blade.php ENDPATH**/ ?>

Before

Width:  |  Height:  |  Size: 889 B

@@ -1,5 +0,0 @@
<?php $__env->startSection('title', __('Unauthorized')); ?>
<?php $__env->startSection('code', '401'); ?>
<?php $__env->startSection('message', __('Unauthorized')); ?>
<?php echo $__env->make('errors::minimal', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/401.blade.php ENDPATH**/ ?>
@@ -1,47 +0,0 @@
<?php if($paginator->hasPages()): ?>
<nav>
<ul class="pagination">
<?php if($paginator->onFirstPage()): ?>
<li class="disabled" aria-disabled="true" aria-label="<?php echo app('translator')->get('pagination.previous'); ?>">
<span aria-hidden="true">&lsaquo;</span>
</li>
<?php else: ?>
<li>
<a href="<?php echo e($paginator->previousPageUrl()); ?>" rel="prev" aria-label="<?php echo app('translator')->get('pagination.previous'); ?>">&lsaquo;</a>
</li>
<?php endif; ?>
<?php $__currentLoopData = $elements; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if(is_string($element)): ?>
<li class="disabled" aria-disabled="true"><span><?php echo e($element); ?></span></li>
<?php endif; ?>
<?php if(is_array($element)): ?>
<?php $__currentLoopData = $element; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $page => $url): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if($page == $paginator->currentPage()): ?>
<li class="active" aria-current="page"><span><?php echo e($page); ?></span></li>
<?php else: ?>
<li><a href="<?php echo e($url); ?>"><?php echo e($page); ?></a></li>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php if($paginator->hasMorePages()): ?>
<li>
<a href="<?php echo e($paginator->nextPageUrl()); ?>" rel="next" aria-label="<?php echo app('translator')->get('pagination.next'); ?>">&rsaquo;</a>
</li>
<?php else: ?>
<li class="disabled" aria-disabled="true" aria-label="<?php echo app('translator')->get('pagination.next'); ?>">
<span aria-hidden="true">&rsaquo;</span>
</li>
<?php endif; ?>
</ul>
</nav>
<?php endif; ?>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/bootstrap-3.blade.php ENDPATH**/ ?>
@@ -1,8 +0,0 @@
<section
<?php echo e($attributes->merge(['class' => "w-full max-w-7xl mx-auto p-4 sm:p-14 border-x border-dashed border-neutral-300 dark:border-white/[9%]"])); ?>
>
<?php echo e($slot); ?>
</section>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/section-container.blade.php ENDPATH**/ ?>
@@ -1,5 +0,0 @@
<?php $__env->startSection('title', __('Payment Required')); ?>
<?php $__env->startSection('code', '402'); ?>
<?php $__env->startSection('message', __('Payment Required')); ?>
<?php echo $__env->make('errors::minimal', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/402.blade.php ENDPATH**/ ?>
@@ -510,7 +510,7 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
<div class="modal fade" id="newFolderModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-folder-plus mr-2"></i>Nuova Cartella</h5>
@@ -545,7 +545,7 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
<div class="modal fade" id="uploadModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-upload mr-2"></i>Carica Documento</h5>
@@ -553,9 +553,9 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
<span>&times;</span>
</button>
</div>
<form action="/documenti" method="POST" enctype="multipart/form-data">
<?php echo csrf_field(); ?>
<div class="modal-body">
<div class="modal-body">
<form action="/documenti" method="POST" enctype="multipart/form-data" id="uploadForm">
<?php echo csrf_field(); ?>
<div class="form-group">
<label>Nome *</label>
<input type="text" name="nome_file" class="form-control" placeholder="Nome del documento" required>
@@ -567,11 +567,15 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
<option value="<?php echo e($tip->nome); ?>"><?php echo e($tip->descrizione ?? ucfirst($tip->nome)); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<button type="button" class="btn btn-sm btn-outline-success mt-2" id="massMoveNewFolderBtn">
<i class="fas fa-plus mr-1"></i> Nuova cartella
</button>
</div>
</div>
<div class="form-group">
<label>Visibilità *</label>
<select name="visibilita" id="uploadVisibilita" class="form-control" onchange="loadUploadTargets()">
<option value="pubblico">Pubblico</option>
<option value="individuo">Individuo</option>
<option value="gruppo">Gruppo</option>
</select>
</div>
<div class="form-group" id="uploadTargetGroup" style="display:none;">
<label>Riferimento</label>
<select name="visibilita_target_id" class="form-control" id="uploadTargetId">
@@ -599,29 +603,42 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
<input type="file" name="file" class="form-control" required>
<small class="text-muted">Max 10MB</small>
</div>
<?php if($currentFolder && !$currentRepo): ?>
<input type="hidden" name="cartella_id" value="<?php echo e($currentFolder->id); ?>">
<p class="text-muted small mb-0">Il documento sarà inserito in: <strong><?php echo e($currentFolder->nome); ?></strong></p>
<?php endif; ?>
<div class="form-group" id="uploadFolderGroup">
<label>Cartella</label>
<select name="cartella_id" id="uploadCartellaId" class="form-control">
<option value="">— Nessuna cartella —</option>
<?php $__currentLoopData = $cartelle; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cartella): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($cartella->id); ?>" <?php echo e($currentFolder && $currentFolder->id === $cartella->id ? 'selected' : ''); ?>><?php echo e($cartella->nome); ?></option>
<?php if($cartella->children->count() > 0): ?>
<?php $__currentLoopData = $cartella->children; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $child): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($child->id); ?>" <?php echo e($currentFolder && $currentFolder->id === $child->id ? 'selected' : ''); ?>>&nbsp;&nbsp;&nbsp;<?php echo e($child->nome); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<button type="button" class="btn btn-sm btn-outline-success mt-2" id="uploadNewFolderBtn">
<i class="fas fa-plus mr-1"></i> Nuova cartella
</button>
</div>
<?php if($currentRepo): ?>
<input type="hidden" name="repository_id" value="<?php echo e($currentRepo->id); ?>">
<p class="text-muted small mb-0">Caricamento su repository remoto: <strong><?php echo e($currentRepo->nome); ?></strong></p>
<?php endif; ?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" onclick="$('#uploadModal').modal('hide')">Annulla</button>
<button type="submit" class="btn btn-primary">
<i class="fas fa-upload mr-1"></i> Carica
</button>
</div>
</form>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" onclick="$('#uploadModal').modal('hide')">Annulla</button>
<button type="submit" class="btn btn-primary" form="uploadForm">
<i class="fas fa-upload mr-1"></i> Carica
</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="associateModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-link mr-2"></i>Associa a</h5>
@@ -661,7 +678,7 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
<div class="modal fade" id="updateModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-edit mr-2"></i>Cambia tipo/contesto</h5>
@@ -737,7 +754,7 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
<div class="modal fade" id="deleteConfirmModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header bg-danger text-white">
<h5 class="modal-title"><i class="fas fa-exclamation-triangle mr-2"></i>Conferma Eliminazione</h5>
@@ -761,7 +778,7 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
<div class="modal fade" id="massDeleteConfirmModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header bg-danger text-white">
<h5 class="modal-title"><i class="fas fa-exclamation-triangle mr-2"></i>Conferma Eliminazione Multipla</h5>
@@ -785,7 +802,7 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
<div class="modal fade" id="massMoveModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-folder-open mr-2"></i>Sposta documenti selezionati</h5>
@@ -811,6 +828,9 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<button type="button" class="btn btn-sm btn-outline-success mt-2" id="massMoveNewFolderBtn">
<i class="fas fa-plus mr-1"></i> Nuova cartella
</button>
</div>
</div>
<div class="modal-footer">
@@ -826,7 +846,7 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
<div class="modal fade" id="moveModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-folder-open mr-2"></i>Sposta documento</h5>
@@ -874,6 +894,21 @@ const eventi = <?php echo json_encode($eventi->map(fn($e) => ['id' => $e->id, 'l
const mailingLists = <?php echo json_encode($mailingLists ? $mailingLists->map(fn($m) => ['id' => $m->id, 'label' => $m->nome]) : [], 512) ?>;
const cartelle = <?php echo json_encode($cartelleMoveOptions, 15, 512) ?>;
$('#uploadModal').on('shown.bs.modal', function () {
loadUploadTargets();
toggleUploadRepo();
});
$('#newFolderModal').on('show.bs.modal', function () {
$(this).css('z-index', 1060);
$('.modal-backdrop:last').css('z-index', 1050);
});
$('#newFolderModal').on('hidden.bs.modal', function () {
window._uploadNewFolder = false;
$(this).css('z-index', '');
});
function toggleAll(source) {
document.querySelectorAll('.doc-checkbox').forEach(cb => cb.checked = source.checked);
updateCount();
@@ -1254,6 +1289,13 @@ document.getElementById('massMoveNewFolderBtn')?.addEventListener('click', funct
});
});
document.getElementById('uploadNewFolderBtn')?.addEventListener('click', function(e) {
e.preventDefault();
window._uploadNewFolder = true;
$('#uploadModal').modal('hide');
$('#newFolderModal').modal('show');
});
document.getElementById('massMoveForm')?.addEventListener('submit', function(e) {
e.preventDefault();
const form = this;
@@ -1346,8 +1388,21 @@ document.getElementById('newFolderForm')?.addEventListener('submit', function(e)
.then(response => response.json())
.then(data => {
if (data.success) {
$('#newFolderModal').modal('hide');
window.location.reload();
if (window._uploadNewFolder) {
window._uploadNewFolder = false;
$('#newFolderModal').modal('hide');
$('#uploadModal').modal('show');
const select = document.getElementById('uploadCartellaId');
if (select) {
const opt = document.createElement('option');
opt.value = data.cartella.id;
opt.textContent = data.cartella.nome;
opt.selected = true;
select.appendChild(opt);
}
} else {
window.location.reload();
}
} else {
alert('Errore: ' + (data.message || 'Impossibile creare la cartella'));
}
@@ -1359,11 +1414,14 @@ document.getElementById('newFolderForm')?.addEventListener('submit', function(e)
function toggleUploadRepo() {
const repoSelect = document.getElementById('uploadRepository');
const cartellaInput = document.querySelector('input[name="cartella_id"]');
const folderGroup = document.getElementById('uploadFolderGroup');
const cartellaSelect = document.getElementById('uploadCartellaId');
if (repoSelect && repoSelect.value !== '') {
if (cartellaInput) cartellaInput.disabled = true;
if (folderGroup) folderGroup.style.display = 'none';
if (cartellaSelect) cartellaSelect.disabled = true;
} else {
if (cartellaInput) cartellaInput.disabled = false;
if (folderGroup) folderGroup.style.display = '';
if (cartellaSelect) cartellaSelect.disabled = false;
}
}
@@ -1,713 +0,0 @@
<?php $__env->startSection('title', 'Impostazioni Email'); ?>
<?php $__env->startSection('page_title', 'Configurazione Email'); ?>
<?php $__env->startSection('breadcrumbs'); ?>
<li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>">Dashboard</a></li>
<li class="breadcrumb-item"><a href="/impostazioni">Impostazioni</a></li>
<li class="breadcrumb-item active">Email Settings</li>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="row">
<div class="col-md-3">
<div class="card card-secondary">
<div class="card-header">
<h3 class="card-title">Sezioni</h3>
</div>
<div class="list-group list-group-flush">
<a href="#imap" class="list-group-item list-group-item-action active" data-toggle="tab">
<i class="nav-icon fas fa-server"></i> Server IMAP
</a>
<a href="#smtp" class="list-group-item list-group-item-action" data-toggle="tab">
<i class="nav-icon fas fa-paper-plane"></i> Server SMTP (Invio)
</a>
<a href="#account" class="list-group-item list-group-item-action" data-toggle="tab">
<i class="nav-icon fas fa-user"></i> Account
</a>
<a href="#sync" class="list-group-item list-group-item-action" data-toggle="tab">
<i class="nav-icon fas fa-sync"></i> Sincronizzazione
</a>
<a href="#signature" class="list-group-item list-group-item-action" data-toggle="tab">
<i class="nav-icon fas fa-signature"></i> Firma
</a>
<a href="#mittenti" class="list-group-item list-group-item-action" data-toggle="tab">
<i class="nav-icon fas fa-user-plus"></i> Mittenti Aggiuntivi
</a>
</div>
</div>
</div>
<div class="col-md-9">
<form method="POST" action="<?php echo e(route('impostazioni.email.save')); ?>">
<?php echo csrf_field(); ?>
<input type="hidden" name="id" value="<?php echo e($settings->id ?? 1); ?>">
<div class="tab-content">
<div class="tab-pane active" id="imap">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">Configurazione Server IMAP</h3>
</div>
<div class="card-body">
<?php if(session('success')): ?>
<div class="alert alert-success"><?php echo e(session('success')); ?></div>
<?php endif; ?>
<?php if(session('error')): ?>
<div class="alert alert-danger"><?php echo e(session('error')); ?></div>
<?php endif; ?>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="imap_host">Host IMAP</label>
<input type="text" name="imap_host" id="imap_host" class="form-control"
value="<?php echo e($settings->imap_host ?? 'imap.gmail.com'); ?>"
placeholder="es. imap.gmail.com">
<small class="text-muted">Gmail: imap.gmail.com | Outlook: outlook.office365.com</small>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="imap_port">Porta</label>
<input type="number" name="imap_port" id="imap_port" class="form-control"
value="<?php echo e($settings->imap_port ?? 993); ?>">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="imap_encryption">Crittografia</label>
<select name="imap_encryption" id="imap_encryption" class="form-control">
<option value="ssl" <?php echo e(($settings->imap_encryption ?? 'ssl') == 'ssl' ? 'selected' : ''); ?>>SSL</option>
<option value="tls" <?php echo e(($settings->imap_encryption ?? '') == 'tls' ? 'selected' : ''); ?>>TLS</option>
<option value="none" <?php echo e(($settings->imap_encryption ?? '') == 'none' ? 'selected' : ''); ?>>Nessuna</option>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane" id="smtp">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">Configurazione Server SMTP (per invio email)</h3>
</div>
<div class="card-body">
<div class="alert alert-info">
<i class="fas fa-info-circle"></i>
<strong>Nota:</strong> Per inviare email devi configurare il server SMTP.
Per Gmail, usa <code>smtp.gmail.com</code> sulla porta <code>587</code> con TLS
e genera una <a href="https://support.google.com/accounts/answer/185833" target="_blank">App Password</a>.
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="smtp_host">Host SMTP</label>
<input type="text" name="smtp_host" id="smtp_host" class="form-control"
value="<?php echo e($settings->smtp_host ?? 'smtp.gmail.com'); ?>"
placeholder="es. smtp.gmail.com">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="smtp_port">Porta</label>
<input type="number" name="smtp_port" id="smtp_port" class="form-control"
value="<?php echo e($settings->smtp_port ?? 587); ?>">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="smtp_encryption">Crittografia</label>
<select name="smtp_encryption" id="smtp_encryption" class="form-control">
<option value="tls" <?php echo e(($settings->smtp_encryption ?? 'tls') == 'tls' ? 'selected' : ''); ?>>TLS</option>
<option value="ssl" <?php echo e(($settings->smtp_encryption ?? '') == 'ssl' ? 'selected' : ''); ?>>SSL</option>
<option value="none" <?php echo e(($settings->smtp_encryption ?? '') == 'none' ? 'selected' : ''); ?>>Nessuna</option>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="smtp_username">Username SMTP</label>
<input type="text" name="smtp_username" id="smtp_username" class="form-control"
value="<?php echo e($settings->smtp_username ?? ''); ?>"
placeholder="lascia vuoto per usare l'account IMAP">
<small class="text-muted">Generalmente uguale all'account email</small>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="smtp_password">Password SMTP / App Password</label>
<input type="password" name="smtp_password" id="smtp_password" class="form-control"
placeholder="<?php echo e($settings->smtp_password ? '••••••••' : ''); ?>">
<small class="text-muted">Lascia vuoto per usare la password IMAP</small>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane" id="account">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">Credenziali Account</h3>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="imap_username">Username/Email</label>
<input type="text" name="imap_username" id="imap_username" class="form-control"
value="<?php echo e($settings->imap_username ?? ''); ?>"
placeholder="es. tuo@gmail.com">
<small class="text-muted">Per Gmail usa l'indirizzo completo</small>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="imap_password">Password / App Password</label>
<input type="password" name="imap_password" id="imap_password" class="form-control"
placeholder="">
<small class="text-muted">
<a href="https://support.google.com/accounts/answer/185833" target="_blank">
Per Gmail: genera una App Password
</a>
</small>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="email_address">Email Indirizzo</label>
<input type="email" name="email_address" id="email_address" class="form-control"
value="<?php echo e($settings->email_address ?? ''); ?>">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="email_name">Nome Visualizzato</label>
<input type="text" name="email_name" id="email_name" class="form-control"
value="<?php echo e($settings->email_name ?? ''); ?>"
placeholder="es. Nome Cognome">
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="reply_to">Email Risposta (Reply-To)</label>
<input type="email" name="reply_to" id="reply_to" class="form-control"
value="<?php echo e($settings->reply_to ?? ''); ?>">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane" id="sync">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">Sincronizzazione</h3>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="sync_interval_minutes">Intervallo Sync (minuti)</label>
<select name="sync_interval_minutes" id="sync_interval_minutes" class="form-control">
<option value="1" <?php echo e(($settings->sync_interval_minutes ?? 5) == 1 ? 'selected' : ''); ?>>1 minuto</option>
<option value="5" <?php echo e(($settings->sync_interval_minutes ?? 5) == 5 ? 'selected' : ''); ?>>5 minuti</option>
<option value="15" <?php echo e(($settings->sync_interval_minutes ?? 5) == 15 ? 'selected' : ''); ?>>15 minuti</option>
<option value="30" <?php echo e(($settings->sync_interval_minutes ?? 5) == 30 ? 'selected' : ''); ?>>30 minuti</option>
<option value="60" <?php echo e(($settings->sync_interval_minutes ?? 5) == 60 ? 'selected' : ''); ?>>1 ora</option>
</select>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Stato Connessione</label>
<div class="mt-2">
<?php if($settings->last_sync_at): ?>
<span class="badge badge-success">
<i class="fas fa-check-circle"></i> Ultimo sync: <?php echo e($settings->last_sync_at->format('d/m/Y H:i')); ?>
</span>
<?php else: ?>
<span class="badge badge-secondary">
<i class="fas fa-clock"></i> Mai sincronizzato
</span>
<?php endif; ?>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="is_active"
name="is_active" value="1" <?php echo e(($settings->is_active ?? false) ? 'checked' : ''); ?>>
<label class="custom-control-label" for="is_active">Account Email Attivo</label>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane" id="signature">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">Firma Email</h3>
</div>
<div class="card-body">
<div class="form-group">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="signature_enabled"
name="signature_enabled" value="1" <?php echo e(($settings->signature_enabled ?? true) ? 'checked' : ''); ?>>
<label class="custom-control-label" for="signature_enabled">Attiva firma automatica</label>
</div>
<small class="text-muted">Quando attivo, la firma verrà aggiunta in fondo a ogni email inviata</small>
</div>
<hr>
<div class="form-group">
<label for="signature">Testo Firma (formato HTML)</label>
<div id="signature-editor" style="height: 200px;"></div>
<input type="hidden" name="signature" id="signature_input" value="<?php echo e($settings->signature ?? ''); ?>">
<small class="text-muted">Usa il riquadro sopra per comporre la tua firma. HTML supportato.</small>
</div>
</div>
</div>
</div>
<div class="tab-pane" id="mittenti">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">Mittenti Aggiuntivi</h3>
<div class="card-tools">
<button type="button" class="btn btn-sm btn-success" data-toggle="modal" data-target="#senderModal" onclick="resetSenderForm()">
<i class="fas fa-plus mr-1"></i> Nuovo Mittente
</button>
</div>
</div>
<div class="card-body">
<?php if(session('success')): ?>
<div class="alert alert-success"><?php echo e(session('success')); ?></div>
<?php endif; ?>
<?php if(session('error')): ?>
<div class="alert alert-danger"><?php echo e(session('error')); ?></div>
<?php endif; ?>
<?php if($senderAccounts->count() > 0): ?>
<div class="table-responsive">
<table class="table table-bordered table-hover table-sm">
<thead>
<tr>
<th>Email</th>
<th>Nome</th>
<th>SMTP</th>
<th>Reply-To</th>
<th>Verify</th>
<th>Stato</th>
<th style="width: 160px;">Azioni</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $senderAccounts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sender): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td><strong><?php echo e($sender->email_address); ?></strong></td>
<td><?php echo e($sender->email_name ?: '-'); ?></td>
<td><small><?php echo e($sender->smtp_host ?: '-'); ?>:<?php echo e($sender->smtp_port ?: '-'); ?></small></td>
<td><small class="text-muted"><?php echo e($sender->reply_to ?: '-'); ?></small></td>
<td><small class="text-muted"><?php echo e($sender->verify_email ?: '-'); ?></small></td>
<td>
<?php if($sender->is_active): ?>
<span class="badge badge-success">Attivo</span>
<?php else: ?>
<span class="badge badge-secondary">Disattivo</span>
<?php endif; ?>
</td>
<td>
<button type="button" class="btn btn-xs btn-info" onclick="editSender(<?php echo e($sender->id); ?>)" title="Modifica">
<i class="fas fa-edit"></i>
</button>
<button type="button" class="btn btn-xs btn-success" onclick="testSenderSmtp(<?php echo e($sender->id); ?>)" title="Test SMTP">
<i class="fas fa-paper-plane"></i>
</button>
<form action="<?php echo e(route('impostazioni.sender.destroy', $sender->id)); ?>" method="POST" class="d-inline" onsubmit="return confirm('Eliminare il mittente <?php echo e($sender->email_address); ?>?')">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-xs btn-danger" title="Elimina">
<i class="fas fa-trash"></i>
</button>
</form>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
<?php else: ?>
<div class="text-center text-muted py-4">
<i class="fas fa-user-plus fa-2x mb-2"></i>
<p class="mb-0">Nessun mittente aggiuntivo configurato.</p>
<p class="mb-0">Usa il pulsante "Nuovo Mittente" per aggiungere un account di invio dedicato (es. Newsletter).</p>
</div>
<?php endif; ?>
</div>
</div>
<?php if($senderAccounts->count() > 0): ?>
<div class="card card-secondary">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-info-circle mr-2"></i>Come funziona</h3>
</div>
<div class="card-body">
<ul class="mb-0">
<li>I mittenti aggiuntivi sono account <strong>solo invio</strong> (SMTP) senza IMAP.</li>
<li>Puoi selezionarli nel <strong>compose email</strong> o negli <strong>invii mailing</strong>.</li>
<li>Il campo <strong>Reply-To</strong> imposta l'indirizzo di risposta (es. <code>no-reply@parrocchia.it</code>).</li>
<li>Il campo <strong>Verify Email</strong> riceve un report di riepilogo dopo ogni invio massivo con l'esito (ok/falliti).</li>
<li>Se Reply-To non è impostato, viene usato Verify Email come fallback.</li>
</ul>
</div>
</div>
<?php endif; ?>
</div>
</div>
<div class="card-footer">
<button type="submit" class="btn btn-primary">
<i class="fas fa-save mr-1"></i> Salva Impostazioni
</button>
<button type="button" class="btn btn-info ml-2" onclick="testConnection()">
<i class="fas fa-plug mr-1"></i> Test Connessione IMAP
</button>
<button type="button" class="btn btn-success ml-2" onclick="testSmtp()">
<i class="fas fa-paper-plane mr-1"></i> Test Invio Email (SMTP)
</button>
<a href="<?php echo e(route('impostazioni.email.sync')); ?>" class="btn btn-warning ml-2">
<i class="fas fa-sync mr-1"></i> Sincronizza Ora
</a>
</div>
</form>
</div>
</div>
<?php $__env->stopSection(); ?>
<div class="modal fade" id="senderModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<form id="senderForm" method="POST" action="<?php echo e(route('impostazioni.sender.store')); ?>">
<?php echo csrf_field(); ?>
<input type="hidden" name="_method" id="senderMethod" value="POST">
<input type="hidden" name="id" id="senderId" value="">
<div class="modal-header bg-primary">
<h5 class="modal-title" id="senderModalTitle"><i class="fas fa-user-plus mr-2"></i>Nuovo Mittente</h5>
<button type="button" class="close text-white" data-dismiss="modal">&times;</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="sender_email">Email *</label>
<input type="email" name="email_address" id="sender_email" class="form-control" required placeholder="newsletter@parrocchia.it">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="sender_name">Nome visualizzato</label>
<input type="text" name="email_name" id="sender_name" class="form-control" placeholder="Newsletter Parrocchiale">
</div>
</div>
</div>
<hr>
<h6>Configurazione SMTP</h6>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="sender_smtp_host">Host SMTP</label>
<input type="text" name="smtp_host" id="sender_smtp_host" class="form-control" placeholder="smtp.gmail.com">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="sender_smtp_port">Porta</label>
<input type="number" name="smtp_port" id="sender_smtp_port" class="form-control" value="587">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="sender_smtp_encryption">Crittografia</label>
<select name="smtp_encryption" id="sender_smtp_encryption" class="form-control">
<option value="tls">TLS</option>
<option value="ssl">SSL</option>
<option value="none">Nessuna</option>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="sender_smtp_username">Username SMTP</label>
<input type="text" name="smtp_username" id="sender_smtp_username" class="form-control" placeholder="Lascia vuoto per usare l'email">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="sender_smtp_password">Password SMTP</label>
<input type="password" name="smtp_password" id="sender_smtp_password" class="form-control" placeholder="......">
<small class="text-muted">Lascia vuoto per non cambiare</small>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="sender_reply_to">Reply-To <small class="text-muted">(no-reply)</small></label>
<input type="email" name="reply_to" id="sender_reply_to" class="form-control" placeholder="no-reply@parrocchia.it">
<small class="text-muted">Indirizzo di risposta per le email inviate</small>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="sender_verify_email">Verify Email <small class="text-muted">(report)</small></label>
<input type="email" name="verify_email" id="sender_verify_email" class="form-control" placeholder="verifica@parrocchia.it">
<small class="text-muted">Riceve report riepilogo dopo invii massivi</small>
</div>
</div>
</div>
<div class="form-group">
<label for="sender_note">Nota interna</label>
<textarea name="note" id="sender_note" class="form-control" rows="2" placeholder="Es. Newsletter settimanale"></textarea>
</div>
<div class="form-group">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="sender_is_active" name="is_active" value="1" checked>
<label class="custom-control-label" for="sender_is_active">Mittente attivo</label>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annulla</button>
<button type="submit" class="btn btn-primary">
<i class="fas fa-save mr-1"></i> Salva Mittente
</button>
</div>
</form>
</div>
</div>
</div>
<?php $__env->startSection('scripts'); ?>
<script>
let senderAccounts = <?php echo json_encode($senderAccounts, 15, 512) ?>;
function resetSenderForm() {
document.getElementById('senderForm').action = '<?php echo e(route('impostazioni.sender.store')); ?>';
document.getElementById('senderMethod').value = 'POST';
document.getElementById('senderModalTitle').textContent = 'Nuovo Mittente';
document.getElementById('senderForm').reset();
document.getElementById('senderId').value = '';
document.getElementById('sender_is_active').checked = true;
document.getElementById('sender_smtp_password').placeholder = '';
document.getElementById('sender_smtp_password').required = false;
}
function editSender(id) {
const sender = senderAccounts.find(s => s.id === id);
if (!sender) return;
document.getElementById('senderForm').action = '<?php echo e(route('impostazioni.sender.update', '')); ?>/' + id;
document.getElementById('senderMethod').value = 'PUT';
document.getElementById('senderModalTitle').textContent = 'Modifica Mittente - ' + sender.email_address;
document.getElementById('senderId').value = sender.id;
document.getElementById('sender_email').value = sender.email_address;
document.getElementById('sender_name').value = sender.email_name || '';
document.getElementById('sender_smtp_host').value = sender.smtp_host || '';
document.getElementById('sender_smtp_port').value = sender.smtp_port || 587;
document.getElementById('sender_smtp_encryption').value = sender.smtp_encryption || 'tls';
document.getElementById('sender_smtp_username').value = sender.smtp_username || '';
document.getElementById('sender_smtp_password').value = '';
document.getElementById('sender_smtp_password').placeholder = '......';
document.getElementById('sender_smtp_password').required = false;
document.getElementById('sender_reply_to').value = sender.reply_to || '';
document.getElementById('sender_verify_email').value = sender.verify_email || '';
document.getElementById('sender_note').value = sender.note || '';
document.getElementById('sender_is_active').checked = sender.is_active;
$('#senderModal').modal('show');
}
function testSenderSmtp(id) {
const email = prompt('Inserisci l\'indirizzo email a cui inviare il test:');
if (!email || !email.includes('@')) return;
const btn = event.target;
btn.disabled = true;
btn.innerHTML = '<i class="fas fa-spinner fa-spin"></i>';
$.ajax({
url: '<?php echo e(route('impostazioni.sender.test', '')); ?>/' + id,
method: 'POST',
headers: { 'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>' },
data: { email: email },
timeout: 30000,
success: function(response) {
btn.disabled = false;
btn.innerHTML = '<i class="fas fa-paper-plane"></i>';
alert(response.success ? '✅ ' + response.message : '❌ ' + response.message);
},
error: function(xhr) {
btn.disabled = false;
btn.innerHTML = '<i class="fas fa-paper-plane"></i>';
const msg = xhr.responseJSON?.message || 'Errore di connessione';
alert('❌ ' + msg);
}
});
}
function testConnection() {
$.ajax({
url: '<?php echo e(route('impostazioni.email.test')); ?>',
method: 'POST',
headers: { 'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>' },
success: function(response) {
if (response.success) {
alert('✅ ' + response.message);
} else {
alert('❌ ' + response.message);
}
},
error: function() {
alert('❌ Errore nella richiesta');
}
});
}
function testSmtp() {
var email = prompt('Inserisci l\'indirizzo email a cui inviare il test:');
if (!email) return;
if (!email.includes('@')) {
alert('⚠️ Indirizzo email non valido');
return;
}
var btn = event.target;
btn.disabled = true;
btn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Invio...';
$.ajax({
url: '<?php echo e(route('impostazioni.email.testSmtp')); ?>',
method: 'POST',
headers: { 'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>' },
data: { email: email },
timeout: 30000,
success: function(response) {
btn.disabled = false;
btn.innerHTML = '<i class="fas fa-paper-plane mr-1"></i> Test Invio Email (SMTP)';
if (response.success) {
alert('✅ ' + response.message);
} else {
alert('❌ ' + response.message);
}
},
error: function(xhr, status, error) {
btn.disabled = false;
btn.innerHTML = '<i class="fas fa-paper-plane mr-1"></i> Test Invio Email (SMTP)';
if (xhr.responseJSON && xhr.responseJSON.message) {
alert('❌ ' + xhr.responseJSON.message);
} else {
alert('❌ Errore: ' + status + ' - ' + error);
}
}
});
}
function createEditor() {
var container = document.querySelector('#signature-editor');
if (!container || container.querySelector('.ql-toolbar')) return;
var quill = new Quill('#signature-editor', {
theme: 'snow',
modules: {
toolbar: [
['bold', 'italic', 'underline'],
[{ 'color': [] }, { 'background': [] }],
[{ 'header': 1 }, { 'header': 2 }, { 'header': 3 }],
[{ 'align': [] }],
[{ 'list': 'ordered'}, { 'list': 'bullet' }],
['link', 'image'],
['clean', 'code']
]
}
});
var signatureInput = document.getElementById('signature_input');
var isEditingHtml = false;
quill.getModule('toolbar').addHandler('code', function() {
if (!isEditingHtml) {
var textarea = document.createElement('textarea');
textarea.className = 'ql-editor';
textarea.style.cssText = 'font-family: monospace; min-height: 150px; width: 100%;';
textarea.value = signatureInput.value;
quill.root.innerHTML = '';
quill.root.appendChild(textarea);
textarea.focus();
isEditingHtml = true;
} else {
var textarea = quill.root.querySelector('textarea');
if (textarea) {
signatureInput.value = textarea.value;
quill.root.innerHTML = textarea.value;
}
isEditingHtml = false;
}
});
if (signatureInput.value) {
quill.root.innerHTML = signatureInput.value;
}
quill.on('text-change', function() {
if (!isEditingHtml) {
signatureInput.value = quill.root.innerHTML;
}
});
}
function initSignatureEditor() {
if (document.querySelector('#signature-editor .ql-toolbar')) return;
if (typeof Quill === 'undefined') {
var script = document.createElement('script');
script.src = 'https://cdn.quilljs.com/1.3.7/quill.min.js';
script.onload = createEditor;
document.head.appendChild(script);
var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'https://cdn.quilljs.com/1.3.7/quill.snow.css';
document.head.appendChild(link);
} else {
createEditor();
}
}
$('a[data-toggle="tab"]').on('shown.bs.tab', function(e) {
if ($(e.target).attr('href') === '#signature') {
setTimeout(initSignatureEditor, 100);
}
});
if ($('#signature').hasClass('active')) {
initSignatureEditor();
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/admin/email-settings/index.blade.php ENDPATH**/ ?>
@@ -1,70 +0,0 @@
<?php $__env->startSection('title', 'Gestione Ruoli'); ?>
<?php $__env->startSection('page_title', 'Gestione Ruoli'); ?>
<?php $__env->startSection('breadcrumbs'); ?>
<li class="breadcrumb-item active">Admin</li>
<li class="breadcrumb-item active">Ruoli</li>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">Ruoli Predefiniti</h3>
<a href="/admin/ruoli/create" class="btn btn-success btn-sm float-right">
<i class="fas fa-plus"></i> Nuovo Ruolo
</a>
</div>
<div class="card-body">
<table class="table table-bordered">
<thead>
<tr>
<th>Nome</th>
<th>Descrizione</th>
<th>Utenti</th>
<th>Permessi</th>
<th style="width: 100px;">Azioni</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $ruoli; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ruolo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td><strong><?php echo e($ruolo->name); ?></strong></td>
<td><?php echo e($ruolo->description); ?></td>
<td><span class="badge badge-info"><?php echo e($ruolo->users_count); ?></span></td>
<td>
<?php $__currentLoopData = $ruolo->permissions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $module => $level): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<span class="badge badge-<?php echo e($level == 2 ? 'success' : ($level == 1 ? 'info' : 'secondary')); ?>">
<?php echo e(ucfirst($module)); ?>: <?php echo e($level == 2 ? 'Full' : ($level == 1 ? 'Read' : 'None')); ?>
</span>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</td>
<td>
<a href="<?php echo e(url('/admin/ruoli/' . $ruolo->id . '/edit')); ?>" class="btn btn-xs btn-warning">
<i class="fas fa-edit"></i>
</a>
<?php if($ruolo->users_count == 0): ?>
<form method="POST" action="<?php echo e(url('/admin/ruoli/' . $ruolo->id)); ?>" style="display: inline;">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Eliminare questo ruolo?')">
<i class="fas fa-trash"></i>
</button>
</form>
<?php else: ?>
<button type="button" class="btn btn-xs btn-secondary" disabled title="Utenti associati: <?php echo e($ruolo->users_count); ?>">
<i class="fas fa-trash"></i>
</button>
<?php endif; ?>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/admin/ruoli/index.blade.php ENDPATH**/ ?>
@@ -1,31 +0,0 @@
<?php if($paginator->hasPages()): ?>
<nav role="navigation" aria-label="<?php echo __('Pagination Navigation'); ?>">
<ul class="pagination">
<?php if($paginator->onFirstPage()): ?>
<li class="page-item disabled" aria-disabled="true">
<span class="page-link"><?php echo __('pagination.previous'); ?></span>
</li>
<?php else: ?>
<li class="page-item">
<a class="page-link" href="<?php echo e($paginator->previousPageUrl()); ?>" rel="prev">
<?php echo __('pagination.previous'); ?>
</a>
</li>
<?php endif; ?>
<?php if($paginator->hasMorePages()): ?>
<li class="page-item">
<a class="page-link" href="<?php echo e($paginator->nextPageUrl()); ?>" rel="next"><?php echo __('pagination.next'); ?></a>
</li>
<?php else: ?>
<li class="page-item disabled" aria-disabled="true">
<span class="page-link"><?php echo __('pagination.next'); ?></span>
</li>
<?php endif; ?>
</ul>
</nav>
<?php endif; ?>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/simple-bootstrap-5.blade.php ENDPATH**/ ?>
File diff suppressed because one or more lines are too long
@@ -1,30 +0,0 @@
<?php if($paginator->hasPages()): ?>
<nav role="navigation" aria-label="<?php echo e(__('Pagination Navigation')); ?>" class="flex gap-2 items-center justify-between">
<?php if($paginator->onFirstPage()): ?>
<span class="inline-flex items-center px-4 py-2 text-sm font-medium text-gray-600 bg-white border border-gray-300 cursor-not-allowed leading-5 rounded-md dark:text-gray-300 dark:bg-gray-700 dark:border-gray-600">
<?php echo __('pagination.previous'); ?>
</span>
<?php else: ?>
<a href="<?php echo e($paginator->previousPageUrl()); ?>" rel="prev" class="inline-flex items-center px-4 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-700 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-800 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-200 dark:focus:border-blue-700 dark:active:bg-gray-700 dark:active:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-900 dark:hover:text-gray-200">
<?php echo __('pagination.previous'); ?>
</a>
<?php endif; ?>
<?php if($paginator->hasMorePages()): ?>
<a href="<?php echo e($paginator->nextPageUrl()); ?>" rel="next" class="inline-flex items-center px-4 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-700 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-800 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-200 dark:focus:border-blue-700 dark:active:bg-gray-700 dark:active:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-900 dark:hover:text-gray-200">
<?php echo __('pagination.next'); ?>
</a>
<?php else: ?>
<span class="inline-flex items-center px-4 py-2 text-sm font-medium text-gray-600 bg-white border border-gray-300 cursor-not-allowed leading-5 rounded-md dark:text-gray-300 dark:bg-gray-700 dark:border-gray-600">
<?php echo __('pagination.next'); ?>
</span>
<?php endif; ?>
</nav>
<?php endif; ?>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/simple-tailwind.blade.php ENDPATH**/ ?>
@@ -1,35 +0,0 @@
<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;
$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames((['message']));
foreach ($attributes->all() as $__key => $__value) {
if (in_array($__key, $__propNames)) {
$$__key = $$__key ?? $__value;
} else {
$__newAttributes[$__key] = $__value;
}
}
$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);
unset($__propNames);
unset($__newAttributes);
foreach (array_filter((['message']), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
$$__key = $$__key ?? $__value;
}
$__defined_vars = get_defined_vars();
foreach ($attributes->all() as $__key => $__value) {
if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}
unset($__defined_vars, $__key, $__value); ?>
<div class="bg-white/[2%] border border-neutral-200 dark:border-neutral-800 rounded-md w-full p-5 uppercase text-sm text-center font-mono shadow-xs text-neutral-600 dark:text-neutral-400">
<span class="text-neutral-400 dark:text-neutral-600">// </span><?php echo e($message); ?>
</div>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/empty-state.blade.php ENDPATH**/ ?>
@@ -1,98 +0,0 @@
<?php $__env->startSection('title', 'Log Attività'); ?>
<?php $__env->startSection('page_title', 'Log Attività'); ?>
<?php $__env->startSection('breadcrumbs'); ?>
<li class="breadcrumb-item active">Admin</li>
<li class="breadcrumb-item active">Log Attività</li>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">Attività di Sistema</h3>
</div>
<div class="card-body">
<form method="GET" class="mb-3">
<div class="row">
<div class="col-md-2">
<select name="user_id" class="form-control">
<option value="">Tutti gli utenti</option>
<?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $u): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($u->id); ?>" <?php echo e(request('user_id') == $u->id ? 'selected' : ''); ?>><?php echo e($u->name); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<div class="col-md-2">
<select name="module" class="form-control">
<option value="">Tutti i moduli</option>
<?php $__currentLoopData = $modules; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $module): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($module); ?>" <?php echo e(request('module') == $module ? 'selected' : ''); ?>><?php echo e($module); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<div class="col-md-2">
<select name="action" class="form-control">
<option value="">Tutte le azioni</option>
<option value="create" <?php echo e(request('action') == 'create' ? 'selected' : ''); ?>>Create</option>
<option value="update" <?php echo e(request('action') == 'update' ? 'selected' : ''); ?>>Update</option>
<option value="delete" <?php echo e(request('action') == 'delete' ? 'selected' : ''); ?>>Delete</option>
<option value="login" <?php echo e(request('action') == 'login' ? 'selected' : ''); ?>>Login</option>
</select>
</div>
<div class="col-md-2">
<input type="date" name="from" class="form-control" value="<?php echo e(request('from')); ?>" placeholder="Da">
</div>
<div class="col-md-2">
<input type="date" name="to" class="form-control" value="<?php echo e(request('to')); ?>" placeholder="A">
</div>
<div class="col-md-2">
<button type="submit" class="btn btn-primary">Filtra</button>
<a href="/admin/activity-logs" class="btn btn-secondary">Reset</a>
</div>
</div>
</form>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Data/Ora</th>
<th>Utente</th>
<th>Azione</th>
<th>Modulo</th>
<th>Descrizione</th>
<th>IP</th>
</tr>
</thead>
<tbody>
<?php $__empty_1 = true; $__currentLoopData = $logs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $log): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<tr>
<td><small><?php echo e($log->created_at->format('d/m/Y H:i:s')); ?></small></td>
<td><?php echo e($log->user->name ?? 'Sistema'); ?></td>
<td>
<span class="badge badge-<?php echo e($log->action == 'delete' ? 'danger' : ($log->action == 'create' ? 'success' : ($log->action == 'login' ? 'info' : 'warning'))); ?>">
<?php echo e($log->action); ?>
</span>
</td>
<td><?php echo e($log->module); ?></td>
<td><?php echo e($log->description); ?></td>
<td><small><?php echo e($log->ip_address); ?></small></td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<tr>
<td colspan="6" class="text-center">Nessun log presente</td>
</tr>
<?php endif; ?>
</tbody>
</table>
<?php echo e($logs->links()); ?>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/admin/activity-logs/index.blade.php ENDPATH**/ ?>
@@ -1,115 +0,0 @@
<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;
$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames((['title', 'markdown']));
foreach ($attributes->all() as $__key => $__value) {
if (in_array($__key, $__propNames)) {
$$__key = $$__key ?? $__value;
} else {
$__newAttributes[$__key] = $__value;
}
}
$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);
unset($__propNames);
unset($__newAttributes);
foreach (array_filter((['title', 'markdown']), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
$$__key = $$__key ?? $__value;
}
$__defined_vars = get_defined_vars();
foreach ($attributes->all() as $__key => $__value) {
if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}
unset($__defined_vars, $__key, $__value); ?>
<script>
const markdown = <?php echo e(Illuminate\Support\Js::from($markdown)); ?>
</script>
<div
class="flex items-center justify-between"
x-data="{
copied: false,
async copyToClipboard() {
try {
await window.copyToClipboard(markdown);
this.copied = true;
setTimeout(() => { this.copied = false }, 3000);
} catch (err) {
console.error('Failed to copy the markdown: ', err);
}
}
}"
>
<div class="flex items-center gap-2 h-[56px]">
<div class="w-[18px] h-[18px] flex items-center justify-center bg-rose-500 rounded-md">
<svg width="2" height="10" class="text-white" viewBox="0 0 2 10" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1.00006 6.3188C1.41416 6.3188 1.75006 5.98295 1.75006 5.56885V1.43115C1.75006 1.01705 1.41416 0.681152 1.00006 0.681152C0.585961 0.681152 0.250061 1.01705 0.250061 1.43115V5.56885C0.250061 5.98295 0.585961 6.3188 1.00006 6.3188Z" fill="currentColor" />
<path d="M1.00006 9.41699C1.55235 9.41699 2.00007 8.96929 2.00007 8.41699C2.00007 7.86469 1.55235 7.41699 1.00006 7.41699C0.447781 7.41699 6.10352e-05 7.86469 6.10352e-05 8.41699C6.10352e-05 8.96929 0.447781 9.41699 1.00006 9.41699Z" fill="currentColor "/>
</svg>
</div>
<div class="font-medium text-sm text-neutral-900 dark:text-white">
<?php echo e($title); ?>
</div>
</div>
<button
x-cloak
class="<?php echo \Illuminate\Support\Arr::toCssClasses([
"text-sm rounded-md border px-3 h-8 flex items-center gap-2 transition-colors duration-200 ease-in-out cursor-pointer shadow-xs",
"text-neutral-600 dark:text-neutral-400 bg-white/5 border-neutral-200 hover:bg-neutral-100 dark:bg-white/5 dark:border-white/10 dark:hover:bg-white/10",
]); ?>"
@click="copyToClipboard()"
>
<?php if (isset($component)) { $__componentOriginal8894ff2e6e6bd543865d608162806b35 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal8894ff2e6e6bd543865d608162806b35 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.icons.copy','data' => ['class' => 'w-3 h-3','xShow' => '!copied']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::icons.copy'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'w-3 h-3','x-show' => '!copied']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal8894ff2e6e6bd543865d608162806b35)): ?>
<?php $attributes = $__attributesOriginal8894ff2e6e6bd543865d608162806b35; ?>
<?php unset($__attributesOriginal8894ff2e6e6bd543865d608162806b35); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal8894ff2e6e6bd543865d608162806b35)): ?>
<?php $component = $__componentOriginal8894ff2e6e6bd543865d608162806b35; ?>
<?php unset($__componentOriginal8894ff2e6e6bd543865d608162806b35); ?>
<?php endif; ?>
<?php if (isset($component)) { $__componentOriginal394a4f59b8774713925fcf456ba90b57 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal394a4f59b8774713925fcf456ba90b57 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'laravel-exceptions-renderer::components.icons.check','data' => ['class' => 'w-3 h-3 text-emerald-500','xShow' => 'copied']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('laravel-exceptions-renderer::icons.check'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'w-3 h-3 text-emerald-500','x-show' => 'copied']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal394a4f59b8774713925fcf456ba90b57)): ?>
<?php $attributes = $__attributesOriginal394a4f59b8774713925fcf456ba90b57; ?>
<?php unset($__attributesOriginal394a4f59b8774713925fcf456ba90b57); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal394a4f59b8774713925fcf456ba90b57)): ?>
<?php $component = $__componentOriginal394a4f59b8774713925fcf456ba90b57; ?>
<?php unset($__componentOriginal394a4f59b8774713925fcf456ba90b57); ?>
<?php endif; ?>
<span x-text="copied ? 'Copied to clipboard' : 'Copy as Markdown'"></span>
</button>
</div>
<?php /**PATH /var/www/html/glastree/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/topbar.blade.php ENDPATH**/ ?>
@@ -1,178 +0,0 @@
<?php $__env->startSection('title', 'Nuova Email'); ?>
<?php $__env->startSection('page_title', 'Composizione Email'); ?>
<?php $__env->startSection('content'); ?>
<div class="row">
<div class="col-md-12">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-edit mr-2"></i>Nuova Email</h3>
</div>
<div class="card-body">
<form method="POST" action="<?php echo e(route('email.send')); ?>" id="emailForm" enctype="multipart/form-data">
<?php echo csrf_field(); ?>
<?php if($senderAccounts->count() > 0): ?>
<div class="form-group">
<label for="mittente_id">Da (mittente)</label>
<select name="mittente_id" id="mittente_id" class="form-control">
<option value="0">Sistema — <?php echo e(optional(\App\Models\EmailSetting::getActive())->email_address ?? 'Configura email'); ?></option>
<?php $__currentLoopData = $senderAccounts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sender): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($sender->id); ?>"><?php echo e($sender->email_name ?: $sender->email_address); ?> &lt;<?php echo e($sender->email_address); ?>&gt;</option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<small class="text-muted">Seleziona un mittente alternativo per l'invio. Lascia "Sistema" per usare l'account predefinito.</small>
</div>
<?php endif; ?>
<div class="form-group">
<label>Destinatari *</label>
<div class="mb-2">
<select name="destinatario_tipo" id="destinatario_tipo" class="form-control" onchange="toggleDestinatari()">
<option value="manuale">Email Manuale</option>
<option value="individui">Singoli Individui</option>
<option value="gruppo">Membri di un Gruppo</option>
<option value="mailing_list">Mailing List</option>
</select>
</div>
<div id="manual-input" class="destinatari-section">
<input type="text" name="to" id="to_manual" class="form-control"
placeholder="destinatario@email.it" value="<?php echo e($prefill['to'] ?? ''); ?>">
</div>
<div id="individui-input" class="destinatari-section" style="display: none;">
<select name="individui[]" id="individui-select" class="form-control" multiple size="5">
<?php $__currentLoopData = $individui; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ind): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($ind->id); ?>"><?php echo e($ind->cognito); ?> <?php echo e($ind->nome); ?> (<?php echo e($ind->email_primaria ?? 'senza email'); ?>)</option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<small class="text-muted">Tieni premuto Ctrl per selezionare più individui</small>
</div>
<div id="gruppo-input" class="destinatari-section" style="display: none;">
<select name="gruppo_id" id="gruppo-select" class="form-control mb-2" onchange="loadGruppiContatti()">
<option value="">Seleziona gruppo...</option>
<?php $__currentLoopData = $gruppi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $gruppo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($gruppo->id); ?>"><?php echo e($gruppo->nome); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<div id="gruppo-contatti" class="border rounded p-2" style="max-height: 150px; overflow-y: auto;">
<em class="text-muted">Seleziona un gruppo per vedere i contatti</em>
</div>
</div>
<div id="mailing-list-input" class="destinatari-section" style="display: none;">
<select name="mailing_list_id" id="mailing-list-select" class="form-control">
<option value="">Seleziona mailing list...</option>
<?php $__currentLoopData = $mailingLists; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($list->id); ?>"><?php echo e($list->nome); ?> (<?php echo e($list->contatti->count()); ?> contatti)</option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
</div>
<div class="form-group">
<label for="subject">Oggetto *</label>
<input type="text" name="subject" id="subject" class="form-control"
value="<?php echo e($prefill['subject'] ?? ''); ?>" required>
</div>
<div class="form-group">
<label for="body">Messaggio *</label>
<textarea name="body" id="body" class="form-control" rows="15" required><?php echo e($prefill['body'] ?? ''); ?></textarea>
</div>
<div class="form-group">
<label>Allegati</label>
<div class="border rounded p-3 bg-light">
<label class="btn btn-sm btn-success mb-0">
<i class="fas fa-upload mr-1"></i> Carica file
<input type="file" name="allegati[]" multiple class="d-none">
</label>
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">
<i class="fas fa-paper-plane mr-1"></i> Invia
</button>
<button type="button" class="btn btn-secondary ml-2" onclick="saveDraft()">
<i class="fas fa-save mr-1"></i> Salva Bozze
</button>
<a href="<?php echo e(route('email.index')); ?>" class="btn btn-default ml-2">
Annulla
</a>
</div>
</form>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script>
function toggleDestinatari() {
const tipo = document.getElementById('destinatario_tipo').value;
document.querySelectorAll('.destinatari-section').forEach(el => el.style.display = 'none');
if (tipo === 'manuale') {
document.getElementById('manual-input').style.display = 'block';
} else if (tipo === 'individui') {
document.getElementById('individui-input').style.display = 'block';
} else if (tipo === 'gruppo') {
document.getElementById('gruppo-input').style.display = 'block';
} else if (tipo === 'mailing_list') {
document.getElementById('mailing-list-input').style.display = 'block';
}
}
function loadGruppiContatti() {
const gruppoId = document.getElementById('gruppo-select').value;
const container = document.getElementById('gruppo-contatti');
if (!gruppoId) {
container.innerHTML = '<em class="text-muted">Seleziona un gruppo per vedere i contatti</em>';
return;
}
fetch('/gruppi/' + gruppoId + '/individui-email')
.then(response => response.json())
.then(data => {
if (data.length === 0) {
container.innerHTML = '<em class="text-muted">Nessun contatto email nel gruppo</em>';
return;
}
let html = '';
data.forEach(ind => {
if (ind.email) {
html += `<div class="form-check">
<input class="form-check-input" type="checkbox" name="gruppo_emails[]" value="${ind.email}" id="email-${ind.id}">
<label class="form-check-label" for="email-${ind.id}">${ind.cogname} ${ind.nome} - ${ind.email}</label>
</div>`;
}
});
container.innerHTML = html || '<em class="text-muted">Nessun contatto email nel gruppo</em>';
});
}
function saveDraft() {
const form = document.getElementById('emailForm');
const formData = new FormData(form);
fetch('<?php echo e(route('email.draft')); ?>', {
method: 'POST',
headers: { 'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>' },
body: formData
})
.then(response => response.json())
.then(data => {
alert('Bozza salvata!');
});
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/email/compose.blade.php ENDPATH**/ ?>
@@ -1,180 +0,0 @@
<?php $__env->startSection('title', 'Mailing Lists'); ?>
<?php $__env->startSection('page_title', 'Mailing Lists'); ?>
<?php
$canWriteMailing = Auth::user()->canManage('mailing');
$canDeleteMailing = Auth::user()->canDelete('mailing');
?>
<?php $__env->startSection('content'); ?>
<?php if(session('success')): ?>
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<?php echo e(session('success')); ?>
</div>
<?php endif; ?>
<div class="card">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-list mr-2"></i>Elenco Mailing Lists</h3>
<div class="card-tools">
<?php if($canDeleteMailing): ?>
<div class="btn-group mr-2">
<button type="button" class="btn btn-sm btn-danger" onclick="deleteSelected()">
<i class="fas fa-trash mr-1"></i> Elimina Selezionati
</button>
</div>
<?php endif; ?>
<?php if($canWriteMailing): ?>
<a href="<?php echo e(route('mailing-liste.create')); ?>" class="btn btn-success btn-sm">
<i class="fas fa-plus mr-1"></i> Nuova Lista
</a>
<?php endif; ?>
</div>
</div>
<div class="card-body p-0">
<?php if($mailingLists->count() > 0): ?>
<table class="table table-bordered table-hover table-striped mb-0">
<thead class="thead-light">
<tr>
<th style="width: 40px;">
<?php if($canDeleteMailing): ?>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="select-all" onchange="toggleSelectAll(this)">
<label class="custom-control-label" for="select-all"></label>
</div>
<?php endif; ?>
</th>
<th>Nome</th>
<th>Descrizione</th>
<th style="width: 100px;">Contatti</th>
<th style="width: 100px;">Stato</th>
<th style="width: 130px;">Creata il</th>
<th style="width: 100px;">Azioni</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $mailingLists; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lista): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr data-id="<?php echo e($lista->id); ?>">
<td>
<?php if($canDeleteMailing): ?>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input row-checkbox" id="row-checkbox-<?php echo e($lista->id); ?>" value="<?php echo e($lista->id); ?>">
<label class="custom-control-label" for="row-checkbox-<?php echo e($lista->id); ?>"></label>
</div>
<?php endif; ?>
</td>
<td>
<a href="<?php echo e(route('mailing-liste.show', $lista->id)); ?>"><?php echo e($lista->nome); ?></a>
</td>
<td><?php echo e($lista->descrizione ?: '-'); ?></td>
<td>
<span class="badge badge-info"><?php echo e($lista->contatti->count()); ?></span>
</td>
<td>
<?php if($lista->attiva): ?>
<span class="badge badge-success">Attiva</span>
<?php else: ?>
<span class="badge badge-secondary">Disattiva</span>
<?php endif; ?>
</td>
<td><?php echo e($lista->created_at->format('d/m/Y')); ?></td>
<td>
<a href="<?php echo e(route('mailing-liste.show', $lista->id)); ?>" class="btn btn-xs btn-info" title="Visualizza">
<i class="fas fa-eye"></i>
</a>
<?php if($canWriteMailing): ?>
<a href="<?php echo e(route('mailing-liste.edit', $lista->id)); ?>" class="btn btn-xs btn-warning" title="Modifica">
<i class="fas fa-edit"></i>
</a>
<form action="<?php echo e(route('mailing-liste.destroy', $lista->id)); ?>" method="POST" class="d-inline">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Eliminare questa lista?')" title="Elimina">
<i class="fas fa-trash"></i>
</button>
</form>
<?php endif; ?>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
<?php else: ?>
<div class="text-center text-muted py-4">
<i class="fas fa-list fa-3x mb-3"></i>
<p>Nessuna mailing list</p>
<?php if($canWriteMailing): ?>
<a href="<?php echo e(route('mailing-liste.create')); ?>" class="btn btn-success">Crea la prima lista</a>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</div>
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog">
<?php if($canDeleteMailing): ?>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header bg-danger">
<h5 class="modal-title text-white"><i class="fas fa-trash-alt mr-2"></i>Conferma Eliminazione</h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span>&times;</span>
</button>
</div>
<div class="modal-body">
<p>Stai per eliminare <strong id="delete-count">0</strong> mailing list selezionate.</p>
<p class="text-muted small">Verranno eliminati anche tutti i contatti associati.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annulla</button>
<button type="button" class="btn btn-danger" onclick="confirmDelete()">Elimina</button>
</div>
</div>
</div>
<?php endif; ?>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script>
function toggleSelectAll(source) {
document.querySelectorAll('.row-checkbox').forEach(cb => cb.checked = source.checked);
}
function getSelectedIds() {
return Array.from(document.querySelectorAll('.row-checkbox:checked')).map(cb => cb.value);
}
function deleteSelected() {
const selectedIds = getSelectedIds();
if (selectedIds.length === 0) {
alert('Seleziona almeno una mailing list');
return;
}
document.getElementById('delete-count').textContent = selectedIds.length;
document.querySelector('#deleteModal .btn-danger').onclick = function() {
const form = document.createElement('form');
form.method = 'POST';
form.action = '/mailing-liste/mass-elimina';
const csrfToken = document.querySelector('meta[name="csrf-token"]')?.content || '<?php echo e(csrf_token()); ?>';
let html = `<input type="hidden" name="_token" value="${csrfToken}">`;
selectedIds.forEach(function(id) {
html += `<input type="hidden" name="ids[]" value="${id}">`;
});
form.innerHTML = html;
document.body.appendChild(form);
form.submit();
};
$('#deleteModal').modal('show');
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/mailing-liste/index.blade.php ENDPATH**/ ?>

Some files were not shown because too many files have changed in this diff Show More