@fluxhub/fluxhub-lib 1.0.220 → 1.0.221

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.
@@ -32,7 +32,7 @@ import { TranslateModule } from '@ngx-translate/core';
32
32
  import { DragulaService, DragulaModule } from 'ng2-dragula';
33
33
  import { MatDialogRef, MatDialog, DateAdapter, MAT_DATE_LOCALE, MatAutocompleteModule, MatButtonModule, MatButtonToggleModule, MatPaginatorModule, MatCardModule, MatCheckboxModule, MatChipsModule, MatDatepickerModule, MatGridListModule, MatIconModule, MatInputModule, MatListModule, MatMenuModule, MatProgressBarModule, MatProgressSpinnerModule, MatRadioModule, MatSelectModule, MatSidenavModule, MatSliderModule, MatSortModule, MatSlideToggleModule, MatSnackBarModule, MatTableModule, MatTabsModule, MatToolbarModule, MatTooltipModule, MatFormFieldModule, MatExpansionModule, MatStepperModule, MatDialogModule, MatNativeDateModule } from '@angular/material';
34
34
  import { ActivatedRoute, Router } from '@angular/router';
35
- import { Injectable, Component, Directive, Inject, PLATFORM_ID, Input, Output, EventEmitter, ViewChild, forwardRef, ElementRef, Pipe, ViewContainerRef, defineInjectable, inject, HostListener, NgModule } from '@angular/core';
35
+ import { Injectable, Component, Directive, Inject, PLATFORM_ID, Input, ViewChild, Output, EventEmitter, forwardRef, ElementRef, Pipe, ViewContainerRef, defineInjectable, inject, HostListener, NgModule } from '@angular/core';
36
36
  import { Http } from '@angular/http';
37
37
  import { SlimLoadingBarService } from 'ng2-slim-loading-bar';
38
38
  import { ToastrService } from 'ngx-toastr';
@@ -4723,6 +4723,7 @@ class wkfapp {
4723
4723
  this.b_initd = false;
4724
4724
  this.nota_wax = "";
4725
4725
  this.imp = "";
4726
+ this.m_cod_documento = '';
4726
4727
  this.sort_field = '';
4727
4728
  if (!m_service.checkCredentials()) {
4728
4729
  return;
@@ -5264,21 +5265,32 @@ class wkfapp {
5264
5265
  * @return {?}
5265
5266
  */
5266
5267
  init_Panel(cod_documento, id_Doc) {
5268
+ this.m_id_Doc = id_Doc;
5269
+ this.m_cod_documento = cod_documento;
5270
+ this.do_init();
5271
+ }
5272
+ /**
5273
+ * @private
5274
+ * @return {?}
5275
+ */
5276
+ do_init() {
5267
5277
  if (this.app_s.user_ori != null)
5268
5278
  this.imp = 'ANN. IMP: ' + this.app_s.user_name + ' ' + this.app_s.user_surname;
5269
5279
  if (this.app_s.getState().wkf_obj != null)
5270
- if (this.app_s.getState().wkf_obj.codice_app == cod_documento) {
5280
+ if (this.app_s.getState().wkf_obj.codice_app == this.m_cod_documento) {
5271
5281
  this.restore_state_wkf();
5272
5282
  return;
5273
5283
  }
5274
5284
  this.user_idp = this.app_s.user;
5285
+ if (this.user_idp == null) {
5286
+ setTimeout(() => { this.do_init(), 1000; });
5287
+ return;
5288
+ }
5275
5289
  /** @type {?} */
5276
5290
  let p = new QParam();
5277
5291
  p.sql = "SELECT_WKF_APP_INFO";
5278
5292
  p.types = ['string'];
5279
- p.values = [cod_documento];
5280
- /** @type {?} */
5281
- let ok_op = false;
5293
+ p.values = [this.m_cod_documento];
5282
5294
  this
5283
5295
  .m_dataService
5284
5296
  .doQuery(p)
@@ -5287,8 +5299,6 @@ class wkfapp {
5287
5299
  if (data.result_msg == "OK") {
5288
5300
  /** @type {?} */
5289
5301
  let a_conf = data.result_data;
5290
- ok_op = true;
5291
- this.m_id_Doc = id_Doc;
5292
5302
  this.id_applicativo = a_conf[0].id_gruppo;
5293
5303
  this.app_root = a_conf[0].modulo_swf;
5294
5304
  this.codice_app = a_conf[0].codice_documento; //codice documento
@@ -5303,13 +5313,12 @@ class wkfapp {
5303
5313
  this.user_email = this.app_s.user_email;
5304
5314
  this.app_s.getState().topnavTitle = this.att_panelcat;
5305
5315
  /** @type {?} */
5306
- var p = new QParam();
5316
+ let p = new QParam();
5307
5317
  p.sql = "SELECT_UTENTE_WKF_ADMIN";
5308
5318
  p.types = ['string', 'string'];
5309
5319
  p.values = [
5310
5320
  this.id_applicativo, this.app_s.user
5311
5321
  ];
5312
- ok_op = false;
5313
5322
  this
5314
5323
  .m_dataService
5315
5324
  .doQuery(p)
@@ -5317,7 +5326,7 @@ class wkfapp {
5317
5326
  if (data != null)
5318
5327
  if (data.result_msg == "OK") {
5319
5328
  /** @type {?} */
5320
- var a = data.result_data;
5329
+ let a = data.result_data;
5321
5330
  this.is_Supervisor = false;
5322
5331
  this.is_Admin = false;
5323
5332
  if (a.length > 0) {
@@ -5325,13 +5334,11 @@ class wkfapp {
5325
5334
  if (a[0].tipo == "1")
5326
5335
  this.is_Admin = true;
5327
5336
  }
5328
- ok_op = true;
5329
5337
  /** @type {?} */
5330
- var p = new QParam();
5338
+ let p = new QParam();
5331
5339
  p.sql = "SELECT_WLIVELLIV2";
5332
5340
  p.types = ['string', 'string'];
5333
5341
  p.values = [this.id_applicativo, ''];
5334
- ok_op = false;
5335
5342
  this
5336
5343
  .m_dataService
5337
5344
  .doQuery(p)
@@ -5339,25 +5346,11 @@ class wkfapp {
5339
5346
  if (data != null)
5340
5347
  if (data.result_msg == "OK") {
5341
5348
  this.ok_conf_s(data.result_data);
5342
- ok_op = true;
5343
5349
  }
5344
- if (!ok_op) {
5345
- console.error(data.msg);
5346
- }
5347
- }, err => {
5348
- console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI");
5349
5350
  });
5350
5351
  }
5351
- }, err => {
5352
- console.error("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI");
5353
5352
  });
5354
- ok_op = true;
5355
5353
  }
5356
- if (!ok_op) {
5357
- console.error(data.msg);
5358
- }
5359
- }, err => {
5360
- console.error("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI");
5361
5354
  });
5362
5355
  }
5363
5356
  /**
@@ -5369,15 +5362,16 @@ class wkfapp {
5369
5362
  this.is_Ins = false;
5370
5363
  for (let i = 0; i < this.livs.length; i++)
5371
5364
  if (this.livs[i].idp != null)
5372
- if ((this.livs[i].idp.toUpperCase() == this.user_idp.toUpperCase() || this.livs[i].gruppo_parallelo == "*ALLUSERS"))
5373
- if (this.livs[i].livello == 10 && this.livs[i].notifica == 0) {
5374
- this.is_Ins = true;
5375
- if (this.livs[i].gruppo_parallelo == "*ALLUSERS") {
5376
- this.livs[i].gruppo_parallelo = "";
5377
- this.livs[i].idp = this.user_idp;
5365
+ if (this.user_idp != null)
5366
+ if ((this.livs[i].idp.toUpperCase() == this.user_idp.toUpperCase() || this.livs[i].gruppo_parallelo == "*ALLUSERS"))
5367
+ if (this.livs[i].livello == 10 && this.livs[i].notifica == 0) {
5368
+ this.is_Ins = true;
5369
+ if (this.livs[i].gruppo_parallelo == "*ALLUSERS") {
5370
+ this.livs[i].gruppo_parallelo = "";
5371
+ this.livs[i].idp = this.user_idp;
5372
+ }
5373
+ break;
5378
5374
  }
5379
- break;
5380
- }
5381
5375
  this.save_state_wkf();
5382
5376
  // Alert.show(tbl_name);
5383
5377
  this.parse_url();
@@ -5729,7 +5723,6 @@ class FHGridComponent {
5729
5723
  floatingFilter: true,
5730
5724
  enableRangeSelection: true,
5731
5725
  defaultColDef: { resizable: true, sortable: true },
5732
- alwaysShowVerticalScroll: true,
5733
5726
  rowSelection: 'multiple',
5734
5727
  rowDeselection: false,
5735
5728
  // getContextMenuItems: () => this.getContextMenuItems(),
@@ -13770,22 +13763,13 @@ class dati_aggiuntivi {
13770
13763
  */
13771
13764
  this.doEnd(this.nlevel.livello);
13772
13765
  /** @type {?} */
13773
- var p = new QParam();
13766
+ let p = new QParam();
13774
13767
  p.sql = "UPDATE_DATA_CHIUSURA";
13775
13768
  p.values = [this.id_applicativo, this.id_documento];
13776
13769
  p.types = ['string', 'string'];
13777
13770
  this.m_dataService.doQuery(p).subscribe(data => {
13778
- /** @type {?} */
13779
- let ok_op = false;
13780
13771
  if (data != null)
13781
- if (data.result_msg == "OK") {
13782
- ok_op = true;
13783
- }
13784
- if (!ok_op) {
13785
- this.alert(data.msg, 1);
13786
- }
13787
- }, err => {
13788
- this.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI", 1);
13772
+ if (data.result_msg == "OK") ;
13789
13773
  });
13790
13774
  }
13791
13775
  /** @type {?} */
@@ -13810,7 +13794,7 @@ class dati_aggiuntivi {
13810
13794
  if (this.nlevel.descri_livello != null)
13811
13795
  this.m_oper = this.m_oper + " -> " + this.nlevel.descri_livello;
13812
13796
  /** @type {?} */
13813
- var p = new QParam();
13797
+ let p = new QParam();
13814
13798
  p.sql = "doWKF";
13815
13799
  p.values = [this.app_info.descrizione_breve,
13816
13800
  this.m_obj.codice,
@@ -13823,40 +13807,21 @@ class dati_aggiuntivi {
13823
13807
  this.getDescri(), this.user_idp, this.m_statox, this.m_oper, this.id_applicativo, this.id_documento, '' + this.m_crea_att, '' + this.m_send_email, '' + this.clevel.livello, '' + this.nlevel.livello];
13824
13808
  this.insert_wkf_variabile(this.id_applicativo, this.id_documento, this.clevel.livello + "_PLAYER", this.user_idp);
13825
13809
  this.m_wkf.doQuery(p).subscribe(data => {
13826
- /** @type {?} */
13827
- let ok_op = false;
13828
13810
  if (data != null)
13829
- if (data.result_msg == "OK") {
13830
- ok_op = true;
13831
- }
13832
- if (!ok_op) {
13833
- this.alert(data.msg, 1);
13834
- }
13835
- }, err => {
13836
- this.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI", 1);
13811
+ if (data.result_msg == "OK") ;
13837
13812
  });
13838
- /** @type {?} */
13839
- var p = new QParam();
13813
+ p = new QParam();
13840
13814
  p.sql = "UPDATE_WKF_DOCUMENTOV3_NS";
13841
13815
  p.values = a;
13842
13816
  p.types = t;
13843
13817
  this.m_dataService.doQuery(p).subscribe(data => {
13844
- /** @type {?} */
13845
- let ok_op = false;
13846
13818
  if (data != null)
13847
- if (data.result_msg == "OK") {
13848
- ok_op = true;
13849
- }
13850
- if (!ok_op) {
13851
- this.alert(data.msg, 1);
13852
- }
13853
- }, err => {
13854
- this.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI", 1);
13819
+ if (data.result_msg == "OK") ;
13855
13820
  });
13856
13821
  //myRPC.query("UPDATE_FLAG_CARICO",new Array("0",id_applicativo, id_documento,''));
13857
13822
  if (this.m_danotificare != "") {
13858
13823
  /** @type {?} */
13859
- var comm = "";
13824
+ let comm = "";
13860
13825
  if (this.nota != "")
13861
13826
  comm = "<br>Commento: " + this.nota;
13862
13827
  if (this.clevel.ccn_mittente == 1) {
@@ -13864,16 +13829,13 @@ class dati_aggiuntivi {
13864
13829
  this.m_danotificare = this.m_danotificare + ",";
13865
13830
  this.m_danotificare = this.m_danotificare + this.user_idp;
13866
13831
  }
13867
- /** @type {?} */
13868
- var p = new QParam();
13832
+ p = new QParam();
13869
13833
  p.sql = "exec_app_workflow";
13870
13834
  p.values = [this.app_info.codice_documento, this.id_documento, '' + this.clevel.livello, '' + this.nlevel.livello, this.user_idp];
13871
13835
  this.m_wkf.doQuery(p).subscribe(data => {
13872
- }, err => {
13873
13836
  });
13874
13837
  if (this.nlevel.approvazione_email == 1) ;
13875
13838
  else {
13876
- console.log('this.nlevel.ical ', this.nlevel.ical);
13877
13839
  /** @type {?} */
13878
13840
  let ical = null;
13879
13841
  if (this.nlevel.ical == 1) {
@@ -13897,8 +13859,6 @@ class dati_aggiuntivi {
13897
13859
  if (this.b_respingi)
13898
13860
  this.sendEMail_ex(this.user_idp, this.m_danotificare, "Respinta " + this.getTitle() + "-[" + this.m_obj.codice + "]", "<br>Attività:" + this.getLvlDescri(String(this.m_liv), this.m_statox) + "<br>" + this.m_statox + "<br>" + this.getDescri() + "<br>Commenti:" + comm, this.id_applicativo, this.id_documento, this.app_s.COMPANY_SITE_ROOT + '#/' + this.app_info.modulo_swf + '/' + this.id_applicativo + "/" + this.id_documento + "/edit", this.m_obj.codice, this.nota, true, ical);
13899
13861
  else {
13900
- console.log("--------------this.clevel.oggetto_text----------------------");
13901
- console.log(this.nlevel.oggetto_email);
13902
13862
  if (this.nlevel.oggetto_email == null)
13903
13863
  this.sendEMail_ex(this.user_idp, this.m_danotificare, this.app_info.descrizione_breve + ", Ti è stato assegnato il documento numero: " + this.m_obj.codice + " " + this.getTitle(), "<br>Attività:" + this.getLvlDescri(String(this.m_liv), this.m_statox) + "<br>" + this.m_statox + "<br>" + this.getDescri() + comm, this.id_applicativo, this.id_documento, this.app_s.COMPANY_SITE_ROOT + '#/' + this.app_info.modulo_swf + '/' + this.id_applicativo + "/" + this.id_documento + "/edit", this.m_obj.codice, this.nota, true, ical);
13904
13864
  else if (this.nlevel.oggetto_email == "")
@@ -13923,6 +13883,53 @@ class dati_aggiuntivi {
13923
13883
  }
13924
13884
  else
13925
13885
  this.goto_edit_doc();
13886
+ if (this.nlevel.tipo_notifica_aggiuntiva != 0) {
13887
+ if (this.nlevel.tipo_notifica_aggiuntiva == 1)
13888
+ this.sendEMail_ex(this.user_idp, this.m_obj.creatore, this.app_info.descrizione_breve + ", Il documento numero: " + this.m_obj.codice + " è passato allo STEP: " + this.nlevel.descri_livello + " " + this.getTitle(), this.m_statox + "<br>" + this.getDescri() + comm, this.id_applicativo, this.id_documento, this.app_s.COMPANY_SITE_ROOT + '#/' + this.app_info.modulo_swf + '/' + this.id_applicativo + "/" + this.id_documento + "/edit", this.m_obj.codice, this.nota, true, ical, false);
13889
+ if (this.nlevel.tipo_notifica_aggiuntiva == 2) {
13890
+ /** @type {?} */
13891
+ let p = new QParam();
13892
+ p.sql = "SELECT_PARTECIPANTI_DOC";
13893
+ p.values = [this.id_applicativo, this.id_documento];
13894
+ p.types = ['string', 'string'];
13895
+ this.m_dataService.doQuery(p).subscribe(data => {
13896
+ if (data != null)
13897
+ if (data.result_msg == "OK") {
13898
+ /** @type {?} */
13899
+ let lista_p = this.user_idp;
13900
+ for (let i = 0; i < data.result_data.length; i++)
13901
+ if (lista_p.indexOf(data.result_data[i].username) == -1) {
13902
+ console.log('username:', data.result_data[i].username);
13903
+ lista_p += ',';
13904
+ lista_p += data.result_data[i].username;
13905
+ }
13906
+ console.log('lista_p ', lista_p);
13907
+ this.sendEMail_ex(this.user_idp, lista_p, this.app_info.descrizione_breve + ", Il documento numero: " + this.m_obj.codice + " è passato allo STEP: " + this.nlevel.descri_livello + " " + this.getTitle(), this.m_statox + "<br>" + this.getDescri() + comm, this.id_applicativo, this.id_documento, this.app_s.COMPANY_SITE_ROOT + '#/' + this.app_info.modulo_swf + '/' + this.id_applicativo + "/" + this.id_documento + "/edit", this.m_obj.codice, this.nota, true, ical, false);
13908
+ }
13909
+ });
13910
+ }
13911
+ if (this.nlevel.tipo_notifica_aggiuntiva == 3) {
13912
+ /** @type {?} */
13913
+ let p = new QParam();
13914
+ p.sql = "SELECT_ALL_USERS_DOC";
13915
+ p.values = [this.id_applicativo, this.id_documento];
13916
+ p.types = ['string', 'string'];
13917
+ this.m_dataService.doQuery(p).subscribe(data => {
13918
+ if (data != null)
13919
+ if (data.result_msg == "OK") {
13920
+ /** @type {?} */
13921
+ let lista_p = this.user_idp;
13922
+ for (let i = 0; i < data.result_data.length; i++)
13923
+ if (lista_p.indexOf(data.result_data[i].username) == -1) {
13924
+ console.log('username:', data.result_data[i].username);
13925
+ lista_p += ',';
13926
+ lista_p += data.result_data[i].username;
13927
+ }
13928
+ this.sendEMail_ex(this.user_idp, lista_p, this.app_info.descrizione_breve + ", Il documento numero: " + this.m_obj.codice + " è passato allo STEP: " + this.nlevel.descri_livello + " " + this.getTitle(), this.m_statox + "<br>" + this.getDescri() + comm, this.id_applicativo, this.id_documento, this.app_s.COMPANY_SITE_ROOT + '#/' + this.app_info.modulo_swf + '/' + this.id_applicativo + "/" + this.id_documento + "/edit", this.m_obj.codice, this.nota, true, ical, false);
13929
+ }
13930
+ });
13931
+ }
13932
+ }
13926
13933
  }
13927
13934
  }
13928
13935
  }
@@ -13938,9 +13945,10 @@ class dati_aggiuntivi {
13938
13945
  * @param {?} nota
13939
13946
  * @param {?=} notif_av
13940
13947
  * @param {?=} ical
13948
+ * @param {?=} b_exit
13941
13949
  * @return {?}
13942
13950
  */
13943
- sendEMail_ex(mit, to, ogg, descri, idapp, iddoc, link, cc, nota, notif_av = true, ical = '') {
13951
+ sendEMail_ex(mit, to, ogg, descri, idapp, iddoc, link, cc, nota, notif_av = true, ical = '', b_exit = true) {
13944
13952
  /** @type {?} */
13945
13953
  let p = new QParam();
13946
13954
  p.sql = "send_wkf_mail";
@@ -13954,7 +13962,8 @@ class dati_aggiuntivi {
13954
13962
  ical = JSON.stringify(ical);
13955
13963
  p.values = [mit, to, ogg, descri, idapp, iddoc, link, cc, nota, ical];
13956
13964
  this.m_wkf.doQuery(p).subscribe(data => {
13957
- this.goto_edit_doc(notif_av);
13965
+ if (b_exit)
13966
+ this.goto_edit_doc(notif_av);
13958
13967
  });
13959
13968
  }
13960
13969
  /**