@fluxhub/fluxhub-lib 10.0.436 → 10.0.438

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.
@@ -7031,42 +7031,56 @@ class wkfapp {
7031
7031
  this._toastr.error("Selezionare il documento");
7032
7032
  return;
7033
7033
  }
7034
- let p = new QParam();
7035
- p.sql = "SELECT_WKF_SELECT_USER_MIN";
7036
- p.types = ["string", "string"];
7037
- p.values = [this.id_applicativo, this.get_grid().sRow.uiid];
7038
- this.m_dataService.doQuery(p).subscribe((data) => {
7039
- let b_found = false;
7040
- let livello = 0;
7041
- let descri_livello = '';
7042
- for (let i = 0; i < data.result_data.length; i++) {
7043
- if (data.result_data[i].idp == this.app_s.user) {
7044
- livello = data.result_data[i].livello;
7045
- descri_livello = data.result_data[i].descri_livello;
7046
- b_found = true;
7047
- break;
7048
- }
7049
- }
7050
- if (b_found) {
7051
- if (livello != this.get_grid().sRow.stato) {
7052
- this._toastr.error('Il documento non è in stato Bozza');
7053
- return;
7054
- }
7034
+ let dialogRef = this.dialog.open(fh_win_confirm, {
7035
+ disableClose: true, data: { title_dialog: "Conferma Operazione", msg_dialog: "Confermi di voler assegnarti il documento?" }
7036
+ });
7037
+ dialogRef.afterClosed().subscribe((result) => {
7038
+ if (result) {
7055
7039
  let p = new QParam();
7056
- p.sql = "UPDATE_WKF_STATO_BOZZA";
7057
- p.types = ["string", "string", "int", 'string'];
7058
- p.values = [this.id_applicativo, this.get_grid().sRow.uiid, livello, descri_livello];
7040
+ p.sql = "SELECT_DOCUMENTS_BY_UIID";
7041
+ p.types = ["string", "string"];
7042
+ p.values = [this.id_applicativo, this.get_grid().sRow.uiid];
7059
7043
  this.m_dataService.doQuery(p).subscribe((data) => {
7060
- if (data != null)
7061
- if (data.result_msg == "OK") {
7062
- this._toastr.info('Documento aggiornato');
7063
- this.get_grid().doFill("");
7044
+ let stato_doc = data.result_data[0].stato;
7045
+ p = new QParam();
7046
+ p.sql = "SELECT_WKF_SELECT_USER_MIN";
7047
+ p.types = ["string", "string"];
7048
+ p.values = [this.id_applicativo, this.get_grid().sRow.uiid];
7049
+ this.m_dataService.doQuery(p).subscribe((data) => {
7050
+ let b_found = false;
7051
+ let livello = 0;
7052
+ let descri_livello = '';
7053
+ for (let i = 0; i < data.result_data.length; i++) {
7054
+ if (data.result_data[i].idp == this.app_s.user) {
7055
+ livello = data.result_data[i].livello;
7056
+ descri_livello = data.result_data[i].descri_livello;
7057
+ b_found = true;
7058
+ break;
7059
+ }
7064
7060
  }
7061
+ if (b_found) {
7062
+ if (livello != stato_doc) {
7063
+ this._toastr.error('Il documento non è in stato Bozza');
7064
+ return;
7065
+ }
7066
+ let p = new QParam();
7067
+ p.sql = "UPDATE_WKF_STATO_BOZZA";
7068
+ p.types = ["string", "string", "int", 'string'];
7069
+ p.values = [this.id_applicativo, this.get_grid().sRow.uiid, livello, descri_livello];
7070
+ this.m_dataService.doQuery(p).subscribe((data) => {
7071
+ if (data != null)
7072
+ if (data.result_msg == "OK") {
7073
+ this._toastr.info('Documento aggiornato');
7074
+ this.get_grid().doFill("");
7075
+ }
7076
+ });
7077
+ }
7078
+ else {
7079
+ this._toastr.error('L\'utente non è configurato per lo step BOZZA');
7080
+ }
7081
+ });
7065
7082
  });
7066
7083
  }
7067
- else {
7068
- this._toastr.error('L\'utente non è configurato per lo step BOZZA');
7069
- }
7070
7084
  });
7071
7085
  }
7072
7086
  recupera_richiesta() {
@@ -14930,12 +14944,10 @@ class FHGridJSONComponent {
14930
14944
  this.res_columns(true);
14931
14945
  }
14932
14946
  edit_config() {
14933
- localStorage.setItem(this.m_appService.COMPANY_KEY + "title_dialog", "Conferma Operazione");
14934
- localStorage.setItem(this.m_appService.COMPANY_KEY + "msg_dialog", "Confermi di voler sovrascrivere la configurazione " +
14935
- this.gf.getDescri() +
14936
- "?");
14937
14947
  let dialogRef = this.m_dialog.open(fh_win_confirm, {
14938
- disableClose: true,
14948
+ disableClose: true, data: { title_dialog: "Conferma Operazione", msg_dialog: "Confermi di voler sovrascrivere la configurazione " +
14949
+ this.gf.getDescri() +
14950
+ "?" }
14939
14951
  });
14940
14952
  dialogRef.afterClosed().subscribe((result) => {
14941
14953
  if (result) {
@@ -15756,7 +15768,7 @@ FHGridToolBarComponent.decorators = [
15756
15768
  { type: Component, args: [{
15757
15769
  selector: "FHGridToolBar",
15758
15770
  template: `
15759
- {{sRow|json}}
15771
+
15760
15772
  <div
15761
15773
  *ngIf="type == 'WKF_NO_EDIT'"
15762
15774
  fxLayoutGap="3px"
@@ -15816,7 +15828,7 @@ FHGridToolBarComponent.decorators = [
15816
15828
  {{ "SOSTITUISCI UTENTE" | translate }}
15817
15829
  </button>
15818
15830
  <button
15819
- mat-menu-item [hidden]="sRow==null || sRow?.stato<=10"
15831
+ mat-menu-item [hidden]="sRow==null"
15820
15832
  style="background-color: #F5F5F5"
15821
15833
  (click)="reclama_bozza()"
15822
15834
  *ngIf="toolbar_wkfapp?.is_Supervisor || toolbar_wkfapp?.is_Admin"
@@ -15930,7 +15942,7 @@ FHGridToolBarComponent.decorators = [
15930
15942
  {{ "SOSTITUISCI UTENTE" | translate }}
15931
15943
  </button>
15932
15944
  <button
15933
- mat-menu-item [hidden]="sRow==null || sRow?.stato<=10"
15945
+ mat-menu-item [hidden]="sRow==null"
15934
15946
  style="background-color: #F5F5F5"
15935
15947
  (click)="reclama_bozza()"
15936
15948
  *ngIf="toolbar_wkfapp?.is_Supervisor || toolbar_wkfapp?.is_Admin"
@@ -25597,42 +25609,57 @@ class wkfapp_v2 {
25597
25609
  this._toastr.error("Selezionare il documento");
25598
25610
  return;
25599
25611
  }
25600
- let p = new QParam();
25601
- p.sql = "SELECT_WKF2_SELECT_USER_MIN";
25602
- p.types = ["string", "string"];
25603
- p.values = [this.id_applicativo, this.get_grid().sRow.uiid];
25604
- this.m_dataService.doQuery(p).subscribe((data) => {
25605
- let b_found = false;
25606
- let livello = 0;
25607
- let descri_livello = '';
25608
- for (let i = 0; i < data.result_data.length; i++) {
25609
- if (data.result_data[i].username == this.app_s.user) {
25610
- livello = data.result_data[i].step;
25611
- descri_livello = data.result_data[i].des_step;
25612
- b_found = true;
25613
- break;
25614
- }
25615
- }
25616
- if (b_found) {
25617
- if (livello != this.get_grid().sRow.stato) {
25618
- this._toastr.error('Il documento non è in stato Bozza');
25619
- return;
25620
- }
25612
+ let dialogRef = this.dialog.open(fh_win_confirm, {
25613
+ disableClose: true, data: { title_dialog: "Conferma Operazione", msg_dialog: "Confermi di voler assegnarti il documento?" }
25614
+ });
25615
+ dialogRef.afterClosed().subscribe((result) => {
25616
+ if (result) {
25621
25617
  let p = new QParam();
25622
- p.sql = "UPDATE_WKF_STATO_BOZZA";
25623
- p.types = ["string", "string", "int", 'string'];
25624
- p.values = [this.id_applicativo, this.get_grid().sRow.uiid, livello, descri_livello];
25618
+ p.sql = "SELECT_DOCUMENTS_BY_UIID";
25619
+ p.types = ["string", "string"];
25620
+ p.values = [this.id_applicativo, this.get_grid().sRow.uiid];
25625
25621
  this.m_dataService.doQuery(p).subscribe((data) => {
25626
- if (data != null)
25627
- if (data.result_msg == "OK") {
25628
- this._toastr.info('Documento aggiornato');
25629
- this.get_grid().doFill("");
25622
+ let stato_doc = data.result_data[0].stato;
25623
+ p = new QParam();
25624
+ p.sql = "SELECT_WKF2_SELECT_USER_MIN";
25625
+ p.types = ["string", "string"];
25626
+ p.values = [this.id_applicativo, this.get_grid().sRow.uiid];
25627
+ this.m_dataService.doQuery(p).subscribe((data) => {
25628
+ let b_found = false;
25629
+ let livello = 0;
25630
+ let descri_livello = '';
25631
+ for (let i = 0; i < data.result_data.length; i++) {
25632
+ if (data.result_data[i].username == this.app_s.user) {
25633
+ livello = data.result_data[i].step;
25634
+ descri_livello = data.result_data[i].des_step;
25635
+ b_found = true;
25636
+ break;
25637
+ }
25630
25638
  }
25639
+ if (b_found) {
25640
+ console.log(livello, stato_doc);
25641
+ if (livello != stato_doc) {
25642
+ this._toastr.error('Il documento non è in stato Bozza');
25643
+ return;
25644
+ }
25645
+ let p = new QParam();
25646
+ p.sql = "UPDATE_WKF_STATO_BOZZA";
25647
+ p.types = ["string", "string", "int", 'string'];
25648
+ p.values = [this.id_applicativo, this.get_grid().sRow.uiid, livello, descri_livello];
25649
+ this.m_dataService.doQuery(p).subscribe((data) => {
25650
+ if (data != null)
25651
+ if (data.result_msg == "OK") {
25652
+ this._toastr.info('Documento aggiornato');
25653
+ this.get_grid().doFill("");
25654
+ }
25655
+ });
25656
+ }
25657
+ else {
25658
+ this._toastr.error('L\'utente non è configurato per lo step BOZZA');
25659
+ }
25660
+ });
25631
25661
  });
25632
25662
  }
25633
- else {
25634
- this._toastr.error('L\'utente non è configurato per lo step BOZZA');
25635
- }
25636
25663
  });
25637
25664
  }
25638
25665
  sostituisci_utente() {