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';
|
2023-03-13 16:22:50 +01:00
|
|
|
use Modules\Checklists\ChecklistItem;
|
2023-02-27 11:14:58 +01:00
|
|
|
use Modules\Checklists\Check;
|
|
|
|
|
|
|
|
$id_record = get("id_record");
|
2023-03-13 16:22:50 +01:00
|
|
|
$main_check = get("main_check");
|
|
|
|
|
|
|
|
if($main_check){
|
|
|
|
$record = ChecklistItem::find($id_record);
|
|
|
|
}else{
|
|
|
|
$record = Check::find($id_record);
|
|
|
|
}
|
2023-02-27 11:14:58 +01:00
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-6">
|
2023-03-13 16:22:50 +01:00
|
|
|
{[ "type": "text", "label": "<?php echo tr('Descrizione'); ?>", "name": "content_edit", "required": 1, "value": "<?=$record->content?>" ]}
|
2023-02-27 11:14:58 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12 text-right">
|
|
|
|
<button type="button" class="btn btn-success" id="save-btn"><i class='fa fa-save'></i> <?php echo tr('Salva'); ?></button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
$('#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",
|
|
|
|
id_record: "<?=$id_record?>",
|
2023-03-13 16:22:50 +01:00
|
|
|
content: $('#content_edit').val(),
|
|
|
|
main_check: "<?=$main_check?>",
|
2023-02-27 11:14:58 +01:00
|
|
|
}, function(){
|
|
|
|
location.reload();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|