reprogrammed functionality
This commit is contained in:
@@ -23,6 +23,10 @@ if ($settings && !array_key_exists('portal_purchases_enabled', $settings)) {
|
||||
$settings['portal_purchases_enabled'] = 1;
|
||||
}
|
||||
|
||||
if ($settings && !array_key_exists('rebooking_auto_approved', $settings)) {
|
||||
$settings['rebooking_auto_approved'] = 1;
|
||||
}
|
||||
|
||||
$is_new = !$settings;
|
||||
|
||||
$success_message = $error = "";
|
||||
@@ -55,6 +59,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
|
||||
|
||||
$portal_purchases_enabled = !empty($_POST['portal_purchases_enabled']) ? 1 : 0;
|
||||
$rebooking_auto_approved = !empty($_POST['rebooking_auto_approved']) ? 1 : 0;
|
||||
|
||||
// Se acquisti portale disabilitati → forza anche propagate a 0
|
||||
$auto_propagate_on_purchase = $portal_purchases_enabled
|
||||
@@ -68,8 +73,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
school_id, header_color, sidebar_color, payment_methods, currency_code, enable_notifications,
|
||||
allow_freeze_global, freeze_max_days_global, auto_propagate_on_purchase,
|
||||
allow_full_access_rebooking, allowed_product_types,
|
||||
portal_purchases_enabled
|
||||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
portal_purchases_enabled, rebooking_auto_approved
|
||||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
");
|
||||
$stmt->execute([
|
||||
$school_id,
|
||||
@@ -83,7 +88,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$auto_propagate_on_purchase,
|
||||
$allow_full_access_rebooking,
|
||||
$allowed_product_types,
|
||||
$portal_purchases_enabled
|
||||
$portal_purchases_enabled,
|
||||
$rebooking_auto_approved
|
||||
]);
|
||||
$success_message = "Impostazioni create con successo!";
|
||||
} else {
|
||||
@@ -92,7 +98,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
header_color = ?, sidebar_color = ?, payment_methods = ?, currency_code = ?, enable_notifications = ?,
|
||||
allow_freeze_global = ?, freeze_max_days_global = ?, auto_propagate_on_purchase = ?,
|
||||
allow_full_access_rebooking = ?, allowed_product_types = ?,
|
||||
portal_purchases_enabled = ?
|
||||
portal_purchases_enabled = ?, rebooking_auto_approved = ?
|
||||
WHERE school_id = ?
|
||||
");
|
||||
$stmt->execute([
|
||||
@@ -107,8 +113,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$allow_full_access_rebooking,
|
||||
$allowed_product_types,
|
||||
$portal_purchases_enabled,
|
||||
$rebooking_auto_approved,
|
||||
$school_id
|
||||
|
||||
]);
|
||||
$success_message = "Impostazioni aggiornate con successo!";
|
||||
}
|
||||
@@ -292,6 +298,24 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="my-5">
|
||||
|
||||
<!-- NUOVA SEZIONE: Approvazioni e Lezioni -->
|
||||
<h5 class="text-primary mb-4">Approvazioni e Lezioni</h5>
|
||||
|
||||
<div class="mt-4">
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" name="rebooking_auto_approved" id="rebooking_auto"
|
||||
<?php echo ($settings['rebooking_auto_approved'] ?? 1) ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label fw-bold" for="rebooking_auto">
|
||||
Riprogrammazione lezioni automatica (approvata subito)
|
||||
</label>
|
||||
</div>
|
||||
<small class="form-text text-muted">
|
||||
Se disattivato, ogni richiesta di riprogrammazione dovrà essere approvata manualmente dalla segreteria.
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div class="text-center mt-5">
|
||||
<button type="submit" class="btn btn-primary btn-lg px-5">
|
||||
Salva Impostazioni
|
||||
|
||||
Reference in New Issue
Block a user