2018-02-22 11:07:52 +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-22 11:07:52 +01:00
include_once __DIR__ . '/../../core.php' ;
2018-07-18 15:20:10 +02:00
if ( empty ( $record [ 'firma_file' ])) {
2018-02-22 11:07:52 +01:00
$frase = tr ( 'Anteprima e firma' );
$info_firma = '' ;
} else {
$frase = tr ( 'Nuova anteprima e firma' );
$info_firma = '<span class="label label-success"><i class="fa fa-edit"></i> ' . tr ( 'Firmato il _DATE_ alle _TIME_ da _PERSON_' , [
2018-07-18 15:20:10 +02:00
'_DATE_' => Translator :: dateToLocale ( $record [ 'firma_data' ]),
'_TIME_' => Translator :: timeToLocale ( $record [ 'firma_data' ]),
'_PERSON_' => '<b>' . $record [ 'firma_nome' ] . '</b>' ,
2018-02-22 11:07:52 +01:00
]) . '</span>' ;
}
2020-06-08 11:59:40 +02:00
// Duplica intervento
2021-02-18 18:48:44 +01:00
echo '
2020-07-31 08:56:41 +02:00
< button type = " button " class = " btn btn-primary " onclick = " duplicaIntervento() " >
< i class = " fa fa-copy " ></ i > '.tr(' Duplica attività ').'
</ button >
2018-02-22 11:07:52 +01:00
<!-- EVENTUALE FIRMA GIA\ ' EFFETTUATA -->
'.$info_firma.'
2020-07-31 08:56:41 +02:00
< button type = " button " class = " btn btn-primary " onclick = " anteprimaFirma() " '.($record[' flag_completato '] ? ' disabled ' : ' ').' >
2018-02-22 11:07:52 +01:00
< i class = " fa fa-desktop " ></ i > '.$frase.' ...
2020-07-31 08:56:41 +02:00
</ button >
< script >
function duplicaIntervento () {
openModal ( " '.tr('Duplica attività').' " , " '. $module->fileurl ('modals/duplicazione.php').'?id_module='. $id_module .'&id_record='. $id_record .' " );
}
function anteprimaFirma () {
2020-08-17 09:47:18 +02:00
openModal ( " '.tr('Anteprima e firma').' " , " '. $module->fileurl ('modals/anteprima_firma.php').'?id_module='. $id_module .'&id_record='. $id_record .'&anteprima=1 " );
2020-07-31 08:56:41 +02:00
}
</ script > ' ;
2020-07-31 14:57:23 +02:00
// Creazione altri documenti
2020-07-31 15:07:49 +02:00
// TODO: trasformazione delle sessioni in righe relative
/*
2020-07-31 14:57:23 +02:00
echo '
< div class = " btn-group " >
2020-07-31 16:13:24 +02:00
< button class = " btn btn-info dropdown-toggle '.(! $record['flag_completato'] ? 'disabled' : '').' " type = " button " data - toggle = " dropdown " aria - haspopup = " true " aria - expanded = " true " >
< i class = " fa fa-magic " ></ i > '.tr(' Crea ').'
< span class = " caret " ></ span >
</ button >
< ul class = " dropdown-menu dropdown-menu-right " >
2020-07-31 14:57:23 +02:00
< li >
< a data - href = " '. $structure->fileurl ('crea_documento.php').'?id_module='. $id_module .'&id_record='. $id_record .'&documento=fattura " data - toggle = " modal " data - title = " '.tr('Crea fattura').' " >
< i class = " fa fa-file " ></ i > '.tr(' Fattura ').'
</ a >
</ li >
</ ul >
</ div > ' ;
2020-07-31 15:07:49 +02:00
*/