alsmanager_lib 3.0.193 → 3.0.195
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 +89 -1
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -8176,8 +8176,22 @@ CREATE TABLE "piano_interventi" (
|
|
|
8176
8176
|
PRIMARY KEY("id" AUTOINCREMENT)
|
|
8177
8177
|
)
|
|
8178
8178
|
*/
|
|
8179
|
-
function selectPianificazioni() {
|
|
8179
|
+
function selectPianificazioni(filter_date_start, filter_date_end) {
|
|
8180
|
+
var dt_start = convertDateToStringDB(filter_date_start);
|
|
8181
|
+
var dt_end = convertDateToStringDB(filter_date_end);
|
|
8182
|
+
|
|
8180
8183
|
var query = "select id, frequenza, date_start, date_max_end, descrizione, id_assegnazione from piano_interventi ";
|
|
8184
|
+
var where_clause = "";
|
|
8185
|
+
if (dt_start != "") {
|
|
8186
|
+
where_clause += "date_start >= '" + dt_start + "' ";
|
|
8187
|
+
}
|
|
8188
|
+
if (dt_end != "") {
|
|
8189
|
+
if (where_clause != "") {
|
|
8190
|
+
where_clause += " and ";
|
|
8191
|
+
}
|
|
8192
|
+
where_clause += "date_max_end <= '" + dt_end + "' ";
|
|
8193
|
+
}
|
|
8194
|
+
query += where_clause;
|
|
8181
8195
|
query += "order by date_start, date_max_end desc";
|
|
8182
8196
|
return query;
|
|
8183
8197
|
}
|
|
@@ -8216,11 +8230,76 @@ function removePianificazione(id_pianificazione) {
|
|
|
8216
8230
|
return query;
|
|
8217
8231
|
}
|
|
8218
8232
|
|
|
8233
|
+
function getFrequenzaTypes() {
|
|
8234
|
+
var query = "select id, name from frequenza_type order by id"
|
|
8235
|
+
return query;
|
|
8236
|
+
}
|
|
8219
8237
|
|
|
8220
8238
|
//End manage pianificazioni
|
|
8239
|
+
//Manage Tips & Tricks
|
|
8240
|
+
/*
|
|
8241
|
+
CREATE TABLE "tips_tricks" (
|
|
8242
|
+
"id" INTEGER NOT NULL UNIQUE,
|
|
8243
|
+
"date_discovery" TEXT,
|
|
8244
|
+
"tags" TEXT,
|
|
8245
|
+
"problem" TEXT,
|
|
8246
|
+
"solution" TEXT,
|
|
8247
|
+
PRIMARY KEY("id" AUTOINCREMENT)
|
|
8248
|
+
)
|
|
8221
8249
|
|
|
8250
|
+
CREATE TABLE "tipstricks_steps" (
|
|
8251
|
+
"id" INTEGER NOT NULL UNIQUE,
|
|
8252
|
+
"id_tip" INTEGER,
|
|
8253
|
+
"description" TEXT,
|
|
8254
|
+
"resource" TEXT,
|
|
8255
|
+
PRIMARY KEY("id" AUTOINCREMENT)
|
|
8256
|
+
)
|
|
8222
8257
|
|
|
8258
|
+
CREATE TABLE "tipstricks_interventi" (
|
|
8259
|
+
"id_tipstricks" INTEGER,
|
|
8260
|
+
"id_intervento" INTEGER
|
|
8261
|
+
)
|
|
8262
|
+
*/
|
|
8263
|
+
function selectTipsTricks() {
|
|
8264
|
+
var query = "select id, date_discovery, tags, problem from tips_tricks ";
|
|
8265
|
+
query += "order by date_discovery"
|
|
8266
|
+
return query;
|
|
8267
|
+
}
|
|
8223
8268
|
|
|
8269
|
+
function selectTipsTricksById(id_tipstricks) {
|
|
8270
|
+
var query = "select id, date_discovery, tags, problem from tips_tricks ";
|
|
8271
|
+
query += "where id_tip = " + id_tipstricks;
|
|
8272
|
+
return query;
|
|
8273
|
+
}
|
|
8274
|
+
|
|
8275
|
+
function selectTipsTricksSteps(id_tipstricks) {
|
|
8276
|
+
var query = "select id, description, resource from tipstricks_steps ";
|
|
8277
|
+
query += "where id_tip = " + id_tipstricks;
|
|
8278
|
+
return query;
|
|
8279
|
+
}
|
|
8280
|
+
|
|
8281
|
+
function selectInterventiByIdTipsTricks(id_tipstricks) {
|
|
8282
|
+
var query = "select int.id, int.data_inizio as Inizio, int.data_fine as Fine, int.description as Descrizione from interventi int ";
|
|
8283
|
+
query += "join tipstricks_interventi tpi on tpi.id_intervento = int.id ";
|
|
8284
|
+
query += "where tpi.id_tip = " + id_tipstricks;
|
|
8285
|
+
return query;
|
|
8286
|
+
}
|
|
8287
|
+
|
|
8288
|
+
function writeTipsTricksOfIntervento(id_intervento, id_tipstricks) {
|
|
8289
|
+
var query = "insert into tipstricks_interventi (id_tip, id_intervento) values ";
|
|
8290
|
+
query += "(" + id_tipstricks + ", " + id_intervento +")";
|
|
8291
|
+
return query;
|
|
8292
|
+
}
|
|
8293
|
+
|
|
8294
|
+
function deleteTipsTricksOfIntervento(id_intervento, id_tipstricks) {
|
|
8295
|
+
var query = "delete from tipstricks_interventi ";
|
|
8296
|
+
query += "where id_tip = " + id_tipstricks + " and id_intervento = " + id_intervento;
|
|
8297
|
+
return query;
|
|
8298
|
+
}
|
|
8299
|
+
|
|
8300
|
+
|
|
8301
|
+
|
|
8302
|
+
//End Manage Tips & Tricks
|
|
8224
8303
|
//
|
|
8225
8304
|
function selectInterventiSQLite(data_da, data_a) {
|
|
8226
8305
|
var query = "select id, data_inizio as Inizio, data_fine as Fine, description as Descrizione from interventi ";
|
|
@@ -16602,6 +16681,15 @@ module.exports = {
|
|
|
16602
16681
|
updatePianificazione,
|
|
16603
16682
|
removePianificazione,
|
|
16604
16683
|
//
|
|
16684
|
+
getFrequenzaTypes,
|
|
16685
|
+
//
|
|
16686
|
+
selectTipsTricks,
|
|
16687
|
+
selectTipsTricksById,
|
|
16688
|
+
selectTipsTricksSteps,
|
|
16689
|
+
selectInterventiByIdTipsTricks,
|
|
16690
|
+
writeTipsTricksOfIntervento,
|
|
16691
|
+
deleteTipsTricksOfIntervento,
|
|
16692
|
+
//
|
|
16605
16693
|
selectInterventi,
|
|
16606
16694
|
queryInterventoById,
|
|
16607
16695
|
insertIntervento,
|