2023-02-27 11:14:58 +01:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
|
|
|
* Copyright (C) DevCode s.r.l.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
include_once __DIR__.'/../../../core.php';
|
|
|
|
use Modules\Checklists\Check;
|
2023-08-04 14:54:28 +02:00
|
|
|
use Modules\Checklists\ChecklistItem;
|
2023-02-27 11:14:58 +01:00
|
|
|
|
2023-08-04 14:54:28 +02:00
|
|
|
$id_record = get('id_record');
|
|
|
|
$main_check = get('main_check');
|
2023-03-13 16:22:50 +01:00
|
|
|
|
2023-08-04 14:54:28 +02:00
|
|
|
if ($main_check) {
|
2023-03-13 16:22:50 +01:00
|
|
|
$record = ChecklistItem::find($id_record);
|
2023-08-04 14:54:28 +02:00
|
|
|
} else {
|
2023-03-13 16:22:50 +01:00
|
|
|
$record = Check::find($id_record);
|
|
|
|
}
|
2023-02-27 11:14:58 +01:00
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<div class="row">
|
2023-07-18 17:08:33 +02:00
|
|
|
<div class="col-md-12">
|
2023-07-21 17:19:43 +02:00
|
|
|
<?php
|
|
|
|
echo input([
|
|
|
|
'type' => 'ckeditor',
|
|
|
|
'label' => tr('Descrizione'),
|
|
|
|
'name' => 'content_edit',
|
|
|
|
'required' => 1,
|
2023-08-04 14:54:28 +02:00
|
|
|
'value' => htmlentities($record->content),
|
2023-07-21 17:19:43 +02:00
|
|
|
]);
|
|
|
|
?>
|
2023-02-27 11:14:58 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
2023-07-21 17:19:43 +02:00
|
|
|
<div class="col-md-4">
|
2023-08-04 14:54:28 +02:00
|
|
|
{[ "type": "checkbox", "label": "<?php echo tr('Utilizza come titolo'); ?>", "name": "is_titolo", "value": "<?php echo $record->is_titolo; ?>" ]}
|
2023-07-21 17:19:43 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-8 text-right">
|
|
|
|
<br><br><button type="button" class="btn btn-success" id="save-btn"><i class='fa fa-check'></i> <?php echo tr('Salva'); ?></button>
|
2023-02-27 11:14:58 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
2023-07-21 17:19:43 +02:00
|
|
|
init();
|
2023-02-27 11:14:58 +01:00
|
|
|
$('#save-btn').click(function() {
|
|
|
|
$('#save-btn').attr('disabled', true);
|
|
|
|
$('#save-btn').html('<i class="fa fa-spinner fa-spin"></i> <?php echo tr('Salvataggio in corso...'); ?>');
|
|
|
|
|
|
|
|
$.post('<?php echo $rootdir; ?>/modules/checklists/ajax.php', {
|
|
|
|
op: "edit_check",
|
2023-08-04 14:54:28 +02:00
|
|
|
id_record: "<?php echo $id_record; ?>",
|
2023-07-21 17:19:43 +02:00
|
|
|
content: input('content_edit').get(),
|
|
|
|
is_titolo: input('is_titolo').get(),
|
2023-08-04 14:54:28 +02:00
|
|
|
main_check: "<?php echo $main_check; ?>",
|
2023-02-27 11:14:58 +01:00
|
|
|
}, function(){
|
|
|
|
location.reload();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|