@fluxhub/fluxhub-lib 10.0.723 → 10.0.725

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.
@@ -21896,7 +21896,7 @@
21896
21896
  };
21897
21897
 
21898
21898
  var wkfapp_v2 = /** @class */ (function () {
21899
- function wkfapp_v2(app_s, m_service, m_dataService, m_router, _toastr, dialog, m_wkf, m_uti, tsr) {
21899
+ function wkfapp_v2(app_s, m_service, m_dataService, m_router, _toastr, dialog, m_wkf, m_uti, tsr, m_fileservice) {
21900
21900
  this.app_s = app_s;
21901
21901
  this.m_service = m_service;
21902
21902
  this.m_dataService = m_dataService;
@@ -21906,6 +21906,7 @@
21906
21906
  this.m_wkf = m_wkf;
21907
21907
  this.m_uti = m_uti;
21908
21908
  this.tsr = tsr;
21909
+ this.m_fileservice = m_fileservice;
21909
21910
  this.b_editing = false;
21910
21911
  this.is_Supervisor = false;
21911
21912
  this.is_Visor = false;
@@ -21930,6 +21931,7 @@
21930
21931
  this.is_init = false;
21931
21932
  this.imp = "";
21932
21933
  this.m_cod_documento = "";
21934
+ this.app_info = {};
21933
21935
  this.sort_field = "";
21934
21936
  if (!m_service.checkCredentials()) {
21935
21937
  return;
@@ -21964,6 +21966,118 @@
21964
21966
  if (o.cmd == "reclama_bozza")
21965
21967
  this.reclama_bozza();
21966
21968
  };
21969
+ wkfapp_v2.prototype.riassegna_a = function (o) {
21970
+ var _this = this;
21971
+ var p = new QParam();
21972
+ p.sql = "SELECT_DOCUMENTS_BY_UIID";
21973
+ p.types = ["string", "string"];
21974
+ p.values = [this.id_applicativo, this.get_grid().sRow.uiid];
21975
+ this.m_dataService.doQuery(p).subscribe(function (data) {
21976
+ o = data.result_data[0];
21977
+ var arx = o.assegnati_paralleli.split(',');
21978
+ var arrAutori = [];
21979
+ for (var x = 0; x < arx.length; x++)
21980
+ for (var y = 0; y < _this.livs.length; y++) {
21981
+ if (arx[x] == _this.livs[y].username) {
21982
+ arrAutori.push({ username: arx[x], nc: _this.livs[y].nc });
21983
+ break;
21984
+ }
21985
+ }
21986
+ // console.log('arrAutori ',arrAutori);
21987
+ arrAutori = arrAutori.sort(function (n1, n2) {
21988
+ if (n1.nc > n2.nc) {
21989
+ return 1;
21990
+ }
21991
+ if (n1.nc < n2.nc) {
21992
+ return -1;
21993
+ }
21994
+ return 0;
21995
+ });
21996
+ var dialogRef = _this.dialog.open(win_assegna_a, { 'disableClose': true, width: '800px', data: {
21997
+ title: _this.tsr.instant('Conferma Assegnazione'),
21998
+ lbl: '',
21999
+ commento_default: '',
22000
+ comm_notrequired: '',
22001
+ utenti: arrAutori,
22002
+ prendi_in_carico: false
22003
+ } });
22004
+ dialogRef.afterClosed().subscribe(function (result) {
22005
+ if (result) {
22006
+ if (result.arrsel.length == 0) {
22007
+ _this._toastr.error("Impossibile riassegnare");
22008
+ return;
22009
+ }
22010
+ // console.log(' result.arrsel ', result.arrsel);
22011
+ var arr_new_arr_1 = '';
22012
+ o.autori = '';
22013
+ o.pers_int = '';
22014
+ var b_edit_1 = false;
22015
+ result.arrsel.map(function (v) {
22016
+ if (arr_new_arr_1 != '')
22017
+ arr_new_arr_1 += ',';
22018
+ arr_new_arr_1 += v.username;
22019
+ if (o.autori.indexOf(v.username) == -1) {
22020
+ console.log('VVV ', v);
22021
+ if (o.autori != '')
22022
+ o.autori = o.autori + ',';
22023
+ o.autori = o.autori + v.username;
22024
+ if (o.pers_int != '')
22025
+ o.pers_int = o.pers_int + ',';
22026
+ o.pers_int = o.pers_int + v.nc;
22027
+ }
22028
+ if (v.username == _this.app_info.user)
22029
+ b_edit_1 = true;
22030
+ });
22031
+ var in_carico = false;
22032
+ if (o.autori != null)
22033
+ if (o.autori.split(',').length != 1)
22034
+ in_carico = true;
22035
+ console.log(o.autori, in_carico);
22036
+ var b_assengna_a = false;
22037
+ if (o.assegnati_paralleli != null)
22038
+ if (o.assegnati_paralleli.split(',').length != 1)
22039
+ if (o.assegnati_paralleli.indexOf(_this.app_s.user) > -1)
22040
+ b_assengna_a = true;
22041
+ // console.log('this.m_obj.autori ',this.m_obj.autori, this.in_carico, this.b_assengna_a);
22042
+ var p_1 = new QParam();
22043
+ p_1.sql = "UPDATE_WKF_DOC_AUTHOR";
22044
+ p_1.values = [_this.id_applicativo, o.id_documento, o.autori, o.pers_int];
22045
+ p_1.types = ["string", "string", "string", "string"];
22046
+ _this.m_dataService.doQuery(p_1).subscribe(function (data) {
22047
+ if (data != null)
22048
+ if (data.result_msg == "OK") {
22049
+ _this.m_dataService.doQuery({ sql: 'INSERT_WORKFLOW_LOG',
22050
+ values: [_this.id_applicativo, _this.user_idp, 'DOCUMENTO RIASSEGNATO', 'DOCUMENTO RIASSEGNATO A: ' + arr_new_arr_1, o.uiid],
22051
+ types: ['string', 'string', 'string', 'string', 'string'], names: [] }).subscribe(function (data) {
22052
+ });
22053
+ if (result.op == 'A') {
22054
+ var body_email = '';
22055
+ var oggetto_email = _this.app_info.descrizione_breve +
22056
+ ", Ti è stato assegnato il documento numero: " +
22057
+ o.codice;
22058
+ if (_this.app_info.subject_riassegna != null)
22059
+ if (_this.app_info.subject_riassegna != "")
22060
+ oggetto_email = _this.app_info.subject_riassegna;
22061
+ if (_this.app_info.body_riassegna != null)
22062
+ if (_this.app_info.body_riassegna != "")
22063
+ body_email = _this.app_info.body_riassegna;
22064
+ oggetto_email = oggetto_email.split('{{TRANSITION_DESCRI}}').join(o.stat_stato);
22065
+ body_email = body_email.split('{{TRANSITION_DESCRI}}').join(o.stat_stato);
22066
+ _this.sendEMail_ex(_this.user_idp, arr_new_arr_1, oggetto_email, body_email, _this.id_applicativo, o.uiid, _this.app_info.COMPANY_SITE_ROOT +
22067
+ "#/" +
22068
+ _this.app_info.modulo_swf +
22069
+ "/" +
22070
+ _this.id_applicativo +
22071
+ "/" +
22072
+ o.uiid +
22073
+ "/edit", o.codice, "", true, "", false, '');
22074
+ }
22075
+ }
22076
+ });
22077
+ }
22078
+ });
22079
+ });
22080
+ };
21967
22081
  wkfapp_v2.prototype.annulla_richiesta = function () {
21968
22082
  var _this = this;
21969
22083
  if (this.get_grid().sRow == null) {
@@ -22014,17 +22128,17 @@
22014
22128
  });
22015
22129
  dialogRef.afterClosed().subscribe(function (result) {
22016
22130
  if (result) {
22017
- var p_1 = new QParam();
22018
- p_1.sql = "SELECT_DOCUMENTS_BY_UIID";
22019
- p_1.types = ["string", "string"];
22020
- p_1.values = [_this.id_applicativo, _this.get_grid().sRow.uiid];
22021
- _this.m_dataService.doQuery(p_1).subscribe(function (data) {
22131
+ var p_2 = new QParam();
22132
+ p_2.sql = "SELECT_DOCUMENTS_BY_UIID";
22133
+ p_2.types = ["string", "string"];
22134
+ p_2.values = [_this.id_applicativo, _this.get_grid().sRow.uiid];
22135
+ _this.m_dataService.doQuery(p_2).subscribe(function (data) {
22022
22136
  var stato_doc = data.result_data[0].stato;
22023
- p_1 = new QParam();
22024
- p_1.sql = "SELECT_WKF2_SELECT_USER_MIN";
22025
- p_1.types = ["string", "string"];
22026
- p_1.values = [_this.id_applicativo, _this.get_grid().sRow.uiid];
22027
- _this.m_dataService.doQuery(p_1).subscribe(function (data) {
22137
+ p_2 = new QParam();
22138
+ p_2.sql = "SELECT_WKF2_SELECT_USER_MIN";
22139
+ p_2.types = ["string", "string"];
22140
+ p_2.values = [_this.id_applicativo, _this.get_grid().sRow.uiid];
22141
+ _this.m_dataService.doQuery(p_2).subscribe(function (data) {
22028
22142
  var b_found = false;
22029
22143
  var livello = 0;
22030
22144
  var descri_livello = '';
@@ -22042,11 +22156,11 @@
22042
22156
  _this._toastr.error(_this.tsr.instant('Il documento non è in stato Bozza'));
22043
22157
  return;
22044
22158
  }
22045
- var p_2 = new QParam();
22046
- p_2.sql = "UPDATE_WKF_STATO_BOZZA";
22047
- p_2.types = ["string", "string", "int", 'string'];
22048
- p_2.values = [_this.id_applicativo, _this.get_grid().sRow.uiid, livello, descri_livello];
22049
- _this.m_dataService.doQuery(p_2).subscribe(function (data) {
22159
+ var p_3 = new QParam();
22160
+ p_3.sql = "UPDATE_WKF_STATO_BOZZA";
22161
+ p_3.types = ["string", "string", "int", 'string'];
22162
+ p_3.values = [_this.id_applicativo, _this.get_grid().sRow.uiid, livello, descri_livello];
22163
+ _this.m_dataService.doQuery(p_3).subscribe(function (data) {
22050
22164
  if (data != null)
22051
22165
  if (data.result_msg == "OK") {
22052
22166
  _this._toastr.info(_this.tsr.instant('Documento aggiornato'));
@@ -22092,16 +22206,16 @@
22092
22206
  if (result != null)
22093
22207
  if (result.result != null)
22094
22208
  if (result.result == "ok") {
22095
- var p_3 = new QParam();
22096
- p_3.sql = "UPDATE_USER_WORKFLOW";
22097
- p_3.types = ["string", "string", "string", "string"];
22098
- p_3.values = [
22209
+ var p_4 = new QParam();
22210
+ p_4.sql = "UPDATE_USER_WORKFLOW";
22211
+ p_4.types = ["string", "string", "string", "string"];
22212
+ p_4.values = [
22099
22213
  _this.id_applicativo,
22100
22214
  _this.get_grid().sRow.uiid,
22101
22215
  result.u1,
22102
22216
  result.u2,
22103
22217
  ];
22104
- _this.m_dataService.doQuery(p_3).subscribe(function (data) {
22218
+ _this.m_dataService.doQuery(p_4).subscribe(function (data) {
22105
22219
  if (data != null)
22106
22220
  if (data.result_msg == "OK") {
22107
22221
  _this._toastr.info(_this.tsr.instant("Workflow Aggiornato"));
@@ -22342,13 +22456,23 @@
22342
22456
  a_aut = a_aut + this.wax[i].username;
22343
22457
  }
22344
22458
  rxjs.forkJoin(op).subscribe(function (result) { });
22345
- this.sendEMail_ex(this.user_idp, a_datanot, this.titolo_email +
22459
+ var oggetto_email = this.titolo_email +
22346
22460
  this.tsr.instant("L'utente ") +
22347
22461
  this.user_cognome +
22348
22462
  " " +
22349
22463
  this.user_nome +
22350
22464
  this.tsr.instant(" ti ha riassegnato il documento: ") +
22351
- this.get_grid().sRow.codice, "Commento:\n\n" + this.nota_wax, this.id_applicativo, this.get_grid().sRow.uiid, this.app_s.COMPANY_SITE_ROOT +
22465
+ this.get_grid().sRow.codice;
22466
+ var body_email = "Commento:\n\n" + this.nota_wax;
22467
+ if (this.app_info.subject_riassegna != null)
22468
+ if (this.app_info.subject_riassegna != "")
22469
+ oggetto_email = this.app_info.subject_riassegna;
22470
+ if (this.app_info.body_riassegna != null)
22471
+ if (this.app_info.body_riassegna != "")
22472
+ body_email = this.app_info.body_riassegna;
22473
+ oggetto_email = oggetto_email.split('{{TRANSITION_DESCRI}}').join(this.os_r.description);
22474
+ body_email = body_email.split('{{TRANSITION_DESCRI}}').join(this.os_r.description);
22475
+ this.sendEMail_ex(this.user_idp, a_datanot, oggetto_email, body_email, this.id_applicativo, this.get_grid().sRow.uiid, this.app_s.COMPANY_SITE_ROOT +
22352
22476
  "#/" +
22353
22477
  this.app_root +
22354
22478
  "/" +
@@ -22455,27 +22579,39 @@
22455
22579
  });
22456
22580
  }
22457
22581
  };
22458
- wkfapp_v2.prototype.sendEMail_ex = function (mit, to, ogg, descri, idapp, iddoc, link, cc, nota, ical) {
22582
+ wkfapp_v2.prototype.sendEMail_ex = function (mit, to, ogg, descri, idapp, iddoc, link, cc, nota, notif_av, ical, b_exit, commento) {
22583
+ var _this = this;
22584
+ if (notif_av === void 0) { notif_av = true; }
22459
22585
  if (ical === void 0) { ical = ""; }
22460
- if (to == null)
22461
- return;
22462
- if (to == '')
22463
- return;
22586
+ if (b_exit === void 0) { b_exit = true; }
22587
+ if (commento === void 0) { commento = ""; }
22588
+ var dev_mode = false;
22589
+ if (this.app_s.dev_mode != null)
22590
+ if (this.app_s.dev_mode == "1")
22591
+ dev_mode = true;
22592
+ var obj_r = {
22593
+ destinatari: to.split(','),
22594
+ commento: commento,
22595
+ id_applicazione: idapp,
22596
+ id_documento: iddoc,
22597
+ username: mit,
22598
+ e_subject: ogg,
22599
+ e_body: descri,
22600
+ dev_mode: dev_mode ? 1 : 0,
22601
+ };
22602
+ var fs = new FSInput();
22603
+ fs.command = "exec_app";
22604
+ fs.p1 = 'send_email';
22605
+ var uiid_op = this.m_uti.newGuid();
22606
+ fs.p2 = uiid_op;
22464
22607
  var p = new QParam();
22465
- p.sql = "send_wkf_mail";
22466
- p.values = [
22467
- mit,
22468
- to,
22469
- ogg,
22470
- descri.split("\n").join("<br>"),
22471
- idapp,
22472
- iddoc,
22473
- link,
22474
- cc,
22475
- nota,
22476
- ical,
22477
- ];
22478
- this.m_wkf.doQuery(p).subscribe(function (data) { });
22608
+ p.sql = "INSERT_WKF_OP";
22609
+ p.values = [uiid_op, JSON.stringify(obj_r)];
22610
+ p.types = ['string', 'string'];
22611
+ this.m_dataService.doQuery(p).subscribe(function (data) {
22612
+ _this.m_fileservice.doQuery(fs).subscribe(function (data) {
22613
+ });
22614
+ });
22479
22615
  };
22480
22616
  wkfapp_v2.prototype.annulla_imp = function () {
22481
22617
  var _this = this;
@@ -22527,11 +22663,11 @@
22527
22663
  if (result != null)
22528
22664
  if (result.result != null)
22529
22665
  if (result.result == "ok") {
22530
- var p_4 = new QParam();
22531
- p_4.sql = "SELECT_USER_INFO_WKF";
22532
- p_4.types = ["string"];
22533
- p_4.values = [result.arrsel[0].username];
22534
- _this.m_dataService.doQuery(p_4).subscribe(function (data) {
22666
+ var p_5 = new QParam();
22667
+ p_5.sql = "SELECT_USER_INFO_WKF";
22668
+ p_5.types = ["string"];
22669
+ p_5.values = [result.arrsel[0].username];
22670
+ _this.m_dataService.doQuery(p_5).subscribe(function (data) {
22535
22671
  if (data != null)
22536
22672
  if (data.result_msg == "OK") {
22537
22673
  _this.app_s.user_name_ori = _this.app_s.user_name;
@@ -22551,7 +22687,7 @@
22551
22687
  data.result_data[0].cognome +
22552
22688
  " " +
22553
22689
  data.result_data[0].nome;
22554
- console.log('SETTO LOCALSTORAGE: ', _this.app_s.COMPANY_KEY + '_imp_user', _this.m_uti.encrypt_v3(JSON.stringify(data.result_data[0])));
22690
+ // console.log('SETTO LOCALSTORAGE: ',this.app_s.COMPANY_KEY+'_imp_user',this.m_uti.encrypt_v3(JSON.stringify(data.result_data[0])));
22555
22691
  localStorage.setItem(_this.app_s.COMPANY_KEY + '_imp_user', _this.m_uti.encrypt_v3(JSON.stringify(data.result_data[0])));
22556
22692
  _this.get_grid().doFill("");
22557
22693
  }
@@ -22670,6 +22806,7 @@
22670
22806
  if (data.result_msg == "OK") {
22671
22807
  var a_conf = data.result_data;
22672
22808
  _this.id_applicativo = a_conf[0].id_gruppo;
22809
+ _this.app_info = a_conf[0];
22673
22810
  _this.app_root = a_conf[0].modulo_swf;
22674
22811
  _this.codice_app = a_conf[0].codice_documento; //codice documento
22675
22812
  _this.att_panelcat = a_conf[0].descrizione_breve; //descrizione breve
@@ -22682,11 +22819,11 @@
22682
22819
  _this.user_cognome = _this.app_s.user_surname;
22683
22820
  _this.user_email = _this.app_s.user_email;
22684
22821
  _this.m_uti.set_home_title(_this.tsr.instant(_this.att_panelcat));
22685
- var p_5 = new QParam();
22686
- p_5.sql = "SELECT_UTENTE_WKF_ADMIN";
22687
- p_5.types = ["string", "string"];
22688
- p_5.values = [_this.id_applicativo, _this.app_s.user];
22689
- _this.m_dataService.doQuery(p_5).subscribe(function (data) {
22822
+ var p_6 = new QParam();
22823
+ p_6.sql = "SELECT_UTENTE_WKF_ADMIN";
22824
+ p_6.types = ["string", "string"];
22825
+ p_6.values = [_this.id_applicativo, _this.app_s.user];
22826
+ _this.m_dataService.doQuery(p_6).subscribe(function (data) {
22690
22827
  if (data != null)
22691
22828
  if (data.result_msg == "OK") {
22692
22829
  var a = data.result_data;
@@ -22703,19 +22840,19 @@
22703
22840
  if (a[0].tipo == "2")
22704
22841
  _this.is_PowerUser = true;
22705
22842
  }
22706
- var p_6 = new QParam();
22707
- p_6.sql = "SELECT_WLIVELLIV2_2";
22708
- p_6.types = ["string"];
22709
- p_6.values = [_this.id_applicativo];
22710
- _this.m_dataService.doQuery(p_6).subscribe(function (data) {
22843
+ var p_7 = new QParam();
22844
+ p_7.sql = "SELECT_WLIVELLIV2_2";
22845
+ p_7.types = ["string"];
22846
+ p_7.values = [_this.id_applicativo];
22847
+ _this.m_dataService.doQuery(p_7).subscribe(function (data) {
22711
22848
  if (data != null)
22712
22849
  if (data.result_msg == "OK") {
22713
22850
  _this.ok_conf_s(data.result_data);
22714
- var p_7 = new QParam();
22715
- p_7.sql = "SELECT_ROLES_VISORI";
22716
- p_7.types = ["string"];
22717
- p_7.values = [_this.id_applicativo];
22718
- _this.m_dataService.doQuery(p_7).subscribe(function (data) {
22851
+ var p_8 = new QParam();
22852
+ p_8.sql = "SELECT_ROLES_VISORI";
22853
+ p_8.types = ["string"];
22854
+ p_8.values = [_this.id_applicativo];
22855
+ _this.m_dataService.doQuery(p_8).subscribe(function (data) {
22719
22856
  if (data != null)
22720
22857
  if (data.result_msg == "OK") {
22721
22858
  _this.is_Visor = false;
@@ -22821,7 +22958,8 @@
22821
22958
  { type: dialog.MatDialog },
22822
22959
  { type: WkfService },
22823
22960
  { type: UtilityService },
22824
- { type: core.TranslateService }
22961
+ { type: core.TranslateService },
22962
+ { type: FileService }
22825
22963
  ]; };
22826
22964
 
22827
22965
  var dati_aggiuntivi_v2 = /** @class */ (function () {
@@ -23626,7 +23764,8 @@
23626
23764
  if (_this.app_info.body_riassegna != null)
23627
23765
  if (_this.app_info.body_riassegna != "")
23628
23766
  body_email = _this.app_info.body_riassegna;
23629
- console.log('this.app_info.subject_riassegna ', _this.app_info.subject_riassegna);
23767
+ oggetto_email = oggetto_email.split('{{TRANSITION_DESCRI}}').join(_this.getLvlDescri(String(_this.m_liv), _this.m_statox));
23768
+ body_email = body_email.split('{{TRANSITION_DESCRI}}').join(_this.getLvlDescri(String(_this.m_liv), _this.m_statox));
23630
23769
  /* for (let prop in this.m_obj)
23631
23770
  if (this.m_obj[prop] != null) {
23632
23771
 
@@ -24553,6 +24692,8 @@
24553
24692
  if (_this.app_info.body_riassegna != null)
24554
24693
  if (_this.app_info.body_riassegna != "")
24555
24694
  body_email = _this.app_info.body_riassegna;
24695
+ oggetto_email = oggetto_email.split('{{TRANSITION_DESCRI}}').join(_this.getLvlDescri(String(_this.m_liv), _this.m_statox));
24696
+ body_email = body_email.split('{{TRANSITION_DESCRI}}').join(_this.getLvlDescri(String(_this.m_liv), _this.m_statox));
24556
24697
  /*
24557
24698
  for (let prop in this.m_obj)
24558
24699
  if (this.m_obj[prop] != null) {