2018-02-19 10:52:42 +01:00
|
|
|
<?php
|
2020-09-07 15:04:06 +02:00
|
|
|
/*
|
|
|
|
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
2021-01-20 15:08:51 +01:00
|
|
|
* Copyright (C) DevCode s.r.l.
|
2020-09-07 15:04:06 +02:00
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
2018-02-19 10:52:42 +01:00
|
|
|
|
2018-06-23 18:35:08 +02:00
|
|
|
$result['id'] = isset($result['id']) ? $result['id'] : null;
|
|
|
|
|
2019-02-14 17:49:58 +01:00
|
|
|
// Form di inserimento riga documento
|
2018-02-19 10:52:42 +01:00
|
|
|
echo '
|
2023-11-17 17:27:31 +01:00
|
|
|
<form action="'.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'" method="post" id="submit-form">
|
2018-08-30 18:20:30 +02:00
|
|
|
<input type="hidden" name="id_plugin" value="'.$id_plugin.'">
|
|
|
|
<input type="hidden" name="hash" value="tab_'.$id_plugin.'">
|
2018-02-19 10:52:42 +01:00
|
|
|
<input type="hidden" name="backto" value="record-edit">
|
2018-08-30 18:20:30 +02:00
|
|
|
|
|
|
|
<input type="hidden" name="op" value="'.$options['op'].'">
|
2018-02-19 10:52:42 +01:00
|
|
|
<input type="hidden" name="idriga" value="'.$result['id'].'">
|
|
|
|
<input type="hidden" name="dir" value="'.$options['dir'].'">';
|
|
|
|
|
|
|
|
echo '
|
|
|
|
|response|';
|
|
|
|
|
2018-02-19 17:57:27 +01:00
|
|
|
$button = $options['action'] == 'add' ? tr('Aggiungi') : tr('Modifica');
|
|
|
|
$icon = $options['action'] == 'add' ? 'fa-plus' : 'fa-pencil';
|
2018-02-19 11:25:56 +01:00
|
|
|
|
2018-02-19 10:52:42 +01:00
|
|
|
echo '
|
|
|
|
|
|
|
|
<!-- PULSANTI -->
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12 text-right">
|
2023-11-17 17:27:31 +01:00
|
|
|
<button type="button" class="btn btn-primary pull-right" onclick="submitForm()"><i class="fa '.$icon.'"></i> '.$button.'</button>
|
2018-02-19 10:52:42 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>';
|
|
|
|
|
|
|
|
echo '
|
2019-07-26 17:40:52 +02:00
|
|
|
<script>$(document).ready(init)</script>';
|
2023-11-17 17:27:31 +01:00
|
|
|
|
|
|
|
echo '
|
|
|
|
<script>
|
|
|
|
function submitForm() {
|
|
|
|
var form = input("#submit-form");
|
|
|
|
salvaForm("#submit-form", {
|
|
|
|
id_module: "'.$id_module.'",
|
|
|
|
id_record: "'.$id_record.'",
|
|
|
|
}).then(function(response) {
|
|
|
|
form.getElement().closest("div[id^=bs-popup").modal("hide");
|
|
|
|
caricaRighe(null);
|
|
|
|
});
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
2023-11-24 18:24:20 +01:00
|
|
|
</script>';
|