1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-06-05 22:09:38 +02:00

Miglioramento orari lavorativi (#287)

This commit is contained in:
Thomas Zilio
2018-09-18 17:58:15 +02:00
parent 06ab3b0558
commit f12103192b
3 changed files with 25 additions and 16 deletions

View File

@@ -574,12 +574,12 @@ if (empty($domenica)) {
slotDuration: '00:15:00', slotDuration: '00:15:00',
defaultView: '<?php echo $def; ?>', defaultView: '<?php echo $def; ?>',
<?php <?php
$orario_lavorativo = setting('Abilitare orario lavorativo');
if (!empty($orario_lavorativo)) { echo "
echo " minTime: '".setting('Inizio orario lavorativo')."',
minTime: '08:00:00', maxTime: '".setting('Fine orario lavorativo')."',
maxTime: '20:00:00',"; ";
}
?> ?>
lazyFetching: true, lazyFetching: true,
selectHelper: true, selectHelper: true,

View File

@@ -135,16 +135,18 @@ class Settings
// Lista predefinita // Lista predefinita
if (preg_match("/list\[(.+?)\]/", $setting->tipo, $m)) { if (preg_match("/list\[(.+?)\]/", $setting->tipo, $m)) {
$m = explode(',', $m[1]); $values = explode(',', $m[1]);
$list = '';
for ($j = 0; $j < count($m); ++$j) { $list = [];
if ($j != 0) { foreach ($values as $value) {
$list .= ','; $list[] = [
} 'id' => $value,
$list .= '\\"'.$m[$j].'\\": \\"'.$m[$j].'\\"'; 'text' => $value,
];
} }
$result = ' $result = '
{[ "type": "select", "label": "'.$setting->nome.'", "name": "setting['.$setting->id.']", "values": "list='.$list.'", "value": "'.$setting->valore.'", "required": "'.intval($required).'" ]}'; {[ "type": "select", "label": "'.$setting->nome.'", "name": "setting['.$setting->id.']", "values": '.json_encode($list).', "value": "'.$setting->valore.'", "required": "'.intval($required).'" ]}';
} }
// Lista da query // Lista da query
@@ -159,8 +161,8 @@ class Settings
{[ "type": "checkbox", "label": "'.$setting->nome.'", "name": "setting['.$setting->id.']", "placeholder": "'.tr('Attivo').'", "value": "'.$setting->valore.'", "required": "'.intval($required).'" ]}'; {[ "type": "checkbox", "label": "'.$setting->nome.'", "name": "setting['.$setting->id.']", "placeholder": "'.tr('Attivo').'", "value": "'.$setting->valore.'", "required": "'.intval($required).'" ]}';
} }
// Textarea // Campi di default
elseif ($setting->tipo == 'textarea' || $setting->tipo == 'ckeditor') { elseif (in_array($setting->tipo, ['textarea', 'ckeditor', 'timestamp', 'date', 'time'])) {
$result = ' $result = '
{[ "type": "'.$setting->tipo.'", "label": "'.$setting->nome.'", "name": "setting['.$setting->id.']", "value": '.json_encode($setting->valore).', "required": "'.intval($required).'" ]}'; {[ "type": "'.$setting->tipo.'", "label": "'.$setting->nome.'", "name": "setting['.$setting->id.']", "value": '.json_encode($setting->valore).', "required": "'.intval($required).'" ]}';
} }

View File

@@ -293,3 +293,10 @@ DROP TABLE `co_preventivi_interventi`;
-- Aggiunto input CKEditor automatico -- Aggiunto input CKEditor automatico
UPDATE `zz_settings` SET `tipo` = 'ckeditor' WHERE `nome` = 'Dicitura fissa fattura'; UPDATE `zz_settings` SET `tipo` = 'ckeditor' WHERE `nome` = 'Dicitura fissa fattura';
-- Miglioramento dell'impostazione "Orario lavorativo"
UPDATE `zz_settings` SET `sezione` = 'Dashboard' WHERE `nome` IN ('Vista dashboard', 'Visualizzare la domenica sul calendario', 'Utilizzare i tooltip sul calendario');
DELETE FROM `zz_settings` WHERE `nome` = 'Abilitare orario lavorativo';
INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione`, `order`) VALUES
(NULL, 'Inizio orario lavorativo', '00:00:00', 'time', 1, 'Dashboard', 1),
(NULL, 'Fine orario lavorativo', '23:59:00', 'time', 1, 'Dashboard', 2);