1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-06-05 22:09:38 +02:00

Controllo per impedire l'aggiunta di note interne vuote

Migliorie minori
This commit is contained in:
Luca
2020-07-17 16:03:21 +02:00
parent 714b0ca810
commit e4fc9b3c52
5 changed files with 77 additions and 53 deletions

View File

@@ -207,6 +207,9 @@ if (!empty($interventi)) {
</td> </td>
</tr>'; </tr>';
$stati = $interventi->groupBy('idstatointervento');
if (count($stati)>0){
// Totali per stato // Totali per stato
echo ' echo '
<tr> <tr>
@@ -215,7 +218,6 @@ if (!empty($interventi)) {
</td> </td>
</tr>'; </tr>';
$stati = $interventi->groupBy('idstatointervento');
foreach ($stati as $interventi_collegati) { foreach ($stati as $interventi_collegati) {
$stato = $interventi_collegati->first()->stato; $stato = $interventi_collegati->first()->stato;
$totale_stato = sum(array_column($interventi_collegati->toArray(), 'totale_imponibile')); $totale_stato = sum(array_column($interventi_collegati->toArray(), 'totale_imponibile'));
@@ -234,6 +236,8 @@ if (!empty($interventi)) {
</tr>'; </tr>';
} }
}
echo ' echo '
</table>'; </table>';
} }
@@ -269,16 +273,16 @@ if (!empty($totale_ore_contratto)) {
echo ' echo '
<div class="row"> <div class="row">
<big class="col-md-4 col-md-offset-4 text-center"> <big class="col-md-4 col-md-offset-4 text-center">
<table class="table text-left"> <table class="table text-left table-striped table-bordered">
<tr> <tr>
<td colspan="2">'.tr('Ore in contratto').':</td> <td>'.tr('Ore a contratto').':</td>
<td colspan="2" class="text-right">'.Translator::numberToLocale($totale_ore_contratto).'</td> <td class="text-right">'.Translator::numberToLocale($totale_ore_contratto).'</td>
</tr> </tr>
<tr> <tr>
<td>'.tr('Ore erogate totali').':</td> <td>'.tr('Ore erogate totali').':</td>
<td class="text-right">'.Translator::numberToLocale($totale_ore).'</td> <td class="text-right">'.Translator::numberToLocale($totale_ore).'</td>
</tr>
<tr>
<td>'.tr('Ore residue totali').':</td> <td>'.tr('Ore residue totali').':</td>
<td class="text-right">'.Translator::numberToLocale(floatval($totale_ore_contratto) - floatval($totale_ore)).'</td> <td class="text-right">'.Translator::numberToLocale(floatval($totale_ore_contratto) - floatval($totale_ore)).'</td>
</tr> </tr>
@@ -286,8 +290,9 @@ if (!empty($totale_ore_contratto)) {
<tr> <tr>
<td>'.tr('Ore erogate concluse').':</td> <td>'.tr('Ore erogate concluse').':</td>
<td class="text-right">'.Translator::numberToLocale($totale_ore_completate).'</td> <td class="text-right">'.Translator::numberToLocale($totale_ore_completate).'</td>
</tr>
<td>'.tr('Ore residue').':</td> <tr>
<td>'.tr('Ore residue concluse').':</td>
<td class="text-right">'.Translator::numberToLocale(floatval($totale_ore_contratto) - floatval($totale_ore_completate)).'</td> <td class="text-right">'.Translator::numberToLocale(floatval($totale_ore_contratto) - floatval($totale_ore_completate)).'</td>
</tr> </tr>
</table> </table>

View File

@@ -170,16 +170,16 @@ switch (get('op')) {
foreach ($rsp as $r) { foreach ($rsp as $r) {
if ($r['mese'] == $mese) { if ($r['mese'] == $mese) {
if (date('Ymd', strtotime($r['data_richiesta'])) < date('Ymd')) { if (date('Ymd', strtotime($r['data_richiesta'])) < date('Ymd')) {
$class = 'fc-event-danger'; $class = 'danger';
} else { } else {
$class = 'fc-event-primary'; $class = 'primary';
} }
echo ' echo '
<div class="fc-event '.$class.'" data-id="'.$r['id'].'" data-idcontratto="'.$r['idcontratto'].'" data-ref="'.$r['ref'].'">'.(($r['ref'] == 'intervento') ? '<i class=\'fa fa-wrench pull-right\'></i>' : '<i class=\'fa fa-file-text-o pull-right\'></i>').' <div class="fc-event fc-event-'.$class.'" data-id="'.$r['id'].'" data-idcontratto="'.$r['idcontratto'].'" data-ref="'.$r['ref'].'">'.(($r['ref'] == 'intervento') ? '<i class=\'fa fa-wrench pull-right\'></i>' : '<i class=\'fa fa-file-text-o pull-right\'></i>').'
<b>'.$r['ragione_sociale'].'</b><br>'.Translator::dateToLocale($r['data_richiesta']).' ('.$r['tipointervento'].')<div class="request" >'.(!empty($r['richiesta']) ? ' - '.$r['richiesta'] : '').'</div>'.(!empty($r['nomecontratto']) ? '<br><b>Contratto:</b> '.$r['nomecontratto'] : ''). <b>'.$r['ragione_sociale'].'</b><br>'.Translator::dateToLocale($r['data_richiesta']).' ('.$r['tipointervento'].')<div class="request" >'.(!empty($r['richiesta']) ? ' - '.$r['richiesta'] : '').'</div>'.(!empty($r['nomecontratto']) ? '<br><b>Contratto:</b> '.$r['nomecontratto'] : '').
(!empty($r['data_scadenza'] and $r['data_scadenza'] != '0000-00-00 00:00:00') ? '<br><small>'.tr('entro il: ').Translator::dateToLocale($r['data_scadenza']).'</small>' : ''). (!empty($r['data_scadenza'] and $r['data_scadenza'] != '0000-00-00 00:00:00') ? '<br><small>'.tr('entro il: ').Translator::dateToLocale($r['data_scadenza']).'</small>' : '').
(($r['ref'] == 'intervento') ? (Modules::link('Interventi', $r['id'], '<i class="fa fa-eye"></i>', null, 'title="'.tr('Visualizza scheda').'" class="btn btn-primary btn-xs pull-right"')).'<br>' : (Modules::link('Contratti', $r['idcontratto'], '<i class="fa fa-eye"></i>', null, 'title="'.tr('Visualizza scheda').'" class="btn btn-primary btn-xs pull-right"')).'<br>'). (($r['ref'] == 'intervento') ? (Modules::link('Interventi', $r['id'], '<i class="fa fa-eye"></i>', null, 'title="'.tr('Visualizza scheda').'" class="btn btn-'.$class.' btn-xs pull-right"')).'<br>' : (Modules::link('Contratti', $r['idcontratto'], '<i class="fa fa-eye"></i>', null, 'title="'.tr('Visualizza scheda').'" class="btn btn-'.$class.' btn-xs pull-right"')).'<br>').
'</div>'; '</div>';
} }
} ?> } ?>

View File

@@ -206,6 +206,9 @@ if (!empty($interventi)) {
</td> </td>
</tr>'; </tr>';
$stati = $interventi->groupBy('idstatointervento');
if (count($stati)>0){
// Totali per stato // Totali per stato
echo ' echo '
<tr> <tr>
@@ -214,7 +217,6 @@ if (!empty($interventi)) {
</td> </td>
</tr>'; </tr>';
$stati = $interventi->groupBy('idstatointervento');
foreach ($stati as $interventi_collegati) { foreach ($stati as $interventi_collegati) {
$stato = $interventi_collegati->first()->stato; $stato = $interventi_collegati->first()->stato;
$totale_stato = sum(array_column($interventi_collegati->toArray(), 'totale_imponibile')); $totale_stato = sum(array_column($interventi_collegati->toArray(), 'totale_imponibile'));
@@ -233,6 +235,8 @@ if (!empty($interventi)) {
</tr>'; </tr>';
} }
}
echo ' echo '
</table>'; </table>';
} }

View File

@@ -87,10 +87,25 @@ if ($structure->permission == 'rw') {
<!-- PULSANTI --> <!-- PULSANTI -->
<div class="row"> <div class="row">
<div class="col-md-12 text-right"> <div class="col-md-12 text-right">
<button type="sumbit" class="btn btn-primary"> <button type="submit" class="btn btn-primary" disabled id="aggiungi_nota" >
<i class="fa fa-plus"></i> '.tr('Aggiungi').' <i class="fa fa-plus"></i> '.tr('Aggiungi').'
</button> </button>
</div> </div>
</div> </div>
</form>'; </form>';
} }
echo '
<script>
$(document).ready(function(){
CKEDITOR.instances["contenuto"].on("key", function() {
setTimeout(function(){
if(CKEDITOR.instances["contenuto"].getData() == ""){
$("#aggiungi_nota").prop("disabled", true);
}
else $("#aggiungi_nota").prop("disabled", false);
}, 10);
});
});
</script>';

View File

@@ -59,7 +59,7 @@ if ($pricing || !empty($totale_ore)) {
<th colspan="2" class="text-center"> <th colspan="2" class="text-center">
<b>'.Translator::numberToLocale($totale_ore - $totale_ore_impiegate).'</b><br> <b>'.Translator::numberToLocale($totale_ore - $totale_ore_impiegate).'</b><br>
<p>'.tr('Ore erogate').': '.Translator::numberToLocale($totale_ore_impiegate).'</p> <p>'.tr('Ore erogate').': '.Translator::numberToLocale($totale_ore_impiegate).'</p>
<p>'.tr('Ore in contratto').': '.Translator::numberToLocale($totale_ore).'</p> <p>'.tr('Ore a contratto').': '.Translator::numberToLocale($totale_ore).'</p>
</th> </th>
</tr>'; </tr>';
} }