mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-21 14:00:53 +01:00
Fix eventi ricorsivi su calendario
This commit is contained in:
parent
bc394c766b
commit
74382685d3
@ -141,23 +141,24 @@ switch (filter('op')) {
|
|||||||
AND
|
AND
|
||||||
co_statipreventivi.is_pianificabile=1';
|
co_statipreventivi.is_pianificabile=1';
|
||||||
|
|
||||||
$alldays = $dbo->fetchArray($query);
|
$preventivi = $dbo->fetchArray($query);
|
||||||
|
|
||||||
foreach ($alldays as $preventivo) {
|
foreach ($preventivi as $preventivo) {
|
||||||
if (!empty($preventivo['data_accettazione']) && $preventivo['data_accettazione'] != '0000-00-00') {
|
if (!empty($preventivo['data_accettazione']) && $preventivo['data_accettazione'] != '0000-00-00') {
|
||||||
$results[] = [
|
$results[] = [
|
||||||
'id' => 'A_'.$modulo_preventivi->id.'_'.$preventivo['id'],
|
'id' => 'A_'.$modulo_preventivi->id.'_'.$preventivo['id'],
|
||||||
'idintervento' => $preventivo['id'],
|
'idintervento' => $preventivo['id'],
|
||||||
'idtecnico' => '',
|
'idtecnico' => '',
|
||||||
'title' => '<div style=\'position:absolute; top:7%; right:3%;\' > '.(($preventivo['is_completato']) ? '<i class="fa fa-lock" aria-hidden="true"></i>' : '').' '.(($preventivo['have_attachments']) ? '<i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'</div>'.'<b>Accettazione prev. '.$preventivo['numero'].'</b> '.$preventivo['nome'].'<br><b>'.tr('Cliente').':</b> '.$preventivo['cliente'],
|
'title' => '<div style=\'position:absolute; top:7%; right:3%;\' > '.(($preventivo['is_completato']) ? '<i class="fa fa-lock" aria-hidden="true"></i>' : '').' '.(($preventivo['have_attachments']) ? '<i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'</div>'.'<b>'.tr('Accettazione prev.').' '.$preventivo['numero'].'</b> '.$preventivo['nome'].'<br><b>'.tr('Cliente').':</b> '.$preventivo['cliente'],
|
||||||
'start' => $preventivo['data_accettazione'],
|
'start' => $preventivo['data_accettazione'],
|
||||||
'end' => $preventivo['data_accettazione'],
|
//'end' => $preventivo['data_accettazione'],
|
||||||
'url' => base_path().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'],
|
'url' => base_path().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'],
|
||||||
'backgroundColor' => '#ff7f50',
|
'backgroundColor' => '#ff7f50',
|
||||||
'textColor' => color_inverse('#ff7f50'),
|
'textColor' => color_inverse('#ff7f50'),
|
||||||
'borderColor' => '#ff7f50',
|
'borderColor' => '#ff7f50',
|
||||||
'allDay' => true,
|
'allDay' => true,
|
||||||
'eventStartEditable' => false,
|
'eventStartEditable' => false,
|
||||||
|
'editable' => false,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,36 +167,43 @@ switch (filter('op')) {
|
|||||||
'id' => 'B_'.$modulo_preventivi->id.'_'.$preventivo['id'],
|
'id' => 'B_'.$modulo_preventivi->id.'_'.$preventivo['id'],
|
||||||
'idintervento' => $preventivo['id'],
|
'idintervento' => $preventivo['id'],
|
||||||
'idtecnico' => '',
|
'idtecnico' => '',
|
||||||
'title' => '<div style=\'position:absolute; top:7%; right:3%;\' > '.(($preventivo['is_completato']) ? '<i class="fa fa-lock" aria-hidden="true"></i>' : '').' '.(($preventivo['have_attachments']) ? '<i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'</div>'.'<b>Conclusione prev. '.$preventivo['numero'].'</b> '.$preventivo['nome'].'<br><b>'.tr('Cliente').':</b> '.$preventivo['cliente'],
|
'title' => '<div style=\'position:absolute; top:7%; right:3%;\' > '.(($preventivo['is_completato']) ? '<i class="fa fa-lock" aria-hidden="true"></i>' : '').' '.(($preventivo['have_attachments']) ? '<i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'</div>'.'<b>'.tr('Conclusione prev.').' '.$preventivo['numero'].'</b> '.$preventivo['nome'].'<br><b>'.tr('Cliente').':</b> '.$preventivo['cliente'],
|
||||||
'start' => $preventivo['data_conclusione'],
|
'start' => $preventivo['data_conclusione'],
|
||||||
'end' => $preventivo['data_conclusione'],
|
//'end' => $preventivo['data_conclusione'],
|
||||||
'url' => base_path().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'],
|
'url' => base_path().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'],
|
||||||
'backgroundColor' => '#ff7f50',
|
'backgroundColor' => '#ff7f50',
|
||||||
'textColor' => color_inverse('#ff7f50'),
|
'textColor' => color_inverse('#ff7f50'),
|
||||||
'borderColor' => '#ff7f50',
|
'borderColor' => '#ff7f50',
|
||||||
'allDay' => true,
|
'allDay' => true,
|
||||||
'eventStartEditable' => false,
|
'eventStartEditable' => false,
|
||||||
|
'editable' => false,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//# Box allDay eventi
|
//# Box allDay eventi (escluse festività)
|
||||||
$query = 'SELECT
|
$query = 'SELECT
|
||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
zz_events
|
`zz_events`
|
||||||
WHERE
|
WHERE
|
||||||
data >= '.prepare($start).' AND data <= '.prepare($end);
|
`zz_events`.`is_bank_holiday` = 0
|
||||||
|
AND (`zz_events`.`is_recurring` = 1 AND
|
||||||
|
DAYOFYEAR(`zz_events`.`data`) BETWEEN DAYOFYEAR('.prepare($start).') AND IF(YEAR('.prepare($start).') = YEAR('.prepare($end).'), DAYOFYEAR('.prepare($end).'), DAYOFYEAR('.prepare(date('Y-m-d', strtotime($end. '-1 day'))).'))
|
||||||
|
)
|
||||||
|
OR
|
||||||
|
(`zz_events`.`is_recurring` = 0 AND `zz_events`.`data` >= '.prepare($start).' AND `zz_events`.`data` <= '.prepare($end).')';
|
||||||
|
|
||||||
$alldays = $dbo->fetchArray($query);
|
//echo $query;
|
||||||
|
|
||||||
foreach ($alldays as $evento) {
|
$eventi = $dbo->fetchArray($query);
|
||||||
|
|
||||||
|
foreach ($eventi as $evento) {
|
||||||
$results[] = [
|
$results[] = [
|
||||||
'id' => $modulo_eventi->id.'_'.$evento['id'],
|
'id' => $modulo_eventi->id.'_'.$evento['id'],
|
||||||
'title' => '<b>'.tr('Evento').':</b> '.$evento['nome'].'<br>
|
'title' => '<b>'.tr('Evento').':</b> '.$evento['nome'].'</b>',
|
||||||
<b>'.tr('Festività').':</b> '.($evento['is_bank_holiday'] ? '<i class="fa fa-check text-success"></i>' : '<i class="fa fa-times text-danger"></i>'),
|
'start' => ($evento['is_recurring'] ? date('Y-', strtotime($start)).date('m-d', strtotime($evento['data'])): $evento['data']),
|
||||||
'start' => $evento['data'],
|
//'end' => $evento['data'],
|
||||||
'end' => $evento['data'],
|
|
||||||
'extendedProps' => [
|
'extendedProps' => [
|
||||||
'link' => base_path().'/editor.php?id_module='.$modulo_eventi->id.'&id_record='.$evento['id'],
|
'link' => base_path().'/editor.php?id_module='.$modulo_eventi->id.'&id_record='.$evento['id'],
|
||||||
'idintervento' => $evento['id'],
|
'idintervento' => $evento['id'],
|
||||||
@ -206,6 +214,7 @@ switch (filter('op')) {
|
|||||||
'borderColor' => '#ffebcd',
|
'borderColor' => '#ffebcd',
|
||||||
'allDay' => true,
|
'allDay' => true,
|
||||||
'eventStartEditable' => false,
|
'eventStartEditable' => false,
|
||||||
|
'editable' => false,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user