alsmanager_lib 3.0.44 → 3.0.46

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.
Files changed (2) hide show
  1. package/lib/modules.js +34 -1
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -1395,7 +1395,7 @@ function getDocentiCombo(db_used, id_place, ordine_scuola, ruolo) {
1395
1395
  var query = "select id, concat(cognome, ' ', nome, ' - ', ordine, ' - ', ruolo) as nominativo from anagrafica_docenti ";
1396
1396
  query += "where is_attivo = 1 "
1397
1397
  if (ordine_scuola && ordine_scuola.trim() != '') {
1398
- query += "and ordine = '" + ordine + "' ";
1398
+ query += "and (ordine = '" + ordine + "' or ruolo <> 'DOCENTE') ";
1399
1399
  }
1400
1400
  if (id_place && id_place.trim() != '') {
1401
1401
  query += "and id_place = '" + id_place + "' ";
@@ -10536,6 +10536,38 @@ function queryPlaces() {
10536
10536
  return query;
10537
10537
  }
10538
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 mark = '" + 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 mark = :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
+
10539
10571
  function queryFloorsByPlaceSQLite(id_place) {
10540
10572
  var query = "SELECT DISTINCT floor from sites";
10541
10573
  query += " where id_place = '" + id_place + "'";
@@ -14279,6 +14311,7 @@ module.exports = {
14279
14311
  updateDeviceSiteAfterRemove,
14280
14312
  removeDeviceFromAllSites,
14281
14313
  queryPlaces,
14314
+ queryPlaceById,
14282
14315
  queryFloorsByPlace,
14283
14316
  queryFunzioneByPlaceAndFloor,
14284
14317
  querySites,
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.44",
7
+ "version": "3.0.46",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",