alsmanager_lib 3.0.89 → 3.0.91

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.
@@ -143,14 +143,6 @@ CREATE TABLE IF NOT EXISTS "site_destinations" (
143
143
  "name" TEXT,
144
144
  "type" TEXT
145
145
  );
146
- DROP TABLE IF EXISTS "device_site";
147
- CREATE TABLE IF NOT EXISTS "device_site" (
148
- "date_in" TEXT,
149
- "date_out" TEXT,
150
- "id_device" INTEGER,
151
- "id_place" INTEGER,
152
- "id_site" INTEGER
153
- );
154
146
  DROP TABLE IF EXISTS "update_log";
155
147
  CREATE TABLE IF NOT EXISTS "update_log" (
156
148
  "id" INTEGER,
@@ -190,23 +182,6 @@ CREATE TABLE IF NOT EXISTS "ImportNewLab" (
190
182
  "Data_controllo" TEXT,
191
183
  "Note" TEXT
192
184
  );
193
- DROP TABLE IF EXISTS "consegne";
194
- CREATE TABLE IF NOT EXISTS "consegne" (
195
- "id" INTEGER,
196
- "data_richiesta" TEXT,
197
- "data_consegna" TEXT,
198
- "data_rientro" TEXT,
199
- "richiedente_adulto" TEXT,
200
- "richiedente_alunno" TEXT,
201
- "richiedente_genitore" TEXT,
202
- "id_place" TEXT,
203
- "id_site" INTEGER,
204
- "is_home" INTEGER,
205
- "note" TEXT,
206
- "removed" INTEGER,
207
- "stato_restituzione" INTEGER,
208
- PRIMARY KEY("id" AUTOINCREMENT)
209
- );
210
185
  DROP TABLE IF EXISTS "ImportRevisione2024";
211
186
  CREATE TABLE IF NOT EXISTS "ImportRevisione2024" (
212
187
  "inv_ict3" TEXT,
@@ -327,14 +302,6 @@ CREATE TABLE IF NOT EXISTS "ImportInventarioPlessiSA" (
327
302
  "Note_3" TEXT,
328
303
  "field17" TEXT
329
304
  );
330
- DROP TABLE IF EXISTS "device_interventi";
331
- CREATE TABLE IF NOT EXISTS "device_interventi" (
332
- "id" INTEGER,
333
- "id_intervento" INTEGER,
334
- "id_device" INTEGER,
335
- "note" TEXT,
336
- PRIMARY KEY("id" AUTOINCREMENT)
337
- );
338
305
  DROP TABLE IF EXISTS "gestori_fornitori";
339
306
  CREATE TABLE IF NOT EXISTS "gestori_fornitori" (
340
307
  "id" INTEGER,
@@ -427,13 +394,6 @@ CREATE TABLE IF NOT EXISTS "users_granted" (
427
394
  "id_profile" INTEGER,
428
395
  PRIMARY KEY("id" AUTOINCREMENT)
429
396
  );
430
- DROP TABLE IF EXISTS "device_properties";
431
- CREATE TABLE IF NOT EXISTS "device_properties" (
432
- "id" INTEGER,
433
- "id_device" INTEGER,
434
- "raw_properties" BLOB,
435
- PRIMARY KEY("id" AUTOINCREMENT)
436
- );
437
397
  DROP TABLE IF EXISTS "TEMP_DEVICES";
438
398
  CREATE TABLE IF NOT EXISTS "TEMP_DEVICES" (
439
399
  "id" INT,
@@ -473,18 +433,6 @@ CREATE TABLE IF NOT EXISTS "postazione_lab" (
473
433
  "bancata" INTEGER,
474
434
  "is_docente" INTEGER
475
435
  );
476
- DROP TABLE IF EXISTS "site_ports";
477
- CREATE TABLE IF NOT EXISTS "site_ports" (
478
- "id" INTEGER,
479
- "id_site" INTEGER,
480
- "id_place" INTEGER,
481
- "port_sign" TEXT,
482
- "port_type" TEXT,
483
- "port_switch" TEXT,
484
- "local_switch_exists" INTEGER,
485
- "note" TEXT,
486
- PRIMARY KEY("id" AUTOINCREMENT)
487
- );
488
436
  DROP TABLE IF EXISTS "device_connectors";
489
437
  CREATE TABLE IF NOT EXISTS "device_connectors" (
490
438
  "id" INTEGER,
@@ -520,14 +468,6 @@ CREATE TABLE IF NOT EXISTS "device_networks" (
520
468
  "ipv6_static" TEXT,
521
469
  PRIMARY KEY("id" AUTOINCREMENT)
522
470
  );
523
- DROP TABLE IF EXISTS "device_lan_ports";
524
- CREATE TABLE IF NOT EXISTS "device_lan_ports" (
525
- "id" INTEGER,
526
- "id_device" INTEGER,
527
- "id_card" INTEGER,
528
- "id_port" INTEGER,
529
- PRIMARY KEY("id" AUTOINCREMENT)
530
- );
531
471
  DROP TABLE IF EXISTS "tpl_model_connectors";
532
472
  CREATE TABLE IF NOT EXISTS "tpl_model_connectors" (
533
473
  "id" INTEGER,
@@ -549,17 +489,6 @@ CREATE TABLE IF NOT EXISTS "tpl_model_networks" (
549
489
  "dm_net_type" TEXT,
550
490
  PRIMARY KEY("id" AUTOINCREMENT)
551
491
  );
552
- DROP TABLE IF EXISTS "tpl_model_storages";
553
- CREATE TABLE IF NOT EXISTS "tpl_model_storages" (
554
- "id" INTEGER,
555
- "device_type" TEXT,
556
- "device_manifacturer" TEXT,
557
- "device_model" TEXT,
558
- "dm_storage_type" INTEGER,
559
- "dm_storage_totsize" REAL,
560
- "dm_storage_size_unit" TEXT,
561
- PRIMARY KEY("id" AUTOINCREMENT)
562
- );
563
492
  DROP TABLE IF EXISTS "categorie_device";
564
493
  CREATE TABLE IF NOT EXISTS "categorie_device" (
565
494
  "tipo" TEXT,
@@ -627,24 +556,6 @@ CREATE TABLE IF NOT EXISTS "device_acquisto" (
627
556
  "id_sap" TEXT,
628
557
  PRIMARY KEY("id" AUTOINCREMENT)
629
558
  );
630
- DROP TABLE IF EXISTS "devices";
631
- CREATE TABLE IF NOT EXISTS "devices" (
632
- "id" INTEGER,
633
- "inv_ict3_number" TEXT,
634
- "inv_tn_number" TEXT,
635
- "inv_pnrr_number" TEXT,
636
- "inv_tndigit_number" TEXT,
637
- "type" TEXT,
638
- "manifacturer" TEXT,
639
- "model" TEXT,
640
- "serial_no" TEXT,
641
- "note" TEXT,
642
- "is_removed" INTEGER,
643
- "id_type" INTEGER,
644
- "sap_cespite_classe" TEXT,
645
- "sap_cespite_num" TEXT,
646
- PRIMARY KEY("id" AUTOINCREMENT)
647
- );
648
559
  DROP TABLE IF EXISTS "ImportInv20250103";
649
560
  CREATE TABLE IF NOT EXISTS "ImportInv20250103" (
650
561
  "rif_fattura" TEXT,
@@ -696,24 +607,6 @@ CREATE TABLE IF NOT EXISTS "device_as_site" (
696
607
  "id_site" INTEGER,
697
608
  "id_place" TEXT
698
609
  );
699
- DROP TABLE IF EXISTS "ambito_arredamento";
700
- CREATE TABLE IF NOT EXISTS "ambito_arredamento" (
701
- "id" INTEGER,
702
- "marca" TEXT,
703
- "modello" TEXT,
704
- "tipo" TEXT,
705
- PRIMARY KEY("id")
706
- );
707
- DROP TABLE IF EXISTS "ambito_giardino";
708
- CREATE TABLE IF NOT EXISTS "ambito_giardino" (
709
- "id" INTEGER,
710
- PRIMARY KEY("id" AUTOINCREMENT)
711
- );
712
- DROP TABLE IF EXISTS "ambito_laboratori";
713
- CREATE TABLE IF NOT EXISTS "ambito_laboratori" (
714
- "id" INTEGER,
715
- PRIMARY KEY("id" AUTOINCREMENT)
716
- );
717
610
  DROP TABLE IF EXISTS "interventi";
718
611
  CREATE TABLE IF NOT EXISTS "interventi" (
719
612
  "id" INTEGER,
@@ -847,15 +740,6 @@ CREATE TABLE IF NOT EXISTS "places" (
847
740
  "is_main" INTEGER,
848
741
  PRIMARY KEY("mark")
849
742
  );
850
- DROP TABLE IF EXISTS "display_part";
851
- CREATE TABLE IF NOT EXISTS "display_part" (
852
- "id_device" INTEGER,
853
- "size_inch" REAL,
854
- "format" TEXT,
855
- "technology" TEXT,
856
- "touch" INTEGER,
857
- "is_removable" INTEGER
858
- );
859
743
  DROP TABLE IF EXISTS "device_ap";
860
744
  CREATE TABLE IF NOT EXISTS "device_ap" (
861
745
  "id_device" INTEGER,
@@ -878,18 +762,6 @@ CREATE TABLE IF NOT EXISTS "map_points" (
878
762
  "id_site" INTEGER,
879
763
  PRIMARY KEY("id" AUTOINCREMENT)
880
764
  );
881
- DROP TABLE IF EXISTS "documenti";
882
- CREATE TABLE IF NOT EXISTS "documenti" (
883
- "id" INTEGER,
884
- "tipo" TEXT,
885
- "data_emissione" TEXT,
886
- "descrizione" TEXT,
887
- "riferimento" TEXT,
888
- "nome_originale" TEXT,
889
- "nome_uuid" TEXT,
890
- "is_removed" INTEGER,
891
- PRIMARY KEY("id" AUTOINCREMENT)
892
- );
893
765
  DROP TABLE IF EXISTS "dismissione_gestori";
894
766
  CREATE TABLE IF NOT EXISTS "dismissione_gestori" (
895
767
  "id_dismissione" INTEGER,
@@ -1006,14 +878,6 @@ CREATE TABLE IF NOT EXISTS "log_exports" (
1006
878
  "hostname" INTEGER,
1007
879
  PRIMARY KEY("id" AUTOINCREMENT)
1008
880
  );
1009
- DROP TABLE IF EXISTS "anagrafica_docenti";
1010
- CREATE TABLE IF NOT EXISTS "anagrafica_docenti" (
1011
- "id" INTEGER,
1012
- "cognome" TEXT,
1013
- "nome" TEXT,
1014
- "email" TEXT,
1015
- PRIMARY KEY("id" AUTOINCREMENT)
1016
- );
1017
881
  DROP TABLE IF EXISTS "prn_stampe";
1018
882
  CREATE TABLE IF NOT EXISTS "prn_stampe" (
1019
883
  "id" INTEGER,
@@ -1051,16 +915,6 @@ CREATE TABLE IF NOT EXISTS "device_memory" (
1051
915
  "mem_size_unit" TEXT,
1052
916
  PRIMARY KEY("id")
1053
917
  );
1054
- DROP TABLE IF EXISTS "disk_usage";
1055
- CREATE TABLE IF NOT EXISTS "disk_usage" (
1056
- "id" INTEGER,
1057
- "date_ref" TEXT,
1058
- "id_device" INTEGER,
1059
- "id_storage" INTEGER,
1060
- "size_unit" TEXT,
1061
- "available_space" REAL,
1062
- PRIMARY KEY("id" AUTOINCREMENT)
1063
- );
1064
918
  DROP TABLE IF EXISTS "change_config";
1065
919
  CREATE TABLE IF NOT EXISTS "change_config" (
1066
920
  "id" INTEGER,
@@ -1124,4 +978,645 @@ CREATE TABLE IF NOT EXISTS "network_types" (
1124
978
  "name" TEXT,
1125
979
  "description" TEXT
1126
980
  );
981
+ DROP TABLE IF EXISTS "device_site";
982
+ CREATE TABLE IF NOT EXISTS "device_site" (
983
+ "date_in" TEXT,
984
+ "date_out" TEXT,
985
+ "id_device" INTEGER,
986
+ "id_place" TEXT,
987
+ "id_site" INTEGER
988
+ );
989
+ DROP TABLE IF EXISTS "documenti";
990
+ CREATE TABLE IF NOT EXISTS "documenti" (
991
+ "id" INTEGER,
992
+ "tipo" TEXT,
993
+ "anno" INTEGER,
994
+ "data_emissione" TEXT,
995
+ "descrizione" TEXT,
996
+ "riferimento" TEXT,
997
+ "nome_originale" TEXT,
998
+ "nome_uuid" TEXT,
999
+ "is_removed" INTEGER,
1000
+ PRIMARY KEY("id" AUTOINCREMENT)
1001
+ );
1002
+ DROP TABLE IF EXISTS "software_licensed";
1003
+ CREATE TABLE IF NOT EXISTS "software_licensed" (
1004
+ "id" INTEGER,
1005
+ "manifacturer" TEXT,
1006
+ "name" TEXT,
1007
+ "version" TEXT,
1008
+ "id_vendor" INTEGER,
1009
+ "date_license" TEXT,
1010
+ PRIMARY KEY("id" AUTOINCREMENT)
1011
+ );
1012
+ DROP TABLE IF EXISTS "tpl_model_monitor";
1013
+ CREATE TABLE IF NOT EXISTS "tpl_model_monitor" (
1014
+ "id" INTEGER,
1015
+ PRIMARY KEY("id" AUTOINCREMENT)
1016
+ );
1017
+ DROP TABLE IF EXISTS "tpl_model_printer";
1018
+ CREATE TABLE IF NOT EXISTS "tpl_model_printer" (
1019
+ "id" INTEGER,
1020
+ PRIMARY KEY("id" AUTOINCREMENT)
1021
+ );
1022
+ DROP TABLE IF EXISTS "tpl_model_pc";
1023
+ CREATE TABLE IF NOT EXISTS "tpl_model_pc" (
1024
+ "id" INTEGER,
1025
+ "device_type" TEXT,
1026
+ "device_manifacturer" TEXT,
1027
+ "device_model" TEXT,
1028
+ "CPU" TEXT,
1029
+ "CPU_Arch" TEXT,
1030
+ "RAM_GB" INTEGER,
1031
+ PRIMARY KEY("id" AUTOINCREMENT)
1032
+ );
1033
+ DROP TABLE IF EXISTS "tpl_model_storages";
1034
+ CREATE TABLE IF NOT EXISTS "tpl_model_storages" (
1035
+ "id" INTEGER,
1036
+ "device_type" TEXT,
1037
+ "device_manifacturer" TEXT,
1038
+ "device_model" TEXT,
1039
+ "dm_storage_type" INTEGER,
1040
+ "dm_storage_totsize" REAL,
1041
+ "dm_storage_size_unit" TEXT,
1042
+ "dm_storage_manifacturer" TEXT,
1043
+ "dm_storage_model" TEXT,
1044
+ PRIMARY KEY("id" AUTOINCREMENT)
1045
+ );
1046
+ DROP TABLE IF EXISTS "pwd_archive";
1047
+ CREATE TABLE IF NOT EXISTS "pwd_archive" (
1048
+ "id" INTEGER,
1049
+ "user" TEXT,
1050
+ "password" TEXT,
1051
+ "service" TEXT,
1052
+ "date_change" TEXT,
1053
+ "note" TEXT,
1054
+ "encrypted" INTEGER,
1055
+ "days_life" INTEGER,
1056
+ "is_active" INTEGER,
1057
+ "url" TEXT,
1058
+ PRIMARY KEY("id" AUTOINCREMENT)
1059
+ );
1060
+ DROP TABLE IF EXISTS "altri_beni_site";
1061
+ CREATE TABLE IF NOT EXISTS "altri_beni_site" (
1062
+ "data_in" TEXT,
1063
+ "data_out" TEXT,
1064
+ "id_bene" INTEGER,
1065
+ "id_site" INTEGER,
1066
+ "id_place" TEXT
1067
+ );
1068
+ DROP TABLE IF EXISTS "altro_tipi";
1069
+ CREATE TABLE IF NOT EXISTS "altro_tipi" (
1070
+ "id" INTEGER,
1071
+ "name" TEXT,
1072
+ "descrizione" TEXT,
1073
+ PRIMARY KEY("id" AUTOINCREMENT)
1074
+ );
1075
+ DROP TABLE IF EXISTS "altri_beni_dismissioni";
1076
+ CREATE TABLE IF NOT EXISTS "altri_beni_dismissioni" (
1077
+ "id" INTEGER,
1078
+ "id_dismissione" INTEGER,
1079
+ "id_bene" INTEGER,
1080
+ "data" TEXT,
1081
+ "note" TEXT,
1082
+ "motivo" INTEGER,
1083
+ PRIMARY KEY("id")
1084
+ );
1085
+ DROP TABLE IF EXISTS "ImportInv20250410";
1086
+ CREATE TABLE IF NOT EXISTS "ImportInv20250410" (
1087
+ "rif_fattura" TEXT,
1088
+ "inv_ict3" INTEGER,
1089
+ "descrizione_bene" TEXT,
1090
+ "destinazione" TEXT,
1091
+ "importo" TEXT,
1092
+ "note" TEXT,
1093
+ "Rif_pi3_01" TEXT,
1094
+ "rif_sap" REAL
1095
+ );
1096
+ DROP TABLE IF EXISTS "altri_beni_doc";
1097
+ CREATE TABLE IF NOT EXISTS "altri_beni_doc" (
1098
+ "id" INTEGER,
1099
+ "id_bene" INTEGER,
1100
+ "id_doc" INTEGER,
1101
+ "is_acquisto" INTEGER,
1102
+ "is_collaudo" INTEGER,
1103
+ "is_dismissione" INTEGER,
1104
+ PRIMARY KEY("id" AUTOINCREMENT)
1105
+ );
1106
+ DROP TABLE IF EXISTS "devices";
1107
+ CREATE TABLE IF NOT EXISTS "devices" (
1108
+ "id" INTEGER,
1109
+ "inv_ict3_number" TEXT,
1110
+ "inv_tn_number" TEXT,
1111
+ "inv_pnrr_number" TEXT,
1112
+ "inv_tndigit_number" TEXT,
1113
+ "type" TEXT,
1114
+ "manifacturer" TEXT,
1115
+ "model" TEXT,
1116
+ "serial_no" TEXT,
1117
+ "note" TEXT,
1118
+ "is_removed" INTEGER,
1119
+ "id_type" INTEGER,
1120
+ "sap_cespite_classe" TEXT,
1121
+ "sap_cespite_num" TEXT,
1122
+ "num_objects" INTEGER,
1123
+ "no_inventario" INTEGER,
1124
+ PRIMARY KEY("id" AUTOINCREMENT)
1125
+ );
1126
+ DROP TABLE IF EXISTS "altri_beni";
1127
+ CREATE TABLE IF NOT EXISTS "altri_beni" (
1128
+ "id" INTEGER,
1129
+ "inv_ict3_number" TEXT,
1130
+ "inv_comune_prov" TEXT,
1131
+ "serial_no" TEXT,
1132
+ "id_type" INTEGER,
1133
+ "descrizione" TEXT,
1134
+ "manifacturer" TEXT,
1135
+ "model" TEXT,
1136
+ "note" TEXT,
1137
+ "no_inventario" INTEGER,
1138
+ PRIMARY KEY("id" AUTOINCREMENT)
1139
+ );
1140
+ DROP TABLE IF EXISTS "anagrafica_funzioni";
1141
+ CREATE TABLE IF NOT EXISTS "anagrafica_funzioni" (
1142
+ "id_anag" INTEGER,
1143
+ "id_contact_fornitore" INTEGER,
1144
+ "id_contact_gestore" INTEGER,
1145
+ "id_contact_riparatore" INTEGER,
1146
+ "id_contact_smaltitore" INTEGER,
1147
+ "id_contact_assistenza" INTEGER
1148
+ );
1149
+ DROP TABLE IF EXISTS "anagrafica_contatti";
1150
+ CREATE TABLE IF NOT EXISTS "anagrafica_contatti" (
1151
+ "id" INTEGER,
1152
+ "id_anag" INTEGER,
1153
+ "contact_value" TEXT,
1154
+ "contact_type" TEXT,
1155
+ "contact_reference" TEXT,
1156
+ PRIMARY KEY("id" AUTOINCREMENT)
1157
+ );
1158
+ DROP TABLE IF EXISTS "anagrafica_generale";
1159
+ CREATE TABLE IF NOT EXISTS "anagrafica_generale" (
1160
+ "id" INTEGER,
1161
+ "name" TEXT,
1162
+ "address" TEXT,
1163
+ "city" TEXT,
1164
+ "province" TEXT,
1165
+ "country" TEXT,
1166
+ "web_site" TEXT,
1167
+ PRIMARY KEY("id" AUTOINCREMENT)
1168
+ );
1169
+ DROP TABLE IF EXISTS "armadio_device";
1170
+ CREATE TABLE IF NOT EXISTS "armadio_device" (
1171
+ "id_device" INTEGER,
1172
+ "descrizione" TEXT,
1173
+ "destinazione" TEXT,
1174
+ "rete" TEXT,
1175
+ "level" INTEGER
1176
+ );
1177
+ DROP TABLE IF EXISTS "armadio_patch";
1178
+ CREATE TABLE IF NOT EXISTS "armadio_patch" (
1179
+ "id_device" INTEGER,
1180
+ "descrizione" TEXT,
1181
+ "level" INTEGER
1182
+ );
1183
+ DROP TABLE IF EXISTS "armadio_ports";
1184
+ CREATE TABLE IF NOT EXISTS "armadio_ports" (
1185
+ "id" INTEGER,
1186
+ "id_port" INTEGER,
1187
+ "id_place" TEXT,
1188
+ "id_patch" INTEGER,
1189
+ "num_patch_port" TEXT,
1190
+ "id_switch" INTEGER,
1191
+ "num_switch_port" TEXT,
1192
+ PRIMARY KEY("id" AUTOINCREMENT)
1193
+ );
1194
+ DROP TABLE IF EXISTS "site_ports";
1195
+ CREATE TABLE IF NOT EXISTS "site_ports" (
1196
+ "id" INTEGER,
1197
+ "id_site" INTEGER,
1198
+ "id_place" TEXT,
1199
+ "port_sign" TEXT,
1200
+ "port_type" TEXT,
1201
+ "port_switch" TEXT,
1202
+ "local_switch_exists" INTEGER,
1203
+ "note" TEXT,
1204
+ "is_connected" INTEGER,
1205
+ PRIMARY KEY("id" AUTOINCREMENT)
1206
+ );
1207
+ DROP TABLE IF EXISTS "ImportPorteRete";
1208
+ CREATE TABLE IF NOT EXISTS "ImportPorteRete" (
1209
+ "Portasign" INTEGER,
1210
+ "Site" INTEGER,
1211
+ "Place" TEXT,
1212
+ "Note" TEXT,
1213
+ "Tipo" TEXT
1214
+ );
1215
+ DROP TABLE IF EXISTS "ImportAPBS";
1216
+ CREATE TABLE IF NOT EXISTS "ImportAPBS" (
1217
+ "field1" TEXT,
1218
+ "Nome" TEXT,
1219
+ "Modello" TEXT,
1220
+ "IndirizzoIP" TEXT,
1221
+ "Mac" TEXT,
1222
+ "Collocazione" TEXT,
1223
+ "Note" TEXT,
1224
+ "Patch" TEXT
1225
+ );
1226
+ DROP TABLE IF EXISTS "Importvoiptelall";
1227
+ CREATE TABLE IF NOT EXISTS "Importvoiptelall" (
1228
+ "id" INTEGER,
1229
+ "inv_ict3_number" TEXT,
1230
+ "type" TEXT
1231
+ );
1232
+ DROP TABLE IF EXISTS "Tracciato_grezzo_IC_TRENTO3";
1233
+ CREATE TABLE IF NOT EXISTS "Tracciato_grezzo_IC_TRENTO3" (
1234
+ "interno" INTEGER,
1235
+ "cliente_id" TEXT,
1236
+ "nome" TEXT,
1237
+ "cognome" TEXT,
1238
+ "MACAddress" TEXT,
1239
+ "servizio" TEXT,
1240
+ "id_abilitazioni" INTEGER,
1241
+ "distretto" TEXT,
1242
+ "id_sede" TEXT,
1243
+ "cluster" TEXT,
1244
+ "gruppo_chiamata" TEXT,
1245
+ "tipo_telefono" TEXT,
1246
+ "timeout" INTEGER,
1247
+ "numero_ricaduta" TEXT,
1248
+ "numero_ricerca" TEXT
1249
+ );
1250
+ DROP TABLE IF EXISTS "ImportMultipresa";
1251
+ CREATE TABLE IF NOT EXISTS "ImportMultipresa" (
1252
+ "Id" TEXT,
1253
+ "Marca" TEXT,
1254
+ "Interruttore" TEXT,
1255
+ "Protezione" TEXT,
1256
+ "Lunghezzacavo" INTEGER,
1257
+ "Tipospina" TEXT,
1258
+ "Composizione" TEXT,
1259
+ "CaricoMax" INTEGER
1260
+ );
1261
+ DROP TABLE IF EXISTS "device_switch";
1262
+ CREATE TABLE IF NOT EXISTS "device_switch" (
1263
+ "id_device" INTEGER,
1264
+ "num_ports" INTEGER,
1265
+ "num_poe" INTEGER,
1266
+ "tipo" TEXT,
1267
+ PRIMARY KEY("id_device")
1268
+ );
1269
+ DROP TABLE IF EXISTS "patch_ports";
1270
+ CREATE TABLE IF NOT EXISTS "patch_ports" (
1271
+ "id" INTEGER,
1272
+ "id_device" INTEGER,
1273
+ "num_port" INTEGER,
1274
+ "mark" TEXT,
1275
+ PRIMARY KEY("id" AUTOINCREMENT)
1276
+ );
1277
+ DROP TABLE IF EXISTS "switch_ports";
1278
+ CREATE TABLE IF NOT EXISTS "switch_ports" (
1279
+ "id" INTEGER,
1280
+ "id_device" INTEGER,
1281
+ "num_port" INTEGER,
1282
+ "is_poe" INTEGER,
1283
+ "mark" TEXT,
1284
+ "port_type" TEXT,
1285
+ PRIMARY KEY("id" AUTOINCREMENT)
1286
+ );
1287
+ DROP TABLE IF EXISTS "switch_patch_connections";
1288
+ CREATE TABLE IF NOT EXISTS "switch_patch_connections" (
1289
+ "id" INTEGER,
1290
+ "id_patch_port" INTEGER,
1291
+ "id_switch_port" INTEGER,
1292
+ "note" TEXT,
1293
+ PRIMARY KEY("id" AUTOINCREMENT)
1294
+ );
1295
+ DROP TABLE IF EXISTS "anagrafica_utenze";
1296
+ CREATE TABLE IF NOT EXISTS "anagrafica_utenze" (
1297
+ "id" INTEGER,
1298
+ "cognome_denominazione" TEXT,
1299
+ "nome" TEXT,
1300
+ "titolo" TEXT,
1301
+ PRIMARY KEY("id" AUTOINCREMENT)
1302
+ );
1303
+ DROP TABLE IF EXISTS "device_voip_cfg";
1304
+ CREATE TABLE IF NOT EXISTS "device_voip_cfg" (
1305
+ "id_device" INTEGER,
1306
+ "inv_ict3_number" TEXT,
1307
+ "tipo" TEXT,
1308
+ "Cognome" TEXT,
1309
+ "Nome" TEXT,
1310
+ "numero_interno" TEXT,
1311
+ "nuovo_numero" TEXT,
1312
+ "mac_address" TEXT,
1313
+ "hs_code" TEXT,
1314
+ "note" TEXT,
1315
+ "id_place" TEXT,
1316
+ "cable_length_mt" INTEGER,
1317
+ "need_power_plug" INTEGER,
1318
+ "port_sigla" TEXT,
1319
+ "is_configured" INTEGER,
1320
+ "id_port" INTEGER,
1321
+ "is_connected" INTEGER
1322
+ );
1323
+ DROP TABLE IF EXISTS "software_consegne";
1324
+ CREATE TABLE IF NOT EXISTS "software_consegne" (
1325
+ "id" INTEGER,
1326
+ "id_consegna" INTEGER,
1327
+ "id_sw" INTEGER,
1328
+ "note" TEXT,
1329
+ PRIMARY KEY("id" AUTOINCREMENT)
1330
+ );
1331
+ DROP TABLE IF EXISTS "device_software";
1332
+ CREATE TABLE IF NOT EXISTS "device_software" (
1333
+ "id" INTEGER,
1334
+ "id_device" INTEGER,
1335
+ "id_software" INTEGER,
1336
+ "note" TEXT,
1337
+ PRIMARY KEY("id" AUTOINCREMENT)
1338
+ );
1339
+ DROP TABLE IF EXISTS "device_lan_ports";
1340
+ CREATE TABLE IF NOT EXISTS "device_lan_ports" (
1341
+ "id" INTEGER,
1342
+ "id_device" INTEGER,
1343
+ "id_card" INTEGER,
1344
+ "id_port" INTEGER,
1345
+ "date_start" TEXT,
1346
+ "date_end" TEXT,
1347
+ PRIMARY KEY("id" AUTOINCREMENT)
1348
+ );
1349
+ DROP TABLE IF EXISTS "port_usage";
1350
+ CREATE TABLE IF NOT EXISTS "port_usage" (
1351
+ "id" INTEGER,
1352
+ "id_port" INTEGER,
1353
+ "port_type" TEXT,
1354
+ "port_switch" TEXT,
1355
+ "date_start" TEXT,
1356
+ "date_end" TEXT,
1357
+ PRIMARY KEY("id" AUTOINCREMENT)
1358
+ );
1359
+ DROP TABLE IF EXISTS "device_utenza";
1360
+ CREATE TABLE IF NOT EXISTS "device_utenza" (
1361
+ "id" INTEGER,
1362
+ "id_device" INTEGER,
1363
+ "id_utente" INTEGER,
1364
+ "date_start" TEXT,
1365
+ "data_end" TEXT,
1366
+ PRIMARY KEY("id")
1367
+ );
1368
+ DROP TABLE IF EXISTS "beni_limbo";
1369
+ CREATE TABLE IF NOT EXISTS "beni_limbo" (
1370
+ "id" INTEGER,
1371
+ "id_bene" INTEGER,
1372
+ "tipo_bene" TEXT,
1373
+ "id_doc" INTEGER,
1374
+ "data_rilievo" TEXT,
1375
+ PRIMARY KEY("id" AUTOINCREMENT)
1376
+ );
1377
+ DROP TABLE IF EXISTS "beniconsumo_multipresa";
1378
+ CREATE TABLE IF NOT EXISTS "beniconsumo_multipresa" (
1379
+ "id" INTEGER,
1380
+ "id_bene" INTEGER,
1381
+ "switch" INTEGER,
1382
+ "protezione" INTEGER,
1383
+ "lunghezza_cm" INTEGER,
1384
+ "tipo_spina" TEXT,
1385
+ "composizione" TEXT,
1386
+ "identificativo" TEXT,
1387
+ "potenza_max" INTEGER,
1388
+ "serial_no" TEXT,
1389
+ PRIMARY KEY("id" AUTOINCREMENT)
1390
+ );
1391
+ DROP TABLE IF EXISTS "beniconsumo_tastiere_mouse";
1392
+ CREATE TABLE IF NOT EXISTS "beniconsumo_tastiere_mouse" (
1393
+ "id" INTEGER,
1394
+ "id_bene" INTEGER,
1395
+ "tipo" TEXT,
1396
+ "id_type" INTEGER,
1397
+ "identificativo" TEXT,
1398
+ "serial_no" TEXT,
1399
+ PRIMARY KEY("id" AUTOINCREMENT)
1400
+ );
1401
+ DROP TABLE IF EXISTS "beniconsumo_drives";
1402
+ CREATE TABLE IF NOT EXISTS "beniconsumo_drives" (
1403
+ "id" INTEGER,
1404
+ "id_bene" INTEGER,
1405
+ "tipo" TEXT,
1406
+ "id_type" INTEGER,
1407
+ "identificativo" TEXT,
1408
+ "serial_no" TEXT,
1409
+ PRIMARY KEY("id" AUTOINCREMENT)
1410
+ );
1411
+ DROP TABLE IF EXISTS "ImportDocentiPrimaria";
1412
+ CREATE TABLE IF NOT EXISTS "ImportDocentiPrimaria" (
1413
+ "FirstName" TEXT,
1414
+ "LastName" TEXT,
1415
+ "EmailAddress" TEXT,
1416
+ "Status" TEXT,
1417
+ "LastSignIn[READONLY]" TEXT,
1418
+ "EmailUsage[READONLY]" TEXT
1419
+ );
1420
+ DROP TABLE IF EXISTS "ImportDocentiSecondaria";
1421
+ CREATE TABLE IF NOT EXISTS "ImportDocentiSecondaria" (
1422
+ "FirstName" TEXT,
1423
+ "LastName" TEXT,
1424
+ "EmailAddress" TEXT,
1425
+ "Status" TEXT,
1426
+ "LastSignIn[READONLY]" TEXT,
1427
+ "EmailUsage[READONLY]" TEXT
1428
+ );
1429
+ DROP TABLE IF EXISTS "ImportSupplentiSPSG";
1430
+ CREATE TABLE IF NOT EXISTS "ImportSupplentiSPSG" (
1431
+ "FirstName" TEXT,
1432
+ "LastName" TEXT,
1433
+ "EmailAddress" TEXT,
1434
+ "Status[READONLY]" TEXT,
1435
+ "LastSignIn[READONLY]" TEXT,
1436
+ "EmailUsage[READONLY]" TEXT
1437
+ );
1438
+ DROP TABLE IF EXISTS "ImportSupplentiSP";
1439
+ CREATE TABLE IF NOT EXISTS "ImportSupplentiSP" (
1440
+ "FirstName" TEXT,
1441
+ "LastName" TEXT,
1442
+ "EmailAddress" TEXT,
1443
+ "Status[READONLY]" TEXT,
1444
+ "LastSignIn[READONLY]" TEXT,
1445
+ "EmailUsage[READONLY]" TEXT
1446
+ );
1447
+ DROP TABLE IF EXISTS "ImportEnti";
1448
+ CREATE TABLE IF NOT EXISTS "ImportEnti" (
1449
+ "FirstName" TEXT,
1450
+ "LastName" TEXT,
1451
+ "EmailAddress" TEXT,
1452
+ "Status" TEXT,
1453
+ "LastSignIn[READONLY]" TEXT,
1454
+ "EmailUsage[READONLY]" TEXT
1455
+ );
1456
+ DROP TABLE IF EXISTS "ImportAssEducatori";
1457
+ CREATE TABLE IF NOT EXISTS "ImportAssEducatori" (
1458
+ "FirstName" TEXT,
1459
+ "LastName" TEXT,
1460
+ "EmailAddress" TEXT,
1461
+ "Status" TEXT,
1462
+ "LastSignIn[READONLY]" TEXT,
1463
+ "EmailUsage[READONLY]" TEXT
1464
+ );
1465
+ DROP TABLE IF EXISTS "anagrafica_docenti";
1466
+ CREATE TABLE IF NOT EXISTS "anagrafica_docenti" (
1467
+ "id" INTEGER,
1468
+ "cognome" TEXT,
1469
+ "nome" TEXT,
1470
+ "email" TEXT,
1471
+ "id_place" TEXT,
1472
+ "ordine" TEXT,
1473
+ "ruolo" TEXT,
1474
+ "is_attivo" INTEGER,
1475
+ PRIMARY KEY("id" AUTOINCREMENT)
1476
+ );
1477
+ DROP TABLE IF EXISTS "softwares";
1478
+ CREATE TABLE IF NOT EXISTS "softwares" (
1479
+ "id" INTEGER,
1480
+ "maker" TEXT,
1481
+ "model" TEXT,
1482
+ "support" TEXT,
1483
+ "platform" TEXT,
1484
+ "release_year" TEXT,
1485
+ "version" TEXT,
1486
+ "build_no" TEXT,
1487
+ "licence_type" TEXT,
1488
+ "licence_key" TEXT,
1489
+ "expired_date" TEXT,
1490
+ "is_pnrr" INTEGER,
1491
+ "inv_ict3_number" TEXT,
1492
+ "serial_no" TEXT,
1493
+ "is_removed" INTEGER,
1494
+ "architettura" TEXT,
1495
+ "no_inventario" INTEGER,
1496
+ "life_licence" INTEGER,
1497
+ PRIMARY KEY("id" AUTOINCREMENT)
1498
+ );
1499
+ DROP TABLE IF EXISTS "docente_consegne";
1500
+ CREATE TABLE IF NOT EXISTS "docente_consegne" (
1501
+ "id" INTEGER,
1502
+ "id_docente" INTEGER,
1503
+ "id_consegna" INTEGER,
1504
+ PRIMARY KEY("id" AUTOINCREMENT)
1505
+ );
1506
+ DROP TABLE IF EXISTS "consegna_invio_email";
1507
+ CREATE TABLE IF NOT EXISTS "consegna_invio_email" (
1508
+ "id" INTEGER,
1509
+ "id_consegna" INTEGER,
1510
+ "id_bene" INTEGER,
1511
+ "data_invio" TEXT,
1512
+ "email_destinatario" TEXT,
1513
+ "esito" TEXT,
1514
+ PRIMARY KEY("id" AUTOINCREMENT)
1515
+ );
1516
+ DROP TABLE IF EXISTS "consegne";
1517
+ CREATE TABLE IF NOT EXISTS "consegne" (
1518
+ "id" INTEGER,
1519
+ "data_richiesta" TEXT,
1520
+ "data_consegna" TEXT,
1521
+ "data_rientro" TEXT,
1522
+ "data_limite" TEXT,
1523
+ "richiedente_adulto" TEXT,
1524
+ "richiedente_alunno" TEXT,
1525
+ "richiedente_genitore" TEXT,
1526
+ "id_place" TEXT,
1527
+ "id_site" INTEGER,
1528
+ "is_home" INTEGER,
1529
+ "note" TEXT,
1530
+ "removed" INTEGER,
1531
+ "stato_restituzione" INTEGER,
1532
+ "email_adulto" TEXT,
1533
+ "email_genitore" TEXT,
1534
+ "invia_email_sollecito" INTEGER,
1535
+ PRIMARY KEY("id" AUTOINCREMENT)
1536
+ );
1537
+ DROP TABLE IF EXISTS "consegna_beni";
1538
+ CREATE TABLE IF NOT EXISTS "consegna_beni" (
1539
+ "id" INTEGER,
1540
+ "id_consegna" INTEGER,
1541
+ "id_bene" INTEGER,
1542
+ "tipo_bene" TEXT,
1543
+ "data_consegna" TEXT,
1544
+ "numero" INTEGER,
1545
+ "note_consegna" TEXT,
1546
+ "stato_restituzione" INTEGER,
1547
+ "data_restituzione" TEXT,
1548
+ "note_restituzione" TEXT,
1549
+ PRIMARY KEY("id" AUTOINCREMENT)
1550
+ );
1551
+ DROP TABLE IF EXISTS "consegna_docs";
1552
+ CREATE TABLE IF NOT EXISTS "consegna_docs" (
1553
+ "id" INTEGER,
1554
+ "id_consegna" INTEGER,
1555
+ "id_doc" INTEGER,
1556
+ "is_danneggiamento" INTEGER,
1557
+ "is_consegna" INTEGER,
1558
+ PRIMARY KEY("id" AUTOINCREMENT)
1559
+ );
1560
+ DROP TABLE IF EXISTS "display_part";
1561
+ CREATE TABLE IF NOT EXISTS "display_part" (
1562
+ "id" INTEGER,
1563
+ "id_device" INTEGER,
1564
+ "size_inch" REAL,
1565
+ "format" TEXT,
1566
+ "technology" TEXT,
1567
+ "touch" INTEGER,
1568
+ "is_removable" INTEGER,
1569
+ PRIMARY KEY("id")
1570
+ );
1571
+ DROP TABLE IF EXISTS "disk_usage";
1572
+ CREATE TABLE IF NOT EXISTS "disk_usage" (
1573
+ "id" INTEGER,
1574
+ "date_ref" TEXT,
1575
+ "id_device" INTEGER,
1576
+ "id_storage" INTEGER,
1577
+ "size_unit" TEXT,
1578
+ "available_space" REAL,
1579
+ "partition_num" INTEGER,
1580
+ "partition_label" TEXT,
1581
+ PRIMARY KEY("id" AUTOINCREMENT)
1582
+ );
1583
+ DROP TABLE IF EXISTS "reserved_beni";
1584
+ CREATE TABLE IF NOT EXISTS "reserved_beni" (
1585
+ "id" INTEGER,
1586
+ "id_bene" INTEGER,
1587
+ "tipo_bene" TEXT,
1588
+ "note_reservation" TEXT,
1589
+ "date_start" TEXT,
1590
+ "date_end" TEXT,
1591
+ PRIMARY KEY("id" AUTOINCREMENT)
1592
+ );
1593
+ DROP TABLE IF EXISTS "device_properties";
1594
+ CREATE TABLE IF NOT EXISTS "device_properties" (
1595
+ "id" INTEGER,
1596
+ "id_device" INTEGER,
1597
+ "raw_properties" BLOB,
1598
+ "is_imported" INTEGER,
1599
+ "id_config" INTEGER,
1600
+ PRIMARY KEY("id" AUTOINCREMENT)
1601
+ );
1602
+ DROP TABLE IF EXISTS "device_interventi";
1603
+ CREATE TABLE IF NOT EXISTS "device_interventi" (
1604
+ "id" INTEGER,
1605
+ "id_device" INTEGER,
1606
+ "date_start" TEXT,
1607
+ "date_end" TEXT,
1608
+ "note_intervento" TEXT,
1609
+ "tempo_stimato" INTEGER,
1610
+ "tempo_effettivo" INTEGER,
1611
+ "id_pianificazione" INTEGER,
1612
+ PRIMARY KEY("id" AUTOINCREMENT)
1613
+ );
1614
+ DROP TABLE IF EXISTS "piano_interventi";
1615
+ CREATE TABLE IF NOT EXISTS "piano_interventi" (
1616
+ "id" INTEGER,
1617
+ "date_start" TEXT,
1618
+ "date_max_end" TEXT,
1619
+ "descrizione" TEXT,
1620
+ PRIMARY KEY("id" AUTOINCREMENT)
1621
+ );
1127
1622
  COMMIT;
package/lib/modules.js CHANGED
@@ -6823,7 +6823,7 @@ function getDatesRangeConsegne() {
6823
6823
  }
6824
6824
 
6825
6825
 
6826
- function queryConsegneSQLite(data_da, data_a, data_filter, adulto, alunno, still_open) {
6826
+ function queryConsegneSQLite(data_da, data_a, data_filter, adulto, alunno, still_open, only_outofdate) {
6827
6827
  var query = "SELECT c.id, c.data_richiesta as Richiesta, c.data_consegna as Consegna, c.richiedente_adulto as Adulto, c.richiedente_alunno as Alunno, c.richiedente_genitore as Genitore, c.is_home as Casa, c.note as Note, c.email_adulto, c.email_genitore from consegne c ";
6828
6828
  query += "where (removed is null or removed = 0) ";
6829
6829
  if (adulto && adulto.trim() != '') {
@@ -6856,6 +6856,9 @@ function queryConsegneSQLite(data_da, data_a, data_filter, adulto, alunno, still
6856
6856
  if (still_open) {
6857
6857
  query += " and (select count(*) from consegna_beni where id_consegna = c.id and stato_restituzione in(0,1)) > 0"
6858
6858
  }
6859
+ if (only_outofdate && only_outofdate > 0) {
6860
+ query += " and date('now') >= c.data_limite ";
6861
+ }
6859
6862
  }
6860
6863
  if (data_filter == "RICHIESTA")
6861
6864
  query += " order by data_richiesta desc";
@@ -6864,7 +6867,7 @@ function queryConsegneSQLite(data_da, data_a, data_filter, adulto, alunno, still
6864
6867
  return query;
6865
6868
  }
6866
6869
 
6867
- function queryConsegneMySQL(data_da, data_a, data_filter, adulto, alunno, still_open) {
6870
+ function queryConsegneMySQL(data_da, data_a, data_filter, adulto, alunno, still_open, only_outofdate) {
6868
6871
  var query = "SELECT id, data_richiesta as Richiesta, data_consegna as Consegna, richiedente_adulto as Adulto, richiedente_alunno as Alunno, richiedente_genitore as Genitore, is_home as Casa, note as Note, email_adulto, email_genitore from consegne ";
6869
6872
  query += "where (removed is null or removed = 0) ";
6870
6873
  if (adulto && adulto.trim() != '') {
@@ -6893,6 +6896,9 @@ function queryConsegneMySQL(data_da, data_a, data_filter, adulto, alunno, still_
6893
6896
  if (still_open) {
6894
6897
  query += " and (select count(*) from consegna_beni where id_consegna = c.id and stato_restituzione in(0,1)) > 0"
6895
6898
  }
6899
+ if (only_outofdate && only_outofdate > 0) {
6900
+ query += " and date('now') >= c.data_limite ";
6901
+ }
6896
6902
  }
6897
6903
  if (data_filter == "RICHIESTA")
6898
6904
  query += " order by data_richiesta desc";
@@ -6901,18 +6907,18 @@ function queryConsegneMySQL(data_da, data_a, data_filter, adulto, alunno, still_
6901
6907
 
6902
6908
  return query;
6903
6909
  }
6904
- function queryConsegne(db_used,data_da, data_a, data_filter, adulto, alunno, still_open) {
6910
+ function queryConsegne(db_used,data_da, data_a, data_filter, adulto, alunno, still_open, only_outofdate) {
6905
6911
  var query = "";
6906
6912
  if (db_used) {
6907
6913
  switch (db_used) {
6908
6914
  case 'SQLITE':
6909
- query = queryConsegneSQLite(data_da, data_a, data_filter, adulto, alunno, still_open);
6915
+ query = queryConsegneSQLite(data_da, data_a, data_filter, adulto, alunno, still_open, only_outofdate);
6910
6916
  break;
6911
6917
  case 'MYSQL':
6912
- query = queryConsegneMySQL(data_da, data_a, data_filter, adulto, alunno, still_open);
6918
+ query = queryConsegneMySQL(data_da, data_a, data_filter, adulto, alunno, still_open, only_outofdate);
6913
6919
  break;
6914
6920
  case 'MYSQL2':
6915
- query = queryConsegneSQLite(data_da, data_a, data_filter, adulto, alunno, still_open);
6921
+ query = queryConsegneSQLite(data_da, data_a, data_filter, adulto, alunno, still_open, only_outofdate);
6916
6922
  break;
6917
6923
  }
6918
6924
  }
@@ -10923,12 +10929,17 @@ function queryFloorsByPlace(db_used, id_place) {
10923
10929
  return query;
10924
10930
  }
10925
10931
 
10926
- function queryFunzioneByPlaceAndFloorSQLite(id_place, piano) {
10932
+ function queryFunzioneByPlaceAndFloorSQLite(id_place, piano, date_ref) {
10927
10933
  var query = "";
10928
10934
  query = "SELECT DISTINCT sd.type as funzione from site_destinations sd";
10929
10935
  query += " JOIN sites s ON s.id = sd.id_site"
10930
10936
  if (id_place) {
10931
- query += " where date('now') >= sd.date_start and date('now') <= sd.date_end";
10937
+ if (date_ref) {
10938
+ query += " where " + date_ref + " >= sd.date_start and " + date_ref + " <= sd.date_end";
10939
+ }
10940
+ else {
10941
+ query += " where date('now') >= sd.date_start and date('now') <= sd.date_end";
10942
+ }
10932
10943
  query += " and sd.id_place = '" + id_place + "'";
10933
10944
  if (piano) {
10934
10945
  query += " and s.floor = '" + piano + "'";
@@ -10939,12 +10950,17 @@ function queryFunzioneByPlaceAndFloorSQLite(id_place, piano) {
10939
10950
 
10940
10951
  }
10941
10952
 
10942
- function queryFunzioneByPlaceAndFloorMySQL(id_place, piano) {
10953
+ function queryFunzioneByPlaceAndFloorMySQL(id_place, piano, date_ref) {
10943
10954
  var query = "";
10944
10955
  query = "SELECT DISTINCT sd.type as funzione from site_destinations sd";
10945
10956
  query += " JOIN sites s ON s.id = sd.id_site"
10946
10957
  if (id_place) {
10947
- query += " where CURDATE() >= sd.date_start and CURDATE() <= sd.date_end";
10958
+ if (date_ref) {
10959
+ query += " where :date_ref >= sd.date_start and :date_ref <= sd.date_end";
10960
+ }
10961
+ else {
10962
+ query += " where CURDATE() >= sd.date_start and CURDATE() <= sd.date_end";
10963
+ }
10948
10964
  query += " and sd.id_place = :id_place";
10949
10965
  if (piano) {
10950
10966
  query += " and s.floor = :piano";
@@ -10955,12 +10971,17 @@ function queryFunzioneByPlaceAndFloorMySQL(id_place, piano) {
10955
10971
 
10956
10972
  }
10957
10973
 
10958
- function queryFunzioneByPlaceAndFloorMySQL2(id_place, piano) {
10974
+ function queryFunzioneByPlaceAndFloorMySQL2(id_place, piano, date_ref) {
10959
10975
  var query = "";
10960
10976
  query = "SELECT DISTINCT sd.type as funzione from site_destinations sd";
10961
10977
  query += " JOIN sites s ON s.id = sd.id_site"
10962
10978
  if (id_place) {
10963
- query += " where CURDATE() >= sd.date_start and CURDATE() <= sd.date_end";
10979
+ if (date_ref) {
10980
+ query += " where " + date_ref + " >= sd.date_start and " + date_ref + " <= sd.date_end";
10981
+ }
10982
+ else {
10983
+ query += " where CURDATE() >= sd.date_start and CURDATE() <= sd.date_end";
10984
+ }
10964
10985
  query += " and sd.id_place = '" + id_place + "'";
10965
10986
  if (piano) {
10966
10987
  query += " and s.floor = '" + piano + "'";
@@ -10971,18 +10992,18 @@ function queryFunzioneByPlaceAndFloorMySQL2(id_place, piano) {
10971
10992
 
10972
10993
  }
10973
10994
 
10974
- function queryFunzioneByPlaceAndFloor(db_used, id_place, piano) {
10995
+ function queryFunzioneByPlaceAndFloor(db_used, id_place, piano, date_ref) {
10975
10996
  var query = "";
10976
10997
  if (db_used) {
10977
10998
  switch (db_used) {
10978
10999
  case 'SQLITE':
10979
- query = queryFunzioneByPlaceAndFloorSQLite(id_place, piano);
11000
+ query = queryFunzioneByPlaceAndFloorSQLite(id_place, piano, date_ref);
10980
11001
  break;
10981
11002
  case 'MYSQL':
10982
- query = queryFunzioneByPlaceAndFloorMySQL(id_place, piano);
11003
+ query = queryFunzioneByPlaceAndFloorMySQL(id_place, piano, date_ref);
10983
11004
  break;
10984
11005
  case 'MYSQL2':
10985
- query = queryFunzioneByPlaceAndFloorMySQL2(id_place, piano);
11006
+ query = queryFunzioneByPlaceAndFloorMySQL2(id_place, piano, date_ref);
10986
11007
  break;
10987
11008
  }
10988
11009
  }
@@ -10991,11 +11012,15 @@ function queryFunzioneByPlaceAndFloor(db_used, id_place, piano) {
10991
11012
  }
10992
11013
 
10993
11014
 
10994
- function querySitesSQLite(place, piano, funzione) {
11015
+ function querySitesSQLite(place, piano, funzione, date_ref) {
10995
11016
  var query = "SELECT DISTINCT sd.id_site as id, s.id_place as Plesso, sd.name as Nome, s.mark as Codice, s.floor as Piano, sd.type as Funzione from site_destinations sd";
10996
11017
  query += " LEFT JOIN sites s ON s.id = sd.id_site"
10997
- query += " where date('now') >= sd.date_start and date('now') <= sd.date_end";
10998
-
11018
+ if (date_ref) {
11019
+ query += " where " + date_ref + " >= sd.date_start and " + date_ref + " <= sd.date_end";
11020
+ }
11021
+ else {
11022
+ query += " where date('now') >= sd.date_start and date('now') <= sd.date_end";
11023
+ }
10999
11024
  if (place) {
11000
11025
  query += " and s.id_place = '" + place + "'";
11001
11026
  }
@@ -11010,11 +11035,16 @@ function querySitesSQLite(place, piano, funzione) {
11010
11035
  return query;
11011
11036
  }
11012
11037
 
11013
- function querySitesMySQL(place, piano, funzione) {
11038
+ function querySitesMySQL(place, piano, funzione, date_ref) {
11014
11039
  var query = "SELECT DISTINCT sd.id_site as id, s.id_place as Plesso, sd.name as Nome, s.mark as Codice, s.floor as Piano, sd.type as Funzione from site_destinations sd ";
11015
11040
  query += " LEFT JOIN sites s ON s.id = sd.id_site"
11016
- query += " where CURDATE() >= sd.date_start and CURDATE() <= sd.date_end";
11017
-
11041
+ if (date_ref) {
11042
+ query += " where :date_ref >= sd.date_start and :date_ref <= sd.date_end";
11043
+ }
11044
+ else {
11045
+ query += " where CURDATE() >= sd.date_start and CURDATE() <= sd.date_end";
11046
+ }
11047
+
11018
11048
  if (place) {
11019
11049
  query += " and s.id_place = :id_place";
11020
11050
  }
@@ -11029,10 +11059,15 @@ function querySitesMySQL(place, piano, funzione) {
11029
11059
  return query;
11030
11060
  }
11031
11061
 
11032
- function querySitesMySQL2(place, piano, funzione) {
11062
+ function querySitesMySQL2(place, piano, funzione, date_ref) {
11033
11063
  var query = "SELECT DISTINCT sd.id_site as id, s.id_place as Plesso, sd.name as Nome, s.mark as Codice, s.floor as Piano, sd.type as Funzione from site_destinations sd";
11034
11064
  query += " LEFT JOIN sites s ON s.id = sd.id_site"
11035
- query += " where CURDATE() >= sd.date_start and CURDATE() <= sd.date_end";
11065
+ if (date_ref) {
11066
+ query += " where " + date_ref + " >= sd.date_start and " + date_ref + " <= sd.date_end";
11067
+ }
11068
+ else {
11069
+ query += " where CURDATE() >= sd.date_start and CURDATE() <= sd.date_end";
11070
+ }
11036
11071
 
11037
11072
  if (place) {
11038
11073
  query += " and s.id_place = '" + place + "'";
@@ -11048,18 +11083,18 @@ function querySitesMySQL2(place, piano, funzione) {
11048
11083
  return query;
11049
11084
  }
11050
11085
 
11051
- function querySites(db_used, place, piano, funzione) {
11086
+ function querySites(db_used, place, piano, funzione, date_ref) {
11052
11087
  var query = "";
11053
11088
  if (db_used) {
11054
11089
  switch (db_used) {
11055
11090
  case 'SQLITE':
11056
- query = querySitesSQLite(place, piano, funzione);
11091
+ query = querySitesSQLite(place, piano, funzione, date_ref);
11057
11092
  break;
11058
11093
  case 'MYSQL':
11059
- query = querySitesMySQL(place, piano, funzione);
11094
+ query = querySitesMySQL(place, piano, funzione, date_ref);
11060
11095
  break;
11061
11096
  case 'MYSQL2':
11062
- query = querySitesMySQL2(place, piano, funzione);
11097
+ query = querySitesMySQL2(place, piano, funzione, date_ref);
11063
11098
  break;
11064
11099
  }
11065
11100
  }
@@ -11607,9 +11642,74 @@ function getSitesSelectCombo(db_used,id_place, tipo_aula) {
11607
11642
  return query;
11608
11643
  }
11609
11644
  //End get sites for combo
11645
+ // Select Site in Combo Parziale
11646
+ function getSitesSelectComboByPlaceSQLite(id_place, floor, date_ref) {
11647
+ var query = "select s.id, concat(sd.name, ' - ', s.mark) as Descrizione from sites s ";
11648
+ query += "join site_destinations sd on sd.id_site = s.id ";
11649
+ if (date_ref) {
11650
+ query += "where '" + date_ref + "' >= sd.date_start and '" + date_ref + "' <= sd.date_end ";
11651
+ }
11652
+ else {
11653
+ query += "where date('now') >= sd.date_start and date('now') <= sd.date_end ";
11654
+ }
11655
+ query += "and s.id_place = '" + id_place +"' ";
11656
+ query += "and s.floor = " + floor +" ";
11657
+ query += "order by sd.name ";
11658
+ return query;
11659
+ }
11660
+
11661
+ function getSitesSelectComboByPlaceMySQL(id_place, floor, date_ref) {
11662
+ var query = "select s.id, concat(sd.name, ' - ', s.mark) as Descrizione from sites s ";
11663
+ query += "join site_destinations sd on sd.id_site = s.id ";
11664
+ if (date_ref) {
11665
+ query += "where :date_ref >= sd.date_start and :date_ref <= sd.date_end ";
11666
+ }
11667
+ else {
11668
+ query += "where CURDATE() >= sd.date_start and CURDATE() <= sd.date_end ";
11669
+ }
11670
+ query += "and s.id_place = :id_place ";
11671
+ query += "and s.floor = :floor ";
11672
+ query += "order by sd.name ";
11673
+ return query;
11674
+ }
11675
+
11676
+ function getSitesSelectComboByPlaceMySQL2(id_place, floor, date_ref) {
11677
+ var query = "select s.id, concat(sd.name, ' - ', s.mark) as Descrizione from sites s ";
11678
+ query += "join site_destinations sd on sd.id_site = s.id ";
11679
+ if (date_ref) {
11680
+ query += "where '" + date_ref + "' >= sd.date_start and '" + date_ref + "' <= sd.date_end ";
11681
+ }
11682
+ else {
11683
+ query += "where CURDATE() >= sd.date_start and CURDATE() <= sd.date_end ";
11684
+ }
11685
+ query += "and s.id_place = '" + id_place +"' ";
11686
+ query += "and s.floor = " + floor +" ";
11687
+ query += "order by sd.name ";
11688
+ return query;
11689
+ }
11690
+
11691
+ function getSitesSelectComboByPlace(db_used, id_place, floor, date_ref) {
11692
+ var query = "";
11693
+ if (db_used) {
11694
+ switch (db_used) {
11695
+ case 'SQLITE':
11696
+ query = getSitesSelectComboByPlaceSQLite(id_place, floor, date_ref);
11697
+ break;
11698
+ case 'MYSQL':
11699
+ query = getSitesSelectComboByPlaceMySQL(id_place, floor, date_ref);
11700
+ break;
11701
+ case 'MYSQL2':
11702
+ query = getSitesSelectComboByPlaceMySQL2(id_place, floor, date_ref);
11703
+ break;
11704
+ }
11705
+ }
11706
+ return query;
11707
+ }
11708
+
11709
+ //End Site in Combo Parziale
11610
11710
  //Get Sites by Id
11611
11711
  function getSiteByIdSQLite(id_site) {
11612
- var query = "select s.id, s.id_place as Plesso, p.name as Denominazione, sd.name as Destinazione, s.mark as Codice, sd.type as Tipo from sites s ";
11712
+ var query = "select s.id, s.id_place as Plesso, p.name as Denominazione, sd.name as Destinazione, s.mark as Codice, sd.type as Tipo from sites s ";
11613
11713
  query += "join site_destinations sd on sd.id_site = s.id ";
11614
11714
  query += "join places p on p.mark = s.id_place ";
11615
11715
  query += "where date('now') >= sd.date_start and date('now') <= sd.date_end ";
@@ -14340,6 +14440,45 @@ function removeDismissioneAltroBeneFromDismissione(db_used, id_benedismiss, id_d
14340
14440
 
14341
14441
 
14342
14442
  //End Manage altri beni
14443
+ function getMapScript(map_tag) {
14444
+ var text = "<script>";
14445
+ text += "(function($scope) {";
14446
+
14447
+ text += "$('#Maps_MAPPA_cards').on('touchstart touchmove',function(e){";
14448
+ text += "e.preventDefault();";
14449
+ text += "const map = document.getElementById(\"" + map_tag +"\");";
14450
+ text += "let rect = map.getBoundingClientRect();";
14451
+ text += "let xCoordinate = ((e.touches[0].clientX - rect.left)/ (rect.right- rect.left)).toFixed(4);";
14452
+ text += "let yCoordinate = ((e.touches[0].clientY - rect.top)/(rect.bottom - rect.top)).toFixed(4);";
14453
+ text += "if (xCoordinate < 1 && xCoordinate > 0 && yCoordinate < 1 && yCoordinate > 0){";
14454
+ text += "$(\"#coords\").text( \"X: \" + xCoordinate + \", Y: \" + yCoordinate);";
14455
+ text += "$(\"#imgcursor\").css( \"left\", (e.touches[0].clientX - rect.left) - 20 ); // offset to half of the cursor's width";
14456
+ text += "$(\"#imgcursor\").css( \"top\", (e.touches[0].clientY - rect.top) - 20 ); // offset to half of the cursor's height";
14457
+ text += "$scope.send({\"payload\":{\"coordX\": xCoordinate, \"coordY\": yCoordinate}});";
14458
+ text += "}";
14459
+ text += "});";
14460
+
14461
+ text += "$('#Maps_MAPPA_cards').on('mousemove mousedown mouseup',function(e){";
14462
+ text += "e.preventDefault();";
14463
+ text += "const map = document.getElementById(\"" + map_tag +"\");";
14464
+ text += "let rect = map.getBoundingClientRect();";
14465
+ text += "let xCoordinate = ((e.clientX - rect.left)/ (rect.right- rect.left)).toFixed(4);";
14466
+ text += "let yCoordinate = ((e.clientY - rect.top)/(rect.bottom - rect.top)).toFixed(4);";
14467
+ text += "if (xCoordinate < 1 && xCoordinate > 0 && yCoordinate < 1 && yCoordinate > 0 && e.buttons == 1){ ";
14468
+ text += "$(\"#coords\").text( \"X: \" + xCoordinate + \", Y: \" + yCoordinate);";
14469
+ text += "$(\"#imgcursor\").css( \"left\", (e.clientX - rect.left) - 20); // offset to half of the cursor's width";
14470
+ text += "$(\"#imgcursor\").css( \"top\", (e.clientY - rect.top) - 20 ); // offset to half of the cursor's height";
14471
+
14472
+ text += "$scope.send({\"payload\":{\"coordX\": xCoordinate, \"coordY\": yCoordinate}});";
14473
+ text += "}";
14474
+ text += "});";
14475
+
14476
+ text += "})(scope);";
14477
+ text += "</script>";
14478
+ return text;
14479
+ }
14480
+
14481
+
14343
14482
 
14344
14483
  // Exports
14345
14484
 
@@ -14645,6 +14784,7 @@ module.exports = {
14645
14784
  querySitesLab,
14646
14785
  getSiteById,
14647
14786
  getSitesSelectCombo,
14787
+ getSitesSelectComboByPlace,
14648
14788
  verifyPrevDeviceSite,
14649
14789
  insertDeviceSite,
14650
14790
  updateDeviceSite,
@@ -14724,6 +14864,8 @@ module.exports = {
14724
14864
  loadAltroBeneDaDismettereCombo,
14725
14865
  assignAltriBeniToDismissione,
14726
14866
  removeAltriBeniFromDismissione,
14727
- removeDismissioneAltroBeneFromDismissione
14867
+ removeDismissioneAltroBeneFromDismissione,
14868
+ //
14869
+ getMapScript
14728
14870
  };
14729
14871
  // end of source
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  ".": "./lib/modules.js",
5
5
  "./dbconn": "./lib/dbconn.js"
6
6
  },
7
- "version": "3.0.89",
7
+ "version": "3.0.91",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",