@fluxhub/fluxhub-lib 10.0.721 → 10.0.723

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.
@@ -24975,25 +24975,83 @@ class dati_aggiuntivi_v2 {
24975
24975
  this.update_status(true, this.respingi_enabled, this.in_carico, this.b_assengna_a, 18);
24976
24976
  }
24977
24977
  if (result.op == 'A') {
24978
- this.sendEMail_ex(this.user_idp, arr_new_arr, this.app_info.descrizione_breve +
24978
+ let oggetto_email = this.app_info.descrizione_breve +
24979
24979
  ", Ti è stato assegnato il documento numero: " +
24980
24980
  this.m_obj.codice +
24981
24981
  " " +
24982
24982
  this.getTitle() +
24983
24983
  " - " +
24984
- this.getLvlDescri(String(this.m_liv), this.m_statox), "<br>Attività:" +
24984
+ this.getLvlDescri(String(this.m_liv), this.m_statox);
24985
+ let body_email = "<br>Attività:" +
24985
24986
  this.getLvlDescri(String(this.m_liv), this.m_statox) +
24986
24987
  "<br>" +
24987
24988
  this.m_statox +
24988
24989
  "<br>" +
24989
- this.getDescri(), this.id_applicativo, this.id_documento, this.app_info.COMPANY_SITE_ROOT +
24990
+ this.getDescri();
24991
+ if (this.app_info.subject_riassegna != null)
24992
+ if (this.app_info.subject_riassegna != "")
24993
+ oggetto_email = this.app_info.subject_riassegna;
24994
+ if (this.app_info.body_riassegna != null)
24995
+ if (this.app_info.body_riassegna != "")
24996
+ body_email = this.app_info.body_riassegna;
24997
+ console.log('this.app_info.subject_riassegna ', this.app_info.subject_riassegna);
24998
+ /* for (let prop in this.m_obj)
24999
+ if (this.m_obj[prop] != null) {
25000
+
25001
+ if (
25002
+ Object.prototype.toString.call(this.m_obj[prop]) ===
25003
+ "[object Date]"
25004
+ ) {
25005
+ oggetto_email = oggetto_email
25006
+ .split("{{" + prop + "}}")
25007
+ .join(this.uti_s.date2String(this.m_obj[prop]));
25008
+ } else if (
25009
+ ("" + this.m_obj[prop]).indexOf("T00:00:00") == -1
25010
+ )
25011
+ oggetto_email = oggetto_email
25012
+ .split("{{" + prop + "}}")
25013
+ .join(this.m_obj[prop]);
25014
+ else
25015
+ oggetto_email = oggetto_email
25016
+ .split("{{" + prop + "}}")
25017
+ .join(
25018
+ this.uti_s.date2String(
25019
+ this.uti_s.string2date(this.m_obj[prop], 2)
25020
+ )
25021
+ );
25022
+
25023
+
25024
+
25025
+ if (
25026
+ Object.prototype.toString.call(this.m_obj[prop]) ===
25027
+ "[object Date]"
25028
+ ) {
25029
+ body_email = body_email
25030
+ .split("{{" + prop + "}}")
25031
+ .join(this.uti_s.date2String(this.m_obj[prop]));
25032
+ } else if (
25033
+ ("" + this.m_obj[prop]).indexOf("T00:00:00") == -1
25034
+ )
25035
+ body_email = body_email
25036
+ .split("{{" + prop + "}}")
25037
+ .join(this.m_obj[prop]);
25038
+ else
25039
+ body_email = body_email
25040
+ .split("{{" + prop + "}}")
25041
+ .join(
25042
+ this.uti_s.date2String(
25043
+ this.uti_s.string2date(this.m_obj[prop], 2)
25044
+ )
25045
+ );
25046
+ }*/
25047
+ this.sendEMail_ex(this.user_idp, arr_new_arr, oggetto_email, body_email, this.id_applicativo, this.id_documento, this.app_info.COMPANY_SITE_ROOT +
24990
25048
  "#/" +
24991
25049
  this.app_info.modulo_swf +
24992
25050
  "/" +
24993
25051
  this.id_applicativo +
24994
25052
  "/" +
24995
25053
  this.id_documento +
24996
- "/edit", this.m_obj.codice, "", true, "", false);
25054
+ "/edit", this.m_obj.codice, "", true, "", false, '');
24997
25055
  }
24998
25056
  /* else
24999
25057
  this.sendEMail_ex(
@@ -25145,48 +25203,35 @@ class dati_aggiuntivi_v2 {
25145
25203
  });
25146
25204
  }
25147
25205
  }
25148
- sendEMail_ex(mit, to, ogg, descri, idapp, iddoc, link, cc, nota, notif_av = true, ical = "", b_exit = true) {
25149
- console.log('this.email_bloccate ', this.email_bloccate);
25150
- if (to == null) {
25151
- if (b_exit)
25152
- this.goto_edit_doc(notif_av);
25153
- return;
25154
- }
25155
- if (to == '') {
25156
- if (b_exit)
25157
- this.goto_edit_doc(notif_av);
25158
- return;
25159
- }
25160
- if (this.email_bloccate) {
25161
- if (b_exit)
25162
- this.goto_edit_doc(notif_av);
25163
- return;
25164
- }
25206
+ sendEMail_ex(mit, to, ogg, descri, idapp, iddoc, link, cc, nota, notif_av = true, ical = "", b_exit = true, commento = "") {
25207
+ let dev_mode = false;
25208
+ if (this.app_s.dev_mode != null)
25209
+ if (this.app_s.dev_mode == "1")
25210
+ dev_mode = true;
25211
+ let obj_r = {
25212
+ destinatari: to.split(','),
25213
+ commento: commento,
25214
+ id_applicazione: idapp,
25215
+ id_documento: iddoc,
25216
+ username: mit,
25217
+ e_subject: ogg,
25218
+ e_body: descri,
25219
+ dev_mode: dev_mode ? 1 : 0,
25220
+ };
25221
+ let fs = new FSInput();
25222
+ fs.command = "exec_app";
25223
+ fs.p1 = 'send_email';
25224
+ let uiid_op = this.uti_s.newGuid();
25225
+ fs.p2 = uiid_op;
25165
25226
  let p = new QParam();
25166
- p.sql = "send_wkf_mail";
25167
- //non notifico l'autore della approvazione
25168
- to = to.split(mit + ",").join("");
25169
- to = to.split("," + mit).join("");
25170
- //fine non notifico l'autore della approvazione
25171
- if (ical == null)
25172
- ical = "";
25173
- if (ical != "")
25174
- ical = JSON.stringify(ical);
25175
- p.values = [
25176
- mit,
25177
- to,
25178
- ogg,
25179
- descri.split("\n").join("<br>"),
25180
- idapp,
25181
- iddoc,
25182
- link,
25183
- cc,
25184
- nota,
25185
- ical,
25186
- ];
25187
- this.m_wkf.doQuery(p).subscribe((data) => {
25188
- if (b_exit)
25189
- this.goto_edit_doc(notif_av);
25227
+ p.sql = "INSERT_WKF_OP";
25228
+ p.values = [uiid_op, JSON.stringify(obj_r)];
25229
+ p.types = ['string', 'string'];
25230
+ this.m_dataService.doQuery(p).subscribe((data) => {
25231
+ this.m_fileservice.doQuery(fs).subscribe((data) => {
25232
+ if (b_exit)
25233
+ this.goto_edit_doc(notif_av);
25234
+ });
25190
25235
  });
25191
25236
  }
25192
25237
  goto_edit_doc(b_notif_av = true) {
@@ -25702,6 +25747,7 @@ class dati_aggiuntivi_v2 {
25702
25747
  let s = "";
25703
25748
  let s_notif = "";
25704
25749
  let oggetto_email = "";
25750
+ let body_email = "";
25705
25751
  let s_auto = "";
25706
25752
  let descris = "";
25707
25753
  for (let i = 0; i < this.livs.length; i++) {
@@ -25723,9 +25769,6 @@ class dati_aggiuntivi_v2 {
25723
25769
  s_auto = s_auto + ",";
25724
25770
  s_auto = s_auto + this.livs[i].nc;
25725
25771
  descris = this.livs[i].descri_livello;
25726
- if (this.livs[i].oggetto_email != null)
25727
- if (this.livs[i].oggetto_email != "")
25728
- oggetto_email = this.livs[i].oggetto_email;
25729
25772
  }
25730
25773
  }
25731
25774
  if (s == "") {
@@ -25825,69 +25868,87 @@ class dati_aggiuntivi_v2 {
25825
25868
  "" + lvlb,
25826
25869
  ];
25827
25870
  this.insert_wkf_variabile(this.id_applicativo, this.id_documento, this.m_obj.stato + "_PLAYER", this.user_idp);
25828
- let ok_op = false;
25829
25871
  this.m_wkf.doQuery(p).subscribe((data) => {
25830
- let ok_op = false;
25831
25872
  if (data != null)
25832
25873
  if (data.result_msg == "OK") {
25833
25874
  if (b_send_email && s_notif != "") {
25834
- let s_ogg = oggetto_email;
25835
- for (let prop in this.m_obj)
25836
- if (this.m_obj[prop] != null) {
25837
- console.log(prop +
25838
- " " +
25839
- Object.prototype.toString.call(this.m_obj[prop]));
25840
- if (Object.prototype.toString.call(this.m_obj[prop]) ===
25841
- "[object Date]") {
25842
- s_ogg = s_ogg
25843
- .split("%" + prop + "%")
25844
- .join(this.uti_s.date2String(this.m_obj[prop]));
25845
- }
25846
- else if (("" + this.m_obj[prop]).indexOf("T00:00:00") == -1)
25847
- s_ogg = s_ogg
25848
- .split("%" + prop + "%")
25849
- .join(this.m_obj[prop]);
25850
- else
25851
- s_ogg = s_ogg
25852
- .split("%" + prop + "%")
25853
- .join(this.uti_s.date2String(this.uti_s.string2date(this.m_obj[prop], 2)));
25854
- }
25855
- if (s_ogg == "")
25856
- this.sendEMail_ex(this.user_idp, s_notif, this.app_info.descrizione_breve +
25857
- ", Ti è stato assegnato il documento numero: " +
25858
- this.m_obj.codice +
25859
- " " +
25860
- this.getTitle() +
25861
- " - " +
25862
- this.getLvlDescri(String(this.m_liv), this.m_statox), "<br>Attività:" +
25863
- this.getLvlDescri(String(this.m_liv), this.m_statox) +
25864
- "<br>" +
25865
- this.m_statox +
25866
- "<br>" +
25867
- this.getDescri(), this.id_applicativo, this.id_documento, this.app_s.COMPANY_SITE_ROOT +
25868
- "#/" +
25869
- this.app_info.modulo_swf +
25870
- "/" +
25871
- this.id_applicativo +
25872
- "/" +
25873
- this.id_documento +
25874
- "/edit", this.m_obj.codice, "", true, "");
25875
- else
25876
- this.sendEMail_ex(this.user_idp, s_notif, s_ogg +
25877
- " - " +
25878
- this.getLvlDescri(String(this.m_liv), this.m_statox), "<br>Attività:" +
25879
- this.getLvlDescri(String(this.m_liv), this.m_statox) +
25880
- "<br>" +
25881
- this.m_statox +
25882
- "<br>" +
25883
- this.getDescri(), this.id_applicativo, this.id_documento, this.app_s.COMPANY_SITE_ROOT +
25884
- "#/" +
25885
- this.app_info.modulo_swf +
25886
- "/" +
25887
- this.id_applicativo +
25888
- "/" +
25889
- this.id_documento +
25890
- "/edit", this.m_obj.codice, "", true, "");
25875
+ oggetto_email = this.app_info.descrizione_breve +
25876
+ ", Ti è stato assegnato il documento numero: " +
25877
+ this.m_obj.codice +
25878
+ " " +
25879
+ this.getTitle() +
25880
+ " - " +
25881
+ this.getLvlDescri(String(this.m_liv), this.m_statox);
25882
+ body_email = "<br>Attività:" +
25883
+ this.getLvlDescri(String(this.m_liv), this.m_statox) +
25884
+ "<br>" +
25885
+ this.m_statox +
25886
+ "<br>" +
25887
+ this.getDescri();
25888
+ if (this.app_info.subject_riassegna != null)
25889
+ if (this.app_info.subject_riassegna != "")
25890
+ oggetto_email = this.app_info.subject_riassegna;
25891
+ if (this.app_info.body_riassegna != null)
25892
+ if (this.app_info.body_riassegna != "")
25893
+ body_email = this.app_info.body_riassegna;
25894
+ /*
25895
+ for (let prop in this.m_obj)
25896
+ if (this.m_obj[prop] != null) {
25897
+
25898
+ if (
25899
+ Object.prototype.toString.call(this.m_obj[prop]) ===
25900
+ "[object Date]"
25901
+ ) {
25902
+ oggetto_email = oggetto_email
25903
+ .split("{{" + prop + "}}")
25904
+ .join(this.uti_s.date2String(this.m_obj[prop]));
25905
+ } else if (
25906
+ ("" + this.m_obj[prop]).indexOf("T00:00:00") == -1
25907
+ )
25908
+ oggetto_email = oggetto_email
25909
+ .split("{{" + prop + "}}")
25910
+ .join(this.m_obj[prop]);
25911
+ else
25912
+ oggetto_email = oggetto_email
25913
+ .split("{{" + prop + "}}")
25914
+ .join(
25915
+ this.uti_s.date2String(
25916
+ this.uti_s.string2date(this.m_obj[prop], 2)
25917
+ )
25918
+ );
25919
+
25920
+
25921
+
25922
+ if (
25923
+ Object.prototype.toString.call(this.m_obj[prop]) ===
25924
+ "[object Date]"
25925
+ ) {
25926
+ body_email = body_email
25927
+ .split("{{" + prop + "}}")
25928
+ .join(this.uti_s.date2String(this.m_obj[prop]));
25929
+ } else if (
25930
+ ("" + this.m_obj[prop]).indexOf("T00:00:00") == -1
25931
+ )
25932
+ body_email = body_email
25933
+ .split("{{" + prop + "}}")
25934
+ .join(this.m_obj[prop]);
25935
+ else
25936
+ body_email = body_email
25937
+ .split("{{" + prop + "}}")
25938
+ .join(
25939
+ this.uti_s.date2String(
25940
+ this.uti_s.string2date(this.m_obj[prop], 2)
25941
+ )
25942
+ );
25943
+ }*/
25944
+ this.sendEMail_ex(this.user_idp, s_notif, oggetto_email, body_email, this.id_applicativo, this.id_documento, this.app_s.COMPANY_SITE_ROOT +
25945
+ "#/" +
25946
+ this.app_info.modulo_swf +
25947
+ "/" +
25948
+ this.id_applicativo +
25949
+ "/" +
25950
+ this.id_documento +
25951
+ "/edit", this.m_obj.codice, "", true, "", true, '');
25891
25952
  }
25892
25953
  else
25893
25954
  this.goto_edit_doc();