1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-25 15:58:56 +01:00

Compare commits

...

5 Commits

Author SHA1 Message Date
Luca
58aa7675ce Semplificata apertura attività da calendario su nuova scheda 2024-05-07 15:25:45 +02:00
FabioL
7defba3e5a Apertura attività da calendario su nuova scheda 2024-05-07 15:15:15 +02:00
Pek5892
63a002cdf0 Fix minore 2024-05-07 14:35:53 +02:00
FabioL
1dc8343e0b Fix immagine header 2024-05-07 10:09:34 +02:00
FabioL
b969957394 Fix per retrocompatibilità PHP 7.4 2024-05-07 09:50:27 +02:00
8 changed files with 30 additions and 22 deletions

View File

@ -489,7 +489,7 @@ if ($structure->permission == 'rw') {
($include_file = $structure->filepath('actions.php')) ? include $include_file : null; ($include_file = $structure->filepath('actions.php')) ? include $include_file : null;
// Operazioni generiche per i campi personalizzati // Operazioni generiche per i campi personalizzati
if (post('op') != null) { if (!empty(post('op'))) {
$custom_where = !empty($id_plugin) ? '`id_plugin` = '.prepare($id_plugin) : '`id_module` = '.prepare($id_module); $custom_where = !empty($id_plugin) ? '`id_plugin` = '.prepare($id_plugin) : '`id_module` = '.prepare($id_module);
$query = 'SELECT `id`, `html_name` AS `title` FROM `zz_fields` WHERE '.$custom_where; $query = 'SELECT `id`, `html_name` AS `title` FROM `zz_fields` WHERE '.$custom_where;

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

@ -40,7 +40,7 @@ switch (filter('op')) {
} }
// Redirect alla categoria se si sta modificando una sottocategoria // Redirect alla categoria se si sta modificando una sottocategoria
if ($id_original != null) { if (!empty($id_original)) {
$database->commitTransaction(); $database->commitTransaction();
redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record)); redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record));
exit; exit;

View File

@ -45,7 +45,7 @@ switch (filter('op')) {
} }
// Redirect alla categoria se si sta modificando una sottocategoria // Redirect alla categoria se si sta modificando una sottocategoria
if ($id_original != null) { if (!empty($id_original)) {
$database->commitTransaction(); $database->commitTransaction();
redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record)); redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record));
exit; exit;

View File

@ -394,6 +394,7 @@ $modulo_interventi = Module::find((new Module())->getByField('title', 'Attività
echo ' echo '
<script type="text/javascript"> <script type="text/javascript">
var Draggable = FullCalendar.Draggable; var Draggable = FullCalendar.Draggable;
globals.dashboard = { globals.dashboard = {
load_url: "'.$structure->fileurl('ajax.php').'", load_url: "'.$structure->fileurl('ajax.php').'",
@ -727,8 +728,13 @@ if (isMobile() && setting('Utilizzare i tooltip sul calendario')) {
eventClick: function(info) { eventClick: function(info) {
if (info.event.extendedProps.link !== undefined) { if (info.event.extendedProps.link !== undefined) {
info.jsEvent.preventDefault(); info.jsEvent.preventDefault();
if (info.jsEvent.ctrlKey) {
window.open(info.event.extendedProps.link , "_blank");
} else {
location.href = info.event.extendedProps.link; location.href = info.event.extendedProps.link;
} }
}
},'; },';
} }

View File

@ -89,7 +89,7 @@ switch (post('op')) {
$tags_presenti[] = $tag['id_tag']; $tags_presenti[] = $tag['id_tag'];
} }
$tags = post('tags'); $tags = post('tags') ?: [];
$tags_presenti = []; $tags_presenti = [];
foreach ($tags as $tag) { foreach ($tags as $tag) {
@ -126,7 +126,7 @@ switch (post('op')) {
} }
} }
$tecnici_assegnati_array [] = post('tecnici_assegnati'); $tecnici_assegnati_array = post('tecnici_assegnati') ?: [];
$tecnici_assegnati = []; $tecnici_assegnati = [];
foreach ($tecnici_assegnati_array as $tecnico_assegnato) { foreach ($tecnici_assegnati_array as $tecnico_assegnato) {
@ -504,7 +504,7 @@ switch (post('op')) {
break; break;
case 'manage_articolo': case 'manage_articolo':
if (post('idriga') != null) { if (!empty(post('idriga'))) {
$articolo = Articolo::find(post('idriga')); $articolo = Articolo::find(post('idriga'));
} else { } else {
$originale = ArticoloOriginale::find(post('idarticolo')); $originale = ArticoloOriginale::find(post('idarticolo'));
@ -533,7 +533,7 @@ switch (post('op')) {
$articolo->save(); $articolo->save();
if (post('idriga') != null) { if (!empty(post('idriga'))) {
flash()->info(tr('Articolo modificato!')); flash()->info(tr('Articolo modificato!'));
} else { } else {
flash()->info(tr('Articolo aggiunto!')); flash()->info(tr('Articolo aggiunto!'));
@ -555,7 +555,7 @@ switch (post('op')) {
break; break;
case 'manage_sconto': case 'manage_sconto':
if (post('idriga') != null) { if (!empty(post('idriga'))) {
$sconto = Sconto::find(post('idriga')); $sconto = Sconto::find(post('idriga'));
} else { } else {
$sconto = Sconto::build($intervento); $sconto = Sconto::build($intervento);
@ -566,7 +566,7 @@ switch (post('op')) {
$sconto->note = post('note'); $sconto->note = post('note');
$sconto->save(); $sconto->save();
if (post('idriga') != null) { if (!empty(post('idriga'))) {
flash()->info(tr('Sconto/maggiorazione modificato!')); flash()->info(tr('Sconto/maggiorazione modificato!'));
} else { } else {
flash()->info(tr('Sconto/maggiorazione aggiunto!')); flash()->info(tr('Sconto/maggiorazione aggiunto!'));
@ -575,7 +575,7 @@ switch (post('op')) {
break; break;
case 'manage_riga': case 'manage_riga':
if (post('idriga') != null) { if (!empty(post('idriga'))) {
$riga = Riga::find(post('idriga')); $riga = Riga::find(post('idriga'));
} else { } else {
$riga = Riga::build($intervento); $riga = Riga::build($intervento);
@ -596,7 +596,7 @@ switch (post('op')) {
$riga->save(); $riga->save();
if (post('idriga') != null) { if (!empty(post('idriga'))){
flash()->info(tr('Riga modificata!')); flash()->info(tr('Riga modificata!'));
} else { } else {
flash()->info(tr('Riga aggiunta!')); flash()->info(tr('Riga aggiunta!'));
@ -1233,7 +1233,7 @@ switch (post('op')) {
$numero_totale = 0; $numero_totale = 0;
foreach ($righe as $riga) { foreach ($righe as $riga) {
if ($riga['id'] != null) { if (!empty($riga['id'])) {
$articolo = Articolo::find($riga['id']); $articolo = Articolo::find($riga['id']);
} }

View File

@ -92,13 +92,15 @@ $insoluti = Scadenza::where('idanagrafica', $intervento->idanagrafica)
->count(); ->count();
// Logo // Logo
$logo = Upload::where('id_module', (new Module())->getByField('title', 'Anagrafiche'))->where('id_record', $intervento->idanagrafica)->where('name', 'Logo azienda')->first()->filename ?: App::getPaths()['img'].'/logo_header.png'; $logo = Upload::where('id_module', (new Module())->getByField('title', 'Anagrafiche'))->where('id_record', $intervento->idanagrafica)->where('name', 'Logo azienda')->first()->filename;
$logo = $logo ? base_path().'/files/anagrafiche/'.$logo : App::getPaths()['img'].'/logo_header.png';
echo ' echo '
<hr> <hr>
<div class="row"> <div class="row">
<div class="col-md-1"> <div class="col-md-1">
<img src="'.base_path().'/files/anagrafiche/'.$logo.'" class="img-responsive"> <img src="'.$logo.'" class="img-responsive">
</div>'; </div>';
// Cliente // Cliente

View File

@ -69,12 +69,12 @@ if (!empty($id_record)) {
$module_query = Util\Query::getQuery($structure, $where, $order); $module_query = Util\Query::getQuery($structure, $where, $order);
// Precedente // Precedente
$prev_query = str_replace('2=2', '2=2 AND `posizione` ='.$posizione_attuale - 1, $module_query); $prev_query = str_replace('2=2', '2=2 AND `posizione` ='.prepare($posizione_attuale - 1), $module_query);
$database->FetchArray('SET @posizione = 0;'); $database->query('SET @posizione = 0');
$prev = $database->FetchOne($prev_query)['id']; $prev = $database->fetchOne($prev_query)['id'];
// Successivo // Successivo
$next_query = str_replace('2=2', '2=2 AND `posizione` ='.$posizione_attuale + 1, $module_query); $next_query = str_replace('2=2', '2=2 AND `posizione` ='.prepare($posizione_attuale + 1), $module_query);
$database->FetchArray('SET @posizione = 0;'); $database->query('SET @posizione = 0');
$next = $database->FetchOne($next_query)['id']; $next = $database->fetchOne($next_query)['id'];
} }