mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
Bugfix
Fix di alcuni bug in vari moduli.
This commit is contained in:
@@ -64,10 +64,12 @@ class HTMLWrapper implements WrapperInterface
|
|||||||
unset($values['show-help']);
|
unset($values['show-help']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$values['data-parsley-errors-container'] = '#'.$values['id'].'-errors';
|
$rand = rand(0, 99);
|
||||||
|
|
||||||
|
$values['data-parsley-errors-container'] = '#'.$values['id'].$rand.'-errors';
|
||||||
|
|
||||||
$result .= '
|
$result .= '
|
||||||
<div id="'.$values['id'].'-errors"></div>';
|
<div id="'.$values['id'].$rand.'-errors"></div>';
|
||||||
|
|
||||||
if (!empty($values['label'])) {
|
if (!empty($values['label'])) {
|
||||||
$result .= '
|
$result .= '
|
||||||
|
@@ -79,7 +79,7 @@ class Permissions
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
die(_('Accesso negato!'));
|
die(_('Accesso negato'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
include_once __DIR__.'/../../core.php';
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
if (!get_var('Attiva aggiornamenti')) {
|
if (!get_var('Attiva aggiornamenti')) {
|
||||||
die(_('Accesso negato!'));
|
die(_('Accesso negato'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$tmp = $_FILES['blob']['tmp_name'];
|
$tmp = $_FILES['blob']['tmp_name'];
|
||||||
|
@@ -260,7 +260,7 @@ else {
|
|||||||
// Calcolo mese iniziale e finale del contratto
|
// Calcolo mese iniziale e finale del contratto
|
||||||
$rs2 = $dbo->fetchArray('SELECT data_accettazione, data_conclusione, TIMESTAMPDIFF(MONTH, data_accettazione, data_conclusione) AS mesi FROM co_contratti WHERE id='.prepare($id_record));
|
$rs2 = $dbo->fetchArray('SELECT data_accettazione, data_conclusione, TIMESTAMPDIFF(MONTH, data_accettazione, data_conclusione) AS mesi FROM co_contratti WHERE id='.prepare($id_record));
|
||||||
|
|
||||||
if ($rs2[0]['data_accettazione'] != '0000-00-00 00:00:00' && $rs2[0]['data_conclusione'] != '0000-00-00 00:00:00') {
|
if (!empty($rs2[0]['data_accettazione']) && !empty($rs2[0]['data_conclusione'])) {
|
||||||
$n_mesi = $rs2[0]['mesi'] + 1;
|
$n_mesi = $rs2[0]['mesi'] + 1;
|
||||||
$mese_start = date('m', strtotime($rs2[0]['data_accettazione']));
|
$mese_start = date('m', strtotime($rs2[0]['data_accettazione']));
|
||||||
|
|
||||||
|
@@ -14,7 +14,7 @@ include_once __DIR__.'/../../core.php';
|
|||||||
|
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<a href="#" class="pull-right" id="default">[Default]</a>
|
<a href="#" class="pull-right" id="default">[Default]</a>
|
||||||
{[ "type": "textarea", "label": "<?php echo _('Contenuto'); ?>", "name": "contenuto", "required": 1, "class": "autosize", "value": "", "extra": "rows='10'" ]}
|
{[ "type": "textarea", "label": "<?php echo _('Contenuto'); ?>", "name": "contenuto", "id": "contenuto_add", "required": 1, "class": "autosize", "value": "", "extra": "rows='10'" ]}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ include_once __DIR__.'/../../core.php';
|
|||||||
|
|
||||||
var ini = '[Nome]\ntipo = span\nvalore = "Componente di esempio"\n\n[Marca]\ntipo = input\nvalore =\n\n[Tipo]\ntipo = select\nvalore =\nopzioni = "Tipo 1", "Tipo 2"\n\n[Data di installazione]\ntipo = date\nvalore =\n\n[Note]\ntipo = textarea\nvalore =\n';
|
var ini = '[Nome]\ntipo = span\nvalore = "Componente di esempio"\n\n[Marca]\ntipo = input\nvalore =\n\n[Tipo]\ntipo = select\nvalore =\nopzioni = "Tipo 1", "Tipo 2"\n\n[Data di installazione]\ntipo = date\nvalore =\n\n[Note]\ntipo = textarea\nvalore =\n';
|
||||||
|
|
||||||
$( "#contenuto" ).val(ini);
|
$("#contenuto_add").val(ini);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -88,30 +88,9 @@ if (!empty($rs2)) {
|
|||||||
$costo_km_consuntivo = $r['prezzo_km_consuntivo'];
|
$costo_km_consuntivo = $r['prezzo_km_consuntivo'];
|
||||||
$costo_ore_consuntivo = $r['prezzo_ore_consuntivo'];
|
$costo_ore_consuntivo = $r['prezzo_ore_consuntivo'];
|
||||||
|
|
||||||
$orario_inizio = '0000-00-00 00:00:00';
|
$orario_inizio = !empty($r['orario_inizio']) ? Translator::timestampToLocale($r['orario_inizio']) : $r['orario_inizio'];
|
||||||
$orario_fine = '0000-00-00 00:00:00';
|
$orario_fine = !empty($r['orario_fine']) ? Translator::timestampToLocale($r['orario_fine']) : $r['orario_fine'];
|
||||||
|
|
||||||
$pausa_inizio = '0000-00-00 00:00:00';
|
|
||||||
$pausa_fine = '0000-00-00 00:00:00';
|
|
||||||
|
|
||||||
if (!empty($r['orario_inizio'])) {
|
|
||||||
$orario_inizio = Translator::timestampToLocale($r['orario_inizio']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($r['orario_fine'])) {
|
|
||||||
$orario_fine = Translator::timestampToLocale($r['orario_fine']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($r['pausa_inizio'])) {
|
|
||||||
$pausa_inizio = Translator::timestampToLocale($r['pausa_inizio']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($r['pausa_fine'])) {
|
|
||||||
$pausa_fine = Translator::timestampToLocale($r['pausa_fine']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$orario = $orario_inizio.' - '.$orario_fine;
|
$orario = $orario_inizio.' - '.$orario_fine;
|
||||||
$pausa = $pausa_inizio.' - '.$pausa_fine;
|
|
||||||
|
|
||||||
$km = $r['km'];
|
$km = $r['km'];
|
||||||
$ore = $r['ore'];
|
$ore = $r['ore'];
|
||||||
|
@@ -142,7 +142,7 @@ if (!empty($rs2)) {
|
|||||||
$nome_componente = $rs2[$j]['nome'];
|
$nome_componente = $rs2[$j]['nome'];
|
||||||
$filename = $rs2[$j]['filename'];
|
$filename = $rs2[$j]['filename'];
|
||||||
|
|
||||||
if ($rs2[$j]['data_sostituzione'] == '0000-00-00 00:00:00') {
|
if (empty($rs2[$j]['data_sostituzione'])) {
|
||||||
$statocomponente = str_replace('_DATE_', Translator::dateToLocale($rs2[$j]['data']), _('INSTALLATO in data _DATE_'));
|
$statocomponente = str_replace('_DATE_', Translator::dateToLocale($rs2[$j]['data']), _('INSTALLATO in data _DATE_'));
|
||||||
} else {
|
} else {
|
||||||
$statocomponente = str_replace('_DATE_', Translator::dateToLocale($rs2[$j]['data_sostituzione']), _('SOSTITUITO in data _DATE_'));
|
$statocomponente = str_replace('_DATE_', Translator::dateToLocale($rs2[$j]['data_sostituzione']), _('SOSTITUITO in data _DATE_'));
|
||||||
@@ -257,7 +257,7 @@ if (!empty($rs2)) {
|
|||||||
// Sostituisci componente con un altro dello stesso tipo, posso sostituire solo i componenti installati
|
// Sostituisci componente con un altro dello stesso tipo, posso sostituire solo i componenti installati
|
||||||
echo '
|
echo '
|
||||||
<div class="col-md-12">';
|
<div class="col-md-12">';
|
||||||
if ($rs2[$j]['data_sostituzione'] == '0000-00-00 00:00:00') {
|
if (empty($rs2[$j]['data_sostituzione'])) {
|
||||||
echo "
|
echo "
|
||||||
<a href=\"javascript:;\" class=\"text-warning\" onclick=\"if( confirm('"._('Vuoi sostituire questo componente con un altro dello stesso tipo?')."') ){ location.href='".$rootdir.'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'&op=sostituiscicomponente&backto=record-edit&filename='.$filename.'&id='.$rs2[$j]['id']."'; }\"><i class='fa fa-refresh'></i> "._('Sostituisci questo componente').'</a><br><br>';
|
<a href=\"javascript:;\" class=\"text-warning\" onclick=\"if( confirm('"._('Vuoi sostituire questo componente con un altro dello stesso tipo?')."') ){ location.href='".$rootdir.'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'&op=sostituiscicomponente&backto=record-edit&filename='.$filename.'&id='.$rs2[$j]['id']."'; }\"><i class='fa fa-refresh'></i> "._('Sostituisci questo componente').'</a><br><br>';
|
||||||
} else {
|
} else {
|
||||||
|
@@ -63,7 +63,7 @@ if ($options != '' && $options != 'menu' && $options != 'custom') {
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-md-12">
|
<div class="col-xs-12 col-md-12">
|
||||||
<p><strong>'._('Query risultante').':</strong></p>
|
<p><strong>'._('Query risultante').':</strong></p>
|
||||||
<p>'.$module_query.'</p>
|
<p>'.htmlentities($module_query).'</p>
|
||||||
</div>
|
</div>
|
||||||
</div>';
|
</div>';
|
||||||
}
|
}
|
||||||
|
@@ -39,16 +39,12 @@ foreach ($replace as $prefix => $values) {
|
|||||||
$keys = array_keys($values);
|
$keys = array_keys($values);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($values)) {
|
|
||||||
// Azienda predefinita non impostata
|
// Azienda predefinita non impostata
|
||||||
if ($prefix == 'f_') {
|
if (empty($values) && $prefix == 'f_') {
|
||||||
$values = [];
|
$values = [];
|
||||||
foreach ($keys as $key) {
|
foreach ($keys as $key) {
|
||||||
$values[$key] = '';
|
$values[$key] = '';
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
die(_('Accesso negato'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($rename as $key => $value) {
|
foreach ($rename as $key => $value) {
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
* Creazione dei campi per l'API (created_at e updated_at)
|
* Creazione dei campi per l'API (created_at e updated_at)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// I record precedenti vengono impostati a 0000-00-00 00:00:00
|
// I record precedenti vengono impostati a NULL
|
||||||
$tables = [
|
$tables = [
|
||||||
'an_anagrafiche',
|
'an_anagrafiche',
|
||||||
'an_anagrafiche_agenti',
|
'an_anagrafiche_agenti',
|
||||||
|
Reference in New Issue
Block a user