alsmanager_lib 3.0.238 → 3.0.240
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 +28 -3
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -1537,6 +1537,28 @@ function getDocenteById(db_used, id_docente) {
|
|
|
1537
1537
|
|
|
1538
1538
|
|
|
1539
1539
|
// End Anagrafica docenti
|
|
1540
|
+
// Anagrafica alunni
|
|
1541
|
+
function getAlunniCombo(id_place, id_site) {
|
|
1542
|
+
var query = "select id, concat(cognome, ' ', nome) as nominativo from anagrafica_alunni al ";
|
|
1543
|
+
query += "join anagrafica_alunni_site als on als.id_alunno = al.id "
|
|
1544
|
+
query += "where al.is_attivo = 1 "
|
|
1545
|
+
if (id_place) {
|
|
1546
|
+
query += "and als.id_place = '" + id_place + "' ";
|
|
1547
|
+
}
|
|
1548
|
+
if (id_site) {
|
|
1549
|
+
query += "and als.id_site = " + id_site + " ";
|
|
1550
|
+
}
|
|
1551
|
+
query += "order by cognome, nome";
|
|
1552
|
+
return query;
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
function getAlunnoById(id_alunno) {
|
|
1556
|
+
var query = "select id, cognome, nome, email, is_attivo from anagrafica_alunni ";
|
|
1557
|
+
query += "where id = " + id_alunno;
|
|
1558
|
+
return query;
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
//End anagrafica alunni
|
|
1540
1562
|
// Device configurations
|
|
1541
1563
|
function getDeviceConfigurationsSQLite(id_device) {
|
|
1542
1564
|
var query = "select id, date_conf, note from device_changes ";
|
|
@@ -13963,7 +13985,7 @@ function removeDeviceFromAllSites(db_used, id_device) {
|
|
|
13963
13985
|
//Get Sites for Combo
|
|
13964
13986
|
function getSitesSelectComboSQLite(id_place, tipo_aula) {
|
|
13965
13987
|
var query = "select s.id, concat(p.name, ' - ', sd.name, ' - ', s.mark) as Descrizione from sites s ";
|
|
13966
|
-
query += "join site_destinations sd on sd.id_site = s.id ";
|
|
13988
|
+
query += "join site_destinations sd on sd.id_site = s.id and sd.id_place = s.id_place ";
|
|
13967
13989
|
query += "join places p on p.mark = s.id_place ";
|
|
13968
13990
|
query += "where date('now') >= sd.date_start and date('now') <= sd.date_end ";
|
|
13969
13991
|
if (id_place || tipo_aula) {
|
|
@@ -13984,7 +14006,7 @@ function getSitesSelectComboSQLite(id_place, tipo_aula) {
|
|
|
13984
14006
|
|
|
13985
14007
|
function getSitesSelectComboMySQL(id_place, tipo_aula) {
|
|
13986
14008
|
var query = "select s.id, concat(p.name, ' - ', sd.name, ' - ', s.mark) as Descrizione from sites s ";
|
|
13987
|
-
query += "join site_destinations sd on sd.id_site = s.id ";
|
|
14009
|
+
query += "join site_destinations sd on sd.id_site = s.id and sd.id_place = s.id_place ";
|
|
13988
14010
|
query += "join places p on p.mark = s.id_place ";
|
|
13989
14011
|
query += "where CURDATE() >= sd.date_start and CURDATE() <= sd.date_end ";
|
|
13990
14012
|
if (id_place || tipo_aula) {
|
|
@@ -14005,7 +14027,7 @@ function getSitesSelectComboMySQL(id_place, tipo_aula) {
|
|
|
14005
14027
|
|
|
14006
14028
|
function getSitesSelectComboMySQL2(id_place, tipo_aula) {
|
|
14007
14029
|
var query = "select s.id, concat(p.name, ' - ', sd.name, ' - ', s.mark) as Descrizione from sites s ";
|
|
14008
|
-
query += "join site_destinations sd on sd.id_site = s.id ";
|
|
14030
|
+
query += "join site_destinations sd on sd.id_site = s.id and sd.id_place = s.id_place ";
|
|
14009
14031
|
query += "join places p on p.mark = s.id_place ";
|
|
14010
14032
|
query += "where CURDATE() >= sd.date_start and CURDATE() <= sd.date_end ";
|
|
14011
14033
|
if (id_place || tipo_aula) {
|
|
@@ -17679,6 +17701,9 @@ module.exports = {
|
|
|
17679
17701
|
getDocentiCombo,
|
|
17680
17702
|
getDocenteById,
|
|
17681
17703
|
//
|
|
17704
|
+
getAlunniCombo,
|
|
17705
|
+
getAlunnoById,
|
|
17706
|
+
//
|
|
17682
17707
|
getDeviceConfigurations,
|
|
17683
17708
|
getLastDeviceConfiguration,
|
|
17684
17709
|
getDeviceConfigurationById,
|