alsmanager_lib 3.0.43 → 3.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/modules.js +93 -6
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -1225,7 +1225,7 @@ function getVoIPDevices() {
|
|
|
1225
1225
|
// End manage Voip
|
|
1226
1226
|
// Software management
|
|
1227
1227
|
function getSoftwares(db_used, maker, model, platform, licence_type) {
|
|
1228
|
-
var query = "select id, maker, model, support, platform, release_year, version, build_no, licence_type, licence_key, expired_date, is_pnrr, inv_ict3_number, serial_no, architettura ";
|
|
1228
|
+
var query = "select id, maker, model, support, platform, release_year, version, build_no, licence_type, licence_key, expired_date, is_pnrr, inv_ict3_number, serial_no, architettura, life_licence ";
|
|
1229
1229
|
query += "from softwares ";
|
|
1230
1230
|
query += "where (is_removed is null or is_removed = 0) ";
|
|
1231
1231
|
if (maker) {
|
|
@@ -1243,21 +1243,21 @@ function getSoftwares(db_used, maker, model, platform, licence_type) {
|
|
|
1243
1243
|
return query;
|
|
1244
1244
|
}
|
|
1245
1245
|
function getSoftwareByCodice(db_used, codice) {
|
|
1246
|
-
var query = "select id, maker, model, support, platform, release_year, version, build_no, licence_type, licence_key, expired_date, is_pnrr, inv_ict3_number, serial_no, architettura ";
|
|
1246
|
+
var query = "select id, maker, model, support, platform, release_year, version, build_no, licence_type, licence_key, expired_date, is_pnrr, inv_ict3_number, serial_no, architettura, life_licence ";
|
|
1247
1247
|
query += "from softwares ";
|
|
1248
1248
|
query += "where (is_removed is null or is_removed = 0) ";
|
|
1249
1249
|
query += "and inv_ict3_number = '" + codice + "' or serial_no = '" + codice + "'";
|
|
1250
1250
|
return query;
|
|
1251
1251
|
}
|
|
1252
1252
|
function getSoftwareById(db_used, id_sw) {
|
|
1253
|
-
var query = "select id, maker, model, support, platform, release_year, version, build_no, licence_type, licence_key, expired_date, is_pnrr, inv_ict3_number, serial_no, architettura ";
|
|
1253
|
+
var query = "select id, maker, model, support, platform, release_year, version, build_no, licence_type, licence_key, expired_date, is_pnrr, inv_ict3_number, serial_no, architettura, life_licence ";
|
|
1254
1254
|
query += "from softwares ";
|
|
1255
1255
|
query += "where (is_removed is null or is_removed = 0) ";
|
|
1256
1256
|
query += "and id = " + id_sw;
|
|
1257
1257
|
return query;
|
|
1258
1258
|
}
|
|
1259
1259
|
function getSoftwareForConsegnaById(db_used, id_sw) {
|
|
1260
|
-
var query = "select id, maker, model, support, platform, release_year, version, build_no, licence_type, licence_key, expired_date, is_pnrr, inv_ict3_number, serial_no, architettura, ";
|
|
1260
|
+
var query = "select id, maker, model, support, platform, release_year, version, build_no, licence_type, licence_key, expired_date, is_pnrr, inv_ict3_number, serial_no, architettura, life_licence, ";
|
|
1261
1261
|
query += "case ";
|
|
1262
1262
|
query += "when s.no_inventario is not null and s.no_inventario > 0 then concat(s.id,'(ID)') ";
|
|
1263
1263
|
query += "when s.inv_ict3_number != '' and s.inv_ict3_number is not null then s.inv_ict3_number ";
|
|
@@ -1283,7 +1283,8 @@ function insertSoftware(db_used, software) {
|
|
|
1283
1283
|
query += software.is_pnrr + ", ";
|
|
1284
1284
|
query += "'" + software.inventario + "', ";
|
|
1285
1285
|
query += "'" + software.serial_no + "', ";
|
|
1286
|
-
query += "'" + software.architettura + "' ";
|
|
1286
|
+
query += "'" + software.architettura + "', ";
|
|
1287
|
+
query += software.life_licence + " ";
|
|
1287
1288
|
query += ")";
|
|
1288
1289
|
return query;
|
|
1289
1290
|
}
|
|
@@ -1303,7 +1304,8 @@ function updateSoftware(db_used, id_sw, software) {
|
|
|
1303
1304
|
query += "is_pnrr = " + software.is_pnrr + ", ";
|
|
1304
1305
|
query += "inv_ict3_number = '" + software.inventario + "', ";
|
|
1305
1306
|
query += "serial_no = '" + software.serial_no + "', ";
|
|
1306
|
-
query += "architettura = '" + software.architettura + "' ";
|
|
1307
|
+
query += "architettura = '" + software.architettura + "', ";
|
|
1308
|
+
query += "life_licence = " + software.life_licence + " ";
|
|
1307
1309
|
query += "where id = " + id_sw;
|
|
1308
1310
|
return query;
|
|
1309
1311
|
}
|
|
@@ -1388,6 +1390,31 @@ function removeUtentePerDevice(id_dev_user) {
|
|
|
1388
1390
|
}
|
|
1389
1391
|
|
|
1390
1392
|
// End Anagrafica utenti
|
|
1393
|
+
//Anagrafica docenti
|
|
1394
|
+
function getDocentiCombo(db_used, id_place, ordine_scuola, ruolo) {
|
|
1395
|
+
var query = "select id, concat(cognome, ' ', nome, ' - ', ordine, ' - ', ruolo) as nominativo from anagrafica_docenti ";
|
|
1396
|
+
query += "where is_attivo = 1 "
|
|
1397
|
+
if (ordine_scuola && ordine_scuola.trim() != '') {
|
|
1398
|
+
query += "and (ordine = '" + ordine + "' or ruolo <> 'DOCENTE') ";
|
|
1399
|
+
}
|
|
1400
|
+
if (id_place && id_place.trim() != '') {
|
|
1401
|
+
query += "and id_place = '" + id_place + "' ";
|
|
1402
|
+
}
|
|
1403
|
+
if (ruolo && ruolo.trim() != '') {
|
|
1404
|
+
query += "and ruolo = '" + ruolo + "' ";
|
|
1405
|
+
}
|
|
1406
|
+
query += "order by cognome, nome";
|
|
1407
|
+
return query;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
function getDocenteById(db_used, id_docente) {
|
|
1411
|
+
var query = "select id, cognome, nome, email, id_place, ordine, ruolo, is_attivo from anagrafica_docenti ";
|
|
1412
|
+
query += "where id = " + id_docente;
|
|
1413
|
+
return query;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
|
|
1417
|
+
// End Anagrafica docenti
|
|
1391
1418
|
// Device configurations
|
|
1392
1419
|
function getDeviceConfigurationsSQLite(id_device) {
|
|
1393
1420
|
var query = "select id, date_conf, note from device_changes ";
|
|
@@ -6854,6 +6881,27 @@ function queryConsegnaById(db_used,id_consegna) {
|
|
|
6854
6881
|
return query;
|
|
6855
6882
|
}
|
|
6856
6883
|
|
|
6884
|
+
//Creazione email sollecito consegna
|
|
6885
|
+
function createConsegnaMessage(consegna, listBeni, data_limite) {
|
|
6886
|
+
var msgObj = {};
|
|
6887
|
+
if (consegna) {
|
|
6888
|
+
msgObj.email_to = consegna.email_adulto;
|
|
6889
|
+
msgObj.subject = "Rif. consegna: " + consegna.id + " del " + consegna.data_consegna;
|
|
6890
|
+
msgObj.message = "Gentile/Egregio " + consegna.richiedente_adulto + "\n";
|
|
6891
|
+
msgObj.message += "\n\nSi ricorda di effettuare entro la data " + data_limite + " la consegna dei seguenti beni : \n\n";
|
|
6892
|
+
listBeni.forEach(element => {
|
|
6893
|
+
msgObj.message += "n. " + element.numero + " - " + element.tipo + " - " + element.marca + " - " + element.modello + " - Cod. " + element.codice + "\n";
|
|
6894
|
+
});
|
|
6895
|
+
msgObj.message += "\n\nSi richiede che la consegna venga effettuata ad un tecnico dell'Istituto per le verifiche del caso.\n";
|
|
6896
|
+
msgObj.message += "Se per eventuali esigenze fosse necessario prolungare l'utilizzo del bene, si prega di contattare l'Ufficio Tecnico.\n ";
|
|
6897
|
+
msgObj.message += "Cordiali saluti \n\n I tecnici dell'I.C. Trento 3";
|
|
6898
|
+
}
|
|
6899
|
+
return msgObj;
|
|
6900
|
+
}
|
|
6901
|
+
|
|
6902
|
+
|
|
6903
|
+
//End Creazione email sollecito consegna
|
|
6904
|
+
|
|
6857
6905
|
|
|
6858
6906
|
// Beni in consegna
|
|
6859
6907
|
function queryConsegneByIdDeviceSQLite(id_device) {
|
|
@@ -10488,6 +10536,38 @@ function queryPlaces() {
|
|
|
10488
10536
|
return query;
|
|
10489
10537
|
}
|
|
10490
10538
|
|
|
10539
|
+
function queryPlaceByIdSQLite(id_place) {
|
|
10540
|
+
var query = "SELECT mark, name, address, city, phone_number, type, coor_long, coor_lat, plus_code, dist_by_feet_m, dist_by_car_m, is_main from places ";
|
|
10541
|
+
query += " where id_place = '" + id_place + "'";
|
|
10542
|
+
return query;
|
|
10543
|
+
}
|
|
10544
|
+
|
|
10545
|
+
function queryPlaceByIdMySQL(id_place) {
|
|
10546
|
+
var query = "SELECT mark, name, address, city, phone_number, type, coor_long, coor_lat, plus_code, dist_by_feet_m, dist_by_car_m, is_main from places ";
|
|
10547
|
+
query += "where id_place = :id_place";
|
|
10548
|
+
return query;
|
|
10549
|
+
}
|
|
10550
|
+
|
|
10551
|
+
function queryPlaceById(db_used, id_place) {
|
|
10552
|
+
var query = "";
|
|
10553
|
+
if (db_used) {
|
|
10554
|
+
switch (db_used) {
|
|
10555
|
+
case 'SQLITE':
|
|
10556
|
+
query = queryPlaceByIdSQLite(id_place);
|
|
10557
|
+
break;
|
|
10558
|
+
case 'MYSQL':
|
|
10559
|
+
query = queryPlaceByIdMySQL(id_place);
|
|
10560
|
+
break;
|
|
10561
|
+
case 'MYSQL2':
|
|
10562
|
+
query = queryPlaceByIdSQLite(id_place);
|
|
10563
|
+
break;
|
|
10564
|
+
}
|
|
10565
|
+
}
|
|
10566
|
+
return query;
|
|
10567
|
+
}
|
|
10568
|
+
|
|
10569
|
+
|
|
10570
|
+
|
|
10491
10571
|
function queryFloorsByPlaceSQLite(id_place) {
|
|
10492
10572
|
var query = "SELECT DISTINCT floor from sites";
|
|
10493
10573
|
query += " where id_place = '" + id_place + "'";
|
|
@@ -12424,6 +12504,8 @@ function createIstruzioniStandard(user, pwd, email, id_consegna, data_cons) {
|
|
|
12424
12504
|
return dd;
|
|
12425
12505
|
}
|
|
12426
12506
|
|
|
12507
|
+
|
|
12508
|
+
|
|
12427
12509
|
// Export DB
|
|
12428
12510
|
|
|
12429
12511
|
function exportDBSQLSQLite(db_path, dump_path, dump_filename) {
|
|
@@ -14073,6 +14155,9 @@ module.exports = {
|
|
|
14073
14155
|
updateUtentePerDevice,
|
|
14074
14156
|
removeUtentePerDevice,
|
|
14075
14157
|
//
|
|
14158
|
+
getDocentiCombo,
|
|
14159
|
+
getDocenteById,
|
|
14160
|
+
//
|
|
14076
14161
|
getDeviceConfigurations,
|
|
14077
14162
|
getLastDeviceConfiguration,
|
|
14078
14163
|
getDeviceConfigurationById,
|
|
@@ -14167,6 +14252,7 @@ module.exports = {
|
|
|
14167
14252
|
getLastGestioneDeviceByIdDevice,
|
|
14168
14253
|
queryConsegne,
|
|
14169
14254
|
queryConsegnaById,
|
|
14255
|
+
createConsegnaMessage,
|
|
14170
14256
|
createConsegnaMySQLObj,
|
|
14171
14257
|
insertConsegna,
|
|
14172
14258
|
updateConsegna,
|
|
@@ -14225,6 +14311,7 @@ module.exports = {
|
|
|
14225
14311
|
updateDeviceSiteAfterRemove,
|
|
14226
14312
|
removeDeviceFromAllSites,
|
|
14227
14313
|
queryPlaces,
|
|
14314
|
+
queryPlaceById,
|
|
14228
14315
|
queryFloorsByPlace,
|
|
14229
14316
|
queryFunzioneByPlaceAndFloor,
|
|
14230
14317
|
querySites,
|