@fluxhub/fluxhub-lib 10.0.724 → 10.0.726

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.
@@ -24078,6 +24078,7 @@ class win_assegna_a {
24078
24078
  this.op = "L";
24079
24079
  this.lbl = "";
24080
24080
  this.nota = "";
24081
+ this.hide_row_cmd = false;
24081
24082
  this.nota_commento = "";
24082
24083
  this.title = "";
24083
24084
  this.comm_notrequired = 0;
@@ -24092,6 +24093,12 @@ class win_assegna_a {
24092
24093
  this.title = data.title;
24093
24094
  if (data.lbl != null)
24094
24095
  this.lbl = data.lbl;
24096
+ if (data.only_riassegna != null) {
24097
+ if (data.only_riassegna) {
24098
+ this.op = 'A';
24099
+ this.hide_row_cmd = true;
24100
+ }
24101
+ }
24095
24102
  if (data.utenti != null) {
24096
24103
  this.arrAutori = data.utenti;
24097
24104
  this.all_users = JSON.parse(JSON.stringify(data.utenti));
@@ -24156,7 +24163,7 @@ win_assegna_a.decorators = [
24156
24163
  style="font-size: 15px;min-width: 750px"
24157
24164
  >
24158
24165
  <br><br>
24159
- <div fxLayout="row" fxLayoutAlign="start center" fxFlexGap="5px" fxFlex="100">
24166
+ <div fxLayout="row" fxLayoutAlign="start center" fxFlexGap="5px" fxFlex="100" [hidden]="hide_row_cmd">
24160
24167
  <div style="width:100px;font-weight:bold">Operazione:*</div>
24161
24168
  <mat-radio-group [(ngModel)]="op">
24162
24169
  <mat-radio-button value="L">LIBERA</mat-radio-button>&nbsp;&nbsp;&nbsp;&nbsp;
@@ -28952,6 +28959,117 @@ class wkfapp_v2 {
28952
28959
  if (o.cmd == "reclama_bozza")
28953
28960
  this.reclama_bozza();
28954
28961
  }
28962
+ riassegna_a(o) {
28963
+ let p = new QParam();
28964
+ p.sql = "SELECT_DOCUMENTS_BY_UIID";
28965
+ p.types = ["string", "string"];
28966
+ p.values = [this.id_applicativo, this.get_grid().sRow.uiid];
28967
+ this.m_dataService.doQuery(p).subscribe((data) => {
28968
+ o = data.result_data[0];
28969
+ let arx = o.assegnati_paralleli.split(',');
28970
+ let arrAutori = [];
28971
+ for (let x = 0; x < arx.length; x++)
28972
+ for (let y = 0; y < this.livs.length; y++) {
28973
+ if (arx[x] == this.livs[y].username) {
28974
+ arrAutori.push({ username: arx[x], nc: this.livs[y].nc });
28975
+ break;
28976
+ }
28977
+ }
28978
+ // console.log('arrAutori ',arrAutori);
28979
+ arrAutori = arrAutori.sort((n1, n2) => {
28980
+ if (n1.nc > n2.nc) {
28981
+ return 1;
28982
+ }
28983
+ if (n1.nc < n2.nc) {
28984
+ return -1;
28985
+ }
28986
+ return 0;
28987
+ });
28988
+ const dialogRef = this.dialog.open(win_assegna_a, { 'disableClose': true, width: '800px', data: {
28989
+ title: this.tsr.instant('Conferma Assegnazione'),
28990
+ lbl: '',
28991
+ commento_default: '',
28992
+ comm_notrequired: '',
28993
+ utenti: arrAutori,
28994
+ prendi_in_carico: false
28995
+ } });
28996
+ dialogRef.afterClosed().subscribe(result => {
28997
+ if (result) {
28998
+ if (result.arrsel.length == 0) {
28999
+ this._toastr.error("Impossibile riassegnare");
29000
+ return;
29001
+ }
29002
+ // console.log(' result.arrsel ', result.arrsel);
29003
+ let arr_new_arr = '';
29004
+ o.autori = '';
29005
+ o.pers_int = '';
29006
+ let b_edit = false;
29007
+ result.arrsel.map((v) => {
29008
+ if (arr_new_arr != '')
29009
+ arr_new_arr += ',';
29010
+ arr_new_arr += v.username;
29011
+ if (o.autori.indexOf(v.username) == -1) {
29012
+ console.log('VVV ', v);
29013
+ if (o.autori != '')
29014
+ o.autori = o.autori + ',';
29015
+ o.autori = o.autori + v.username;
29016
+ if (o.pers_int != '')
29017
+ o.pers_int = o.pers_int + ',';
29018
+ o.pers_int = o.pers_int + v.nc;
29019
+ }
29020
+ if (v.username == this.app_info.user)
29021
+ b_edit = true;
29022
+ });
29023
+ let in_carico = false;
29024
+ if (o.autori != null)
29025
+ if (o.autori.split(',').length != 1)
29026
+ in_carico = true;
29027
+ console.log(o.autori, in_carico);
29028
+ let b_assengna_a = false;
29029
+ if (o.assegnati_paralleli != null)
29030
+ if (o.assegnati_paralleli.split(',').length != 1)
29031
+ if (o.assegnati_paralleli.indexOf(this.app_s.user) > -1)
29032
+ b_assengna_a = true;
29033
+ // console.log('this.m_obj.autori ',this.m_obj.autori, this.in_carico, this.b_assengna_a);
29034
+ let p = new QParam();
29035
+ p.sql = "UPDATE_WKF_DOC_AUTHOR";
29036
+ p.values = [this.id_applicativo, o.id_documento, o.autori, o.pers_int];
29037
+ p.types = ["string", "string", "string", "string"];
29038
+ this.m_dataService.doQuery(p).subscribe((data) => {
29039
+ if (data != null)
29040
+ if (data.result_msg == "OK") {
29041
+ this.m_dataService.doQuery({ sql: 'INSERT_WORKFLOW_LOG',
29042
+ values: [this.id_applicativo, this.user_idp, 'DOCUMENTO RIASSEGNATO', 'DOCUMENTO RIASSEGNATO A: ' + arr_new_arr, o.uiid],
29043
+ types: ['string', 'string', 'string', 'string', 'string'], names: [] }).subscribe((data) => {
29044
+ });
29045
+ if (result.op == 'A') {
29046
+ let body_email = '';
29047
+ let oggetto_email = this.app_info.descrizione_breve +
29048
+ ", Ti è stato assegnato il documento numero: " +
29049
+ o.codice;
29050
+ if (this.app_info.subject_riassegna != null)
29051
+ if (this.app_info.subject_riassegna != "")
29052
+ oggetto_email = this.app_info.subject_riassegna;
29053
+ if (this.app_info.body_riassegna != null)
29054
+ if (this.app_info.body_riassegna != "")
29055
+ body_email = this.app_info.body_riassegna;
29056
+ oggetto_email = oggetto_email.split('{{TRANSITION_DESCRI}}').join(o.stat_stato);
29057
+ body_email = body_email.split('{{TRANSITION_DESCRI}}').join(o.stat_stato);
29058
+ this.sendEMail_ex(this.user_idp, arr_new_arr, oggetto_email, body_email, this.id_applicativo, o.uiid, this.app_info.COMPANY_SITE_ROOT +
29059
+ "#/" +
29060
+ this.app_info.modulo_swf +
29061
+ "/" +
29062
+ this.id_applicativo +
29063
+ "/" +
29064
+ o.uiid +
29065
+ "/edit", o.codice, "", true, "", false, '');
29066
+ }
29067
+ }
29068
+ });
29069
+ }
29070
+ });
29071
+ });
29072
+ }
28955
29073
  annulla_richiesta() {
28956
29074
  if (this.get_grid().sRow == null) {
28957
29075
  this._toastr.error(this.tsr.instant("Selezionare il documento da annullare"));