openstamanager/modules/interventi/buttons.php

39 lines
1.3 KiB
PHP
Raw Normal View History

<?php
include_once __DIR__.'/../../core.php';
2018-07-18 15:20:10 +02:00
if (empty($record['firma_file'])) {
$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>',
]).'</span>';
}
2020-06-08 11:59:40 +02:00
// Duplica intervento
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>
<!-- 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' : '').'>
<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() {
openModal("'.tr('Anteprima e firma').'", "'.$module->fileurl('add_firma.php').'?id_module='.$id_module.'&id_record='.$id_record.'&anteprima=1");
}
</script>';