alsmanager_lib 3.0.169 → 3.0.171

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 +26 -14
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -6624,11 +6624,11 @@ function queryDeviceTypes() {
6624
6624
  function getDevicesNotAllocatedComboSQLite(id_site, id_place, sel_type, sel_maker, ordered_by) {
6625
6625
  var sel_type_str = "";
6626
6626
  if (sel_type) {
6627
- sel_type_str = sel_type;
6627
+ sel_type_s.tr = sel_type.toString();
6628
6628
  }
6629
6629
  var sel_maker_str = "";
6630
6630
  if (sel_maker) {
6631
- sel_maker_str = sel_maker;
6631
+ sel_maker_str = sel_maker.toString();
6632
6632
  }
6633
6633
  var query = "SELECT d.id, d.type as Tipo, d.manifacturer as Marca, d.model as Modello, ";
6634
6634
  query += "case ";
@@ -6666,11 +6666,11 @@ function getDevicesNotAllocatedComboSQLite(id_site, id_place, sel_type, sel_make
6666
6666
  function getDevicesNotAllocatedComboMySQL(id_site, id_place, sel_type, sel_maker,ordered_by) {
6667
6667
  var sel_type_str = "";
6668
6668
  if (sel_type) {
6669
- sel_type_str = sel_type;
6669
+ sel_type_str = sel_type.toString();
6670
6670
  }
6671
6671
  var sel_maker_str = "";
6672
6672
  if (sel_maker) {
6673
- sel_maker_str = sel_maker;
6673
+ sel_maker_str = sel_maker.toString();
6674
6674
  }
6675
6675
  var query = "SELECT d.id, d.type as Tipo, d.manifacturer as Marca, d.model as Modello, ";
6676
6676
  query += "case ";
@@ -6769,11 +6769,11 @@ function getDevicesNotAllocatedCombo(db_used, id_site, id_place, sel_type, sel_m
6769
6769
  function getDevicesAllocatedComboSQLite(id_site, id_place, sel_type, sel_maker, ordered_by) {
6770
6770
  var sel_type_str = "";
6771
6771
  if (sel_type) {
6772
- sel_type_str = sel_type;
6772
+ sel_type_str = sel_type.toString();
6773
6773
  }
6774
6774
  var sel_maker_str = "";
6775
6775
  if (sel_maker) {
6776
- sel_maker_str = sel_maker;
6776
+ sel_maker_str = sel_maker.toString();
6777
6777
  }
6778
6778
 
6779
6779
  var query = "SELECT d.id, d.type as Tipo, d.manifacturer as Marca, d.model as Modello, ";
@@ -6808,11 +6808,11 @@ function getDevicesAllocatedComboSQLite(id_site, id_place, sel_type, sel_maker,
6808
6808
  function getDevicesAllocatedComboMySQL(id_site, id_place, sel_type, sel_maker, ordered_by) {
6809
6809
  var sel_type_str = "";
6810
6810
  if (sel_type) {
6811
- sel_type_str = sel_type;
6811
+ sel_type_str = sel_type.toString();
6812
6812
  }
6813
6813
  var sel_maker_str = "";
6814
6814
  if (sel_maker) {
6815
- sel_maker_str = sel_maker;
6815
+ sel_maker_str = sel_maker.toString();
6816
6816
  }
6817
6817
  var query = "SELECT d.id, d.type as Tipo, d.manifacturer as Marca, d.model as Modello, ";
6818
6818
  query += "case ";
@@ -9729,9 +9729,15 @@ function getLaboratorioByIdSiteSQLite(id_site, id_place) {
9729
9729
  query += "from postazione_lab pl ";
9730
9730
  query += "join devices d on d.id = pl.id_device ";
9731
9731
  query += "left join device_pc dp on d.id = dp.id_device ";
9732
- query += "where pl.id_site = " + id_site + " ";
9733
- query += "and pl.id_place = '" + id_place + "' ";
9734
- query += "and (d.is_removed is null or d.is_removed = 0) ";
9732
+ query += "where (d.is_removed is null or d.is_removed = 0) "
9733
+ if ((id_site && id_site != 0) || (id_place && id_place != "")) {
9734
+ if (id_site && id_site != 0) {
9735
+ query += "and pl.id_site = " + id_site + " ";
9736
+ }
9737
+ if (id_place && id_place != "") {
9738
+ query += "and pl.id_place = '" + id_place + "' ";
9739
+ }
9740
+ }
9735
9741
  query += "order by pl.Bancata asc, pl.num_pos desc ";
9736
9742
  return query;
9737
9743
  }
@@ -9756,9 +9762,15 @@ function getLaboratorioByIdSiteMySQL(id_site, id_place) {
9756
9762
  query += "from postazione_lab pl ";
9757
9763
  query += "join devices d on d.id = pl.id_device ";
9758
9764
  query += "left join device_pc dp on d.id = dp.id_device ";
9759
- query += "where pl.id_site = :id_site ";
9760
- query += "and pl.id_place = ':id_place' ";
9761
- query += "and (d.is_removed is null or d.is_removed = 0) ";
9765
+ query += "where (d.is_removed is null or d.is_removed = 0) "
9766
+ if ((id_site && id_site != 0) || (id_place && id_place != "")) {
9767
+ if (id_site && id_site != 0) {
9768
+ query += "and pl.id_site = :id_site ";
9769
+ }
9770
+ if (id_place && id_place != "") {
9771
+ query += "and pl.id_place = :id_place ";
9772
+ }
9773
+ }
9762
9774
  query += "order by pl.Bancata asc, pl.num_pos desc ";
9763
9775
  return query;
9764
9776
  }
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.169",
7
+ "version": "3.0.171",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",