Aggiunta dei template predefiniti che non possono essere rinominati o eliminati

This commit is contained in:
Luca 2020-06-22 17:29:35 +02:00
parent 7ee366514a
commit a329713e2d
3 changed files with 26 additions and 3 deletions

View File

@ -2,6 +2,15 @@
include_once __DIR__.'/../../core.php'; include_once __DIR__.'/../../core.php';
if (!$record['predefined']) {
$attr = '';
} else {
$attr = 'readonly';
echo '<div class="alert alert-warning">'.tr('Alcune impostazioni non possono essere modificate per questo stato template.').'</div>';
}
?> ?>
<form action="" method="post" id="edit-form"> <form action="" method="post" id="edit-form">
<input type="hidden" name="op" value="update"> <input type="hidden" name="op" value="update">
@ -16,7 +25,7 @@ include_once __DIR__.'/../../core.php';
<div class="panel-body"> <div class="panel-body">
<div class="row"> <div class="row">
<div class="col-md-8"> <div class="col-md-8">
{[ "type": "text", "label": "<?php echo tr('Nome'); ?>", "name": "name", "value": "$name$", "required": 1 ]} {[ "type": "text", "label": "<?php echo tr('Nome'); ?>", "name": "name", "value": "$name$", "required": 1, "extra": "<?php echo $attr; ?>" ]}
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
@ -124,7 +133,16 @@ echo '
</div> </div>
</form> </form>
<?php
if (!$record['predefined']) {
?>
<a class="btn btn-danger ask" data-backto="record-list"> <a class="btn btn-danger ask" data-backto="record-list">
<i class="fa fa-trash"></i> <?php echo tr('Elimina'); ?> <i class="fa fa-trash"></i> <?php echo tr('Elimina'); ?>
</a> </a>
<?php
}
?>

View File

@ -17,8 +17,6 @@ if (( $record['attempt'] >= 10) && empty($record['sent_at'])) {
<i class="fa fa-envelope"></i> '.tr('Invia immeditamente').' <i class="fa fa-envelope"></i> '.tr('Invia immeditamente').'
</a>'; </a>';
}else if (!empty($record['sent_at'])) { }else if (!empty($record['sent_at'])) {
echo ' echo '

View File

@ -32,3 +32,10 @@ INSERT INTO `zz_segments` (`id`, `id_module`, `name`, `clause`, `position`, `pat
(NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Interventi'), 'Tutti', '1=1', 'WHR', '####', '', 1, 0, 0, 0), (NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Interventi'), 'Tutti', '1=1', 'WHR', '####', '', 1, 0, 0, 0),
(NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Interventi'), 'Attività', 'orario_inizio BETWEEN ''|period_start|'' AND ''|period_end|'' OR orario_fine BETWEEN ''|period_start|'' AND ''|period_end|''', 'WHR', '####', '', 0, 0, 0, 0), (NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Interventi'), 'Attività', 'orario_inizio BETWEEN ''|period_start|'' AND ''|period_end|'' OR orario_fine BETWEEN ''|period_start|'' AND ''|period_end|''', 'WHR', '####', '', 0, 0, 0, 0),
(NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Interventi'), 'Promemoria', '((in_interventi_tecnici.orario_inizio=''0000-00-00 00:00:00'' AND in_interventi_tecnici.orario_fine=''0000-00-00 00:00:00'') OR in_interventi_tecnici.id IS NULL)', 'WHR', '####', '', 0, 0, 0, 0); (NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Interventi'), 'Promemoria', '((in_interventi_tecnici.orario_inizio=''0000-00-00 00:00:00'' AND in_interventi_tecnici.orario_fine=''0000-00-00 00:00:00'') OR in_interventi_tecnici.id IS NULL)', 'WHR', '####', '', 0, 0, 0, 0);
-- Aggiunta dei template predefiniti che non possono essere rinominati o eliminati
UPDATE `em_templates` SET `predefined` = '1' WHERE `em_templates`.`name` = 'Notifica intervento';
UPDATE `em_templates` SET `predefined` = '1' WHERE `em_templates`.`name` = 'Notifica rimozione intervento';
UPDATE `em_templates` SET `predefined` = '1' WHERE `em_templates`.`name` = 'Reset password';
UPDATE `em_templates` SET `predefined` = '1' WHERE `em_templates`.`name` = 'Rapportino intervento';