Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Beppe committed Aug 6, 2021
2 parents 091a5e5 + 37822a2 commit f64e3a7
Show file tree
Hide file tree
Showing 42 changed files with 605 additions and 730 deletions.
Binary file modified assets/src/img/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/src/img/logo_completo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/src/js/functions/allegati.js
Expand Up @@ -211,7 +211,7 @@ function modificaAllegato(button) {
* Funzione per gestire il download di un allegato.
* @param button
*/
function aggiungiAllegato(button) {
function scaricaAllegato(button) {
const gestione = $(button).closest(".gestione-allegati");
const allegato = $(button).closest("tr").data();

Expand Down
2 changes: 1 addition & 1 deletion assets/src/js/functions/datatables.js
Expand Up @@ -116,7 +116,7 @@ function start_datatables() {
} else {
$('#mini-loader').hide();
}
})
});
}
});
}
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -110,7 +110,8 @@
"Plugins\\PianificazioneFatturazione\\": ["plugins/pianificazione_fatturazione/custom/src/", "plugins/pianificazione_fatturazione/src/"],
"Plugins\\StatisticheArticoli\\": ["plugins/statistiche_articoli/custom/src/", "plugins/statistiche_articoli/src/"],
"Plugins\\ListinoClienti\\": ["plugins/listino_clienti/custom/src/", "plugins/listino_clienti/src/"],
"Plugins\\ListinoFornitori\\": ["plugins/listino_fornitori/custom/src/", "plugins/listino_fornitori/src/"]
"Plugins\\ListinoFornitori\\": ["plugins/listino_fornitori/custom/src/", "plugins/listino_fornitori/src/"],
"Plugins\\ComponentiImpianti\\": ["plugins/componenti/custom/src/", "plugins/componenti/src/"]
},
"files": [
"lib/functions.php",
Expand Down
2 changes: 1 addition & 1 deletion include/common/articolo.php
Expand Up @@ -74,7 +74,7 @@
echo '
<div class="row">
<div class="col-md-12">
{[ "type": "select", "label": "'.tr('Impianto su cui installare').'", "name": "idimpianto", "value": "'.$idimpianto.'", "ajax-source": "impianti-intervento", "select-options": '.json_encode($options['select-options']['impianti']).' ]}
{[ "type": "select", "label": "'.tr('Impianto su cui installare').'", "name": "id_impianto", "value": "", "ajax-source": "impianti-intervento", "select-options": '.json_encode($options['select-options']['impianti']).', "help": "'.tr("La selezione di un Impianto in questo campo provocherà l'installazione di un nuovo Componente basato sull'Articolo corrente").'" ]}
</div>
</div>';
}
Expand Down
4 changes: 2 additions & 2 deletions include/init/configuration.php
Expand Up @@ -195,7 +195,7 @@
"generated" : "true",
"icons" : [
{
"src": "assets/dist/img/logo.png",
"src": "assets/dist/img/logo_completo.png",
"type": "image/png",
"sizes": "489x91"
}
Expand Down Expand Up @@ -329,7 +329,7 @@
echo '
<div class="box box-center-large box-warning">
<div class="box-header with-border text-center">
<img src="'.$img.'/logo.png" width="300" alt="'.tr('OSM Logo').'">
<img src="'.$img.'/logo_completo.png" width="300" alt="'.tr('OSM Logo').'">
</div>
<div class="box-body" id="smartwizard">
Expand Down
2 changes: 1 addition & 1 deletion include/init/init.php
Expand Up @@ -124,7 +124,7 @@
echo '
<div class="box box-center-large box-warning">
<div class="box-header with-border text-center">
<img src="'.$img.'/logo.png" class="logo-image" alt="'.tr('OSM Logo').'">
<img src="'.$img.'/logo_completo.png" class="logo-image" alt="'.tr('OSM Logo').'">
</div>
<div class="box-body">
Expand Down
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -145,7 +145,7 @@ function brute() {
echo '
<form action="?op=login" method="post" class="login-box box" autocomplete="off" >
<div class="box-header with-border text-center">
<img src="'.App::getPaths()['img'].'/logo.png" class="img-responsive" alt="'.tr('OSM Logo').'">
<img src="'.App::getPaths()['img'].'/logo_completo.png" class="img-responsive" alt="'.tr('OSM Logo').'">
</div>
<div class="login-box-body box-body">
Expand Down
2 changes: 1 addition & 1 deletion info.php
Expand Up @@ -28,7 +28,7 @@
echo '
<div class="box">
<div class="box-header">
<img src="'.$paths['img'].'/logo.png" class="pull-left img-responsive" width="300" alt="'.tr('OSM Logo').'">
<img src="'.$paths['img'].'/logo_completo.png" class="pull-left img-responsive" width="300" alt="'.tr('OSM Logo').'">
<div class="pull-right">
<i class="fa fa-info"></i> '.tr('Informazioni').'
</div>
Expand Down
58 changes: 30 additions & 28 deletions modules/dashboard/edit.php
Expand Up @@ -358,6 +358,9 @@
url: globals.rootdir + "/add.php?id_module='.$modulo_interventi->id.'",
},
error: "'.tr('Errore durante la creazione degli eventi').'",
genericError: "'.tr('Errore').'",
genericWarning: "'.tr('Attenzione').'",
informazioni_aggiuntive: '.intval(setting('Visualizza informazioni aggiuntive sul calendario')).',
};
function aggiorna_contatore(counter_id) {
Expand Down Expand Up @@ -408,7 +411,7 @@ function carica_interventi_da_pianificare(mese) {
$("#elenco-promemoria").html(data);
$("#external-events .fc-event").each(function () {
$(this).draggable({
$(this).draggable({
zIndex: 999,
revert: true,
revertDuration: 0,
Expand Down Expand Up @@ -507,7 +510,7 @@ function create_calendar() {
header: {
left: "prev,next today",
center: "title",
right: "month,agendaWeek,agendaDay"
right: "month,agendaWeek,agendaDay"
},
timeFormat: globals.dashboard.timeFormat,
slotLabelFormat: globals.dashboard.timeFormat,
Expand All @@ -518,7 +521,7 @@ function create_calendar() {
lazyFetching: true,
selectMirror: true,
eventLimit: false, // allow "more" link when too many events
allDaySlot: '.intval(setting('Visualizza informazioni aggiuntive sul calendario')).',
allDaySlot: globals.dashboard.informazioni_aggiuntive,
loading: function (isLoading, view) {
if (isLoading) {
Expand Down Expand Up @@ -556,13 +559,12 @@ function create_calendar() {
},
selectable: globals.dashboard.write_permission,
select: function(start, end, allDay) { // info
select: function (start, end, allDay) { // info
// let start = info.start;
// let end = info.end;
let is_allDay = !start.hasTime() && !end.hasTime();
if (is_allDay!==true){
let intero_giorno = !start.hasTime() && !end.hasTime();
if (intero_giorno !== true) {
let data = moment(start).format("YYYY-MM-DD");
let data_fine = moment(end).format("YYYY-MM-DD");
let orario_inizio = moment(start).format("HH:mm");
Expand All @@ -578,35 +580,35 @@ function create_calendar() {
},
editable: globals.dashboard.write_permission,
eventDrop: function(event, delta, revertFunc ) {// info
eventDrop: function (event, delta, revertFunc) {// info
// let event = info.event;
if (event.allDay!==true){
if (event.allDay !== true) {
$.post(globals.dashboard.load_url, {
op: "modifica_intervento",
id: event.id,
idintervento: event.idintervento,
timeStart: moment(event.start).format("YYYY-MM-DD HH:mm"),
timeEnd: moment(event.end).format("YYYY-MM-DD HH:mm")
}, function (data, response) {
}, function (data, responseType) {
data = $.trim(data);
if (response == "success" && data !== "ok") {
swal("'.tr('Attenzione').'", data, "warning");
}else if (response !== "success"){
swal("'.tr('Errore').'", data, "error");
if (responseType === "success" && data !== "ok") {
swal(globals.dashboard.genericWarning, data, "warning");
} else if (responseType !== "success") {
swal(globals.dashboard.genericError, data, "error");
}
if (data !=="ok"){
if (data !== "ok") {
revertFunc(); // info.revert();
}
});
}else{
} else {
revertFunc();
}
},
eventResize: function(event, delta, revertFunc) { // info
eventResize: function (event, delta, revertFunc) { // info
// let event = info.event;
$.post(globals.dashboard.load_url, {
Expand All @@ -615,32 +617,32 @@ function create_calendar() {
idintervento: event.idintervento,
timeStart: moment(event.start).format("YYYY-MM-DD HH:mm"),
timeEnd: moment(event.end).format("YYYY-MM-DD HH:mm")
}, function (data, response) {
}, function (data, responseType) {
data = $.trim(data);
if (response == "success" && data !== "ok") {
swal("'.tr('Attenzione').'", data, "warning");
}else if (response !== "success"){
swal("'.tr('Errore').'", data, "error");
if (responseType === "success" && data !== "ok") {
swal(globals.dashboard.genericWarning, data, "warning");
} else if (responseType !== "success") {
swal(globals.dashboard.genericError, data, "error");
}
if (data !=="ok"){
if (data !== "ok") {
revertFunc(); // info.revert();
}
});
},
// eventPositioned: function (info) {
eventAfterRender: function(event, element) {
eventAfterRender: function (event, element) {
// let event = info.event;
// let element = $(info.el);
element.find(".fc-title").html(event.title);
let id_record = event.idintervento;
if (globals.dashboard.tooltip == 1) {
element.tooltipster({
content: "'.tr('Caricamento...').'",
content: globals.translations.loading + "...",
animation: "grow",
updateAnimation: "grow",
contentAsHTML: true,
Expand All @@ -652,11 +654,11 @@ function create_calendar() {
touchDevices: true,
trigger: "hover",
position: "left",
functionBefore: function(instance, helper) {
functionBefore: function (instance, helper) {
let $origin = $(helper.origin);
if ($origin.data("loaded") !== true) {
$.post(globals.dashboard.load_url, {
$.post(globals.dashboard.load_url, {
op: "tooltip_info",
id_record: id_record,
allDay: event.allDay,
Expand All @@ -674,7 +676,7 @@ functionBefore: function(instance, helper) {
url: globals.dashboard.load_url + "&op=interventi_periodo",
type: "GET",
error: function () {
swal("'.tr('Errore').'", globals.dashboard.error, "error");
swal(globals.dashboard.genericError, globals.dashboard.error, "error");
}
}
});
Expand Down
6 changes: 2 additions & 4 deletions modules/emails/src/EmailHook.php
Expand Up @@ -67,7 +67,7 @@ public function execute()

// Selezione email per account
$accounts = Account::all();
$lista = [];
$lista = collect();
foreach ($accounts as $account) {
// Ultima email inviata per l'account
$last_mail = $account->emails()
Expand All @@ -90,9 +90,7 @@ public function execute()
->take($numero_email)
->get();

if (!empty($lista_account)) {
$lista = array_merge($lista, $lista_account);
}
$lista = $lista->concat($lista_account);
}
}

Expand Down
5 changes: 4 additions & 1 deletion modules/emails/src/OAuth2.php
Expand Up @@ -170,7 +170,10 @@ public function getAccessToken()
public function updateTokens($access_token, $refresh_token)
{
$this->account->access_token = serialize($access_token);
$this->account->refresh_token = $refresh_token;

$previous_refresh_token = $this->account->refresh_token;
$this->account->refresh_token = $refresh_token ?: $previous_refresh_token;

$this->account->save();
}

Expand Down
2 changes: 1 addition & 1 deletion modules/fatture/edit.php
Expand Up @@ -673,7 +673,7 @@
$ddt = $dbo->fetchArray($ddt_query)[0]['tot'];
echo '
<div class="tip">
<a class="btn btn-sm btn-primary'.(!empty($ddt) ? '' : ' disabled').'" data-href="'.$structure->fileurl('add_ddt.php').'.php?id_module='.$id_module.'&id_record='.$id_record.'" data-toggle="tooltip" data-title="'.tr('Aggiungi ddt').'">
<a class="btn btn-sm btn-primary'.(!empty($ddt) ? '' : ' disabled').'" data-href="'.$structure->fileurl('add_ddt.php').'?id_module='.$id_module.'&id_record='.$id_record.'" data-toggle="tooltip" data-title="'.tr('Aggiungi ddt').'">
<i class="fa fa-plus"></i> '.tr('Ddt').'
</a>
</div>';
Expand Down
62 changes: 0 additions & 62 deletions modules/gestione_componenti/ajax/select.php

This file was deleted.

32 changes: 32 additions & 0 deletions modules/impianti/ajax/select.php
Expand Up @@ -77,4 +77,36 @@
}
}
break;

/*
* Opzioni utilizzate:
* - matricola
*/
case 'componenti':
if (isset($superselect['matricola'])) {
$query = 'SELECT my_componenti.id, CONCAT("#", my_componenti.id, ": ", mg_articoli.codice, " - ", mg_articoli.descrizione) AS descrizione
FROM my_componenti
INNER JOIN mg_articoli ON mg_articoli.id = my_componenti.id_articolo
|where| ORDER BY my_componenti.id';

foreach ($elements as $element) {
$filter[] = 'my_componenti.id = '.prepare($element);
}

$where = [
'my_componenti.data_sostituzione IS NULL',
'my_componenti.data_rimozione IS NULL',
];

$impianti = $superselect['matricola'];
if (!empty($impianti)) {
$where[] = 'my_componenti.id_impianto IN ('.$impianti.')';
}

if (!empty($search)) {
$search[] = 'my_componenti.note LIKE '.prepare('%'.$search.'%');
}
}

break;
}

0 comments on commit f64e3a7

Please sign in to comment.