mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-02 08:56:48 +01:00
Miglioramento orari lavorativi (#287)
This commit is contained in:
parent
06ab3b0558
commit
f12103192b
@ -574,12 +574,12 @@ if (empty($domenica)) {
|
||||
slotDuration: '00:15:00',
|
||||
defaultView: '<?php echo $def; ?>',
|
||||
<?php
|
||||
$orario_lavorativo = setting('Abilitare orario lavorativo');
|
||||
if (!empty($orario_lavorativo)) {
|
||||
echo "
|
||||
minTime: '08:00:00',
|
||||
maxTime: '20:00:00',";
|
||||
}
|
||||
|
||||
echo "
|
||||
minTime: '".setting('Inizio orario lavorativo')."',
|
||||
maxTime: '".setting('Fine orario lavorativo')."',
|
||||
";
|
||||
|
||||
?>
|
||||
lazyFetching: true,
|
||||
selectHelper: true,
|
||||
|
@ -135,16 +135,18 @@ class Settings
|
||||
|
||||
// Lista predefinita
|
||||
if (preg_match("/list\[(.+?)\]/", $setting->tipo, $m)) {
|
||||
$m = explode(',', $m[1]);
|
||||
$list = '';
|
||||
for ($j = 0; $j < count($m); ++$j) {
|
||||
if ($j != 0) {
|
||||
$list .= ',';
|
||||
}
|
||||
$list .= '\\"'.$m[$j].'\\": \\"'.$m[$j].'\\"';
|
||||
$values = explode(',', $m[1]);
|
||||
|
||||
$list = [];
|
||||
foreach ($values as $value) {
|
||||
$list[] = [
|
||||
'id' => $value,
|
||||
'text' => $value,
|
||||
];
|
||||
}
|
||||
|
||||
$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
|
||||
@ -159,8 +161,8 @@ class Settings
|
||||
{[ "type": "checkbox", "label": "'.$setting->nome.'", "name": "setting['.$setting->id.']", "placeholder": "'.tr('Attivo').'", "value": "'.$setting->valore.'", "required": "'.intval($required).'" ]}';
|
||||
}
|
||||
|
||||
// Textarea
|
||||
elseif ($setting->tipo == 'textarea' || $setting->tipo == 'ckeditor') {
|
||||
// Campi di default
|
||||
elseif (in_array($setting->tipo, ['textarea', 'ckeditor', 'timestamp', 'date', 'time'])) {
|
||||
$result = '
|
||||
{[ "type": "'.$setting->tipo.'", "label": "'.$setting->nome.'", "name": "setting['.$setting->id.']", "value": '.json_encode($setting->valore).', "required": "'.intval($required).'" ]}';
|
||||
}
|
||||
|
@ -293,3 +293,10 @@ DROP TABLE `co_preventivi_interventi`;
|
||||
|
||||
-- Aggiunto input CKEditor automatico
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user