@fluxhub/fluxhub-lib 10.0.724 → 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.
@@ -21966,6 +21966,118 @@
21966
21966
  if (o.cmd == "reclama_bozza")
21967
21967
  this.reclama_bozza();
21968
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
+ };
21969
22081
  wkfapp_v2.prototype.annulla_richiesta = function () {
21970
22082
  var _this = this;
21971
22083
  if (this.get_grid().sRow == null) {
@@ -22016,17 +22128,17 @@
22016
22128
  });
22017
22129
  dialogRef.afterClosed().subscribe(function (result) {
22018
22130
  if (result) {
22019
- var p_1 = new QParam();
22020
- p_1.sql = "SELECT_DOCUMENTS_BY_UIID";
22021
- p_1.types = ["string", "string"];
22022
- p_1.values = [_this.id_applicativo, _this.get_grid().sRow.uiid];
22023
- _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) {
22024
22136
  var stato_doc = data.result_data[0].stato;
22025
- p_1 = new QParam();
22026
- p_1.sql = "SELECT_WKF2_SELECT_USER_MIN";
22027
- p_1.types = ["string", "string"];
22028
- p_1.values = [_this.id_applicativo, _this.get_grid().sRow.uiid];
22029
- _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) {
22030
22142
  var b_found = false;
22031
22143
  var livello = 0;
22032
22144
  var descri_livello = '';
@@ -22044,11 +22156,11 @@
22044
22156
  _this._toastr.error(_this.tsr.instant('Il documento non è in stato Bozza'));
22045
22157
  return;
22046
22158
  }
22047
- var p_2 = new QParam();
22048
- p_2.sql = "UPDATE_WKF_STATO_BOZZA";
22049
- p_2.types = ["string", "string", "int", 'string'];
22050
- p_2.values = [_this.id_applicativo, _this.get_grid().sRow.uiid, livello, descri_livello];
22051
- _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) {
22052
22164
  if (data != null)
22053
22165
  if (data.result_msg == "OK") {
22054
22166
  _this._toastr.info(_this.tsr.instant('Documento aggiornato'));
@@ -22094,16 +22206,16 @@
22094
22206
  if (result != null)
22095
22207
  if (result.result != null)
22096
22208
  if (result.result == "ok") {
22097
- var p_3 = new QParam();
22098
- p_3.sql = "UPDATE_USER_WORKFLOW";
22099
- p_3.types = ["string", "string", "string", "string"];
22100
- 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 = [
22101
22213
  _this.id_applicativo,
22102
22214
  _this.get_grid().sRow.uiid,
22103
22215
  result.u1,
22104
22216
  result.u2,
22105
22217
  ];
22106
- _this.m_dataService.doQuery(p_3).subscribe(function (data) {
22218
+ _this.m_dataService.doQuery(p_4).subscribe(function (data) {
22107
22219
  if (data != null)
22108
22220
  if (data.result_msg == "OK") {
22109
22221
  _this._toastr.info(_this.tsr.instant("Workflow Aggiornato"));
@@ -22551,11 +22663,11 @@
22551
22663
  if (result != null)
22552
22664
  if (result.result != null)
22553
22665
  if (result.result == "ok") {
22554
- var p_4 = new QParam();
22555
- p_4.sql = "SELECT_USER_INFO_WKF";
22556
- p_4.types = ["string"];
22557
- p_4.values = [result.arrsel[0].username];
22558
- _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) {
22559
22671
  if (data != null)
22560
22672
  if (data.result_msg == "OK") {
22561
22673
  _this.app_s.user_name_ori = _this.app_s.user_name;
@@ -22707,11 +22819,11 @@
22707
22819
  _this.user_cognome = _this.app_s.user_surname;
22708
22820
  _this.user_email = _this.app_s.user_email;
22709
22821
  _this.m_uti.set_home_title(_this.tsr.instant(_this.att_panelcat));
22710
- var p_5 = new QParam();
22711
- p_5.sql = "SELECT_UTENTE_WKF_ADMIN";
22712
- p_5.types = ["string", "string"];
22713
- p_5.values = [_this.id_applicativo, _this.app_s.user];
22714
- _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) {
22715
22827
  if (data != null)
22716
22828
  if (data.result_msg == "OK") {
22717
22829
  var a = data.result_data;
@@ -22728,19 +22840,19 @@
22728
22840
  if (a[0].tipo == "2")
22729
22841
  _this.is_PowerUser = true;
22730
22842
  }
22731
- var p_6 = new QParam();
22732
- p_6.sql = "SELECT_WLIVELLIV2_2";
22733
- p_6.types = ["string"];
22734
- p_6.values = [_this.id_applicativo];
22735
- _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) {
22736
22848
  if (data != null)
22737
22849
  if (data.result_msg == "OK") {
22738
22850
  _this.ok_conf_s(data.result_data);
22739
- var p_7 = new QParam();
22740
- p_7.sql = "SELECT_ROLES_VISORI";
22741
- p_7.types = ["string"];
22742
- p_7.values = [_this.id_applicativo];
22743
- _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) {
22744
22856
  if (data != null)
22745
22857
  if (data.result_msg == "OK") {
22746
22858
  _this.is_Visor = false;