@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.
@@ -28952,6 +28952,117 @@ class wkfapp_v2 {
28952
28952
  if (o.cmd == "reclama_bozza")
28953
28953
  this.reclama_bozza();
28954
28954
  }
28955
+ riassegna_a(o) {
28956
+ let p = new QParam();
28957
+ p.sql = "SELECT_DOCUMENTS_BY_UIID";
28958
+ p.types = ["string", "string"];
28959
+ p.values = [this.id_applicativo, this.get_grid().sRow.uiid];
28960
+ this.m_dataService.doQuery(p).subscribe((data) => {
28961
+ o = data.result_data[0];
28962
+ let arx = o.assegnati_paralleli.split(',');
28963
+ let arrAutori = [];
28964
+ for (let x = 0; x < arx.length; x++)
28965
+ for (let y = 0; y < this.livs.length; y++) {
28966
+ if (arx[x] == this.livs[y].username) {
28967
+ arrAutori.push({ username: arx[x], nc: this.livs[y].nc });
28968
+ break;
28969
+ }
28970
+ }
28971
+ // console.log('arrAutori ',arrAutori);
28972
+ arrAutori = arrAutori.sort((n1, n2) => {
28973
+ if (n1.nc > n2.nc) {
28974
+ return 1;
28975
+ }
28976
+ if (n1.nc < n2.nc) {
28977
+ return -1;
28978
+ }
28979
+ return 0;
28980
+ });
28981
+ const dialogRef = this.dialog.open(win_assegna_a, { 'disableClose': true, width: '800px', data: {
28982
+ title: this.tsr.instant('Conferma Assegnazione'),
28983
+ lbl: '',
28984
+ commento_default: '',
28985
+ comm_notrequired: '',
28986
+ utenti: arrAutori,
28987
+ prendi_in_carico: false
28988
+ } });
28989
+ dialogRef.afterClosed().subscribe(result => {
28990
+ if (result) {
28991
+ if (result.arrsel.length == 0) {
28992
+ this._toastr.error("Impossibile riassegnare");
28993
+ return;
28994
+ }
28995
+ // console.log(' result.arrsel ', result.arrsel);
28996
+ let arr_new_arr = '';
28997
+ o.autori = '';
28998
+ o.pers_int = '';
28999
+ let b_edit = false;
29000
+ result.arrsel.map((v) => {
29001
+ if (arr_new_arr != '')
29002
+ arr_new_arr += ',';
29003
+ arr_new_arr += v.username;
29004
+ if (o.autori.indexOf(v.username) == -1) {
29005
+ console.log('VVV ', v);
29006
+ if (o.autori != '')
29007
+ o.autori = o.autori + ',';
29008
+ o.autori = o.autori + v.username;
29009
+ if (o.pers_int != '')
29010
+ o.pers_int = o.pers_int + ',';
29011
+ o.pers_int = o.pers_int + v.nc;
29012
+ }
29013
+ if (v.username == this.app_info.user)
29014
+ b_edit = true;
29015
+ });
29016
+ let in_carico = false;
29017
+ if (o.autori != null)
29018
+ if (o.autori.split(',').length != 1)
29019
+ in_carico = true;
29020
+ console.log(o.autori, in_carico);
29021
+ let b_assengna_a = false;
29022
+ if (o.assegnati_paralleli != null)
29023
+ if (o.assegnati_paralleli.split(',').length != 1)
29024
+ if (o.assegnati_paralleli.indexOf(this.app_s.user) > -1)
29025
+ b_assengna_a = true;
29026
+ // console.log('this.m_obj.autori ',this.m_obj.autori, this.in_carico, this.b_assengna_a);
29027
+ let p = new QParam();
29028
+ p.sql = "UPDATE_WKF_DOC_AUTHOR";
29029
+ p.values = [this.id_applicativo, o.id_documento, o.autori, o.pers_int];
29030
+ p.types = ["string", "string", "string", "string"];
29031
+ this.m_dataService.doQuery(p).subscribe((data) => {
29032
+ if (data != null)
29033
+ if (data.result_msg == "OK") {
29034
+ this.m_dataService.doQuery({ sql: 'INSERT_WORKFLOW_LOG',
29035
+ values: [this.id_applicativo, this.user_idp, 'DOCUMENTO RIASSEGNATO', 'DOCUMENTO RIASSEGNATO A: ' + arr_new_arr, o.uiid],
29036
+ types: ['string', 'string', 'string', 'string', 'string'], names: [] }).subscribe((data) => {
29037
+ });
29038
+ if (result.op == 'A') {
29039
+ let body_email = '';
29040
+ let oggetto_email = this.app_info.descrizione_breve +
29041
+ ", Ti è stato assegnato il documento numero: " +
29042
+ o.codice;
29043
+ if (this.app_info.subject_riassegna != null)
29044
+ if (this.app_info.subject_riassegna != "")
29045
+ oggetto_email = this.app_info.subject_riassegna;
29046
+ if (this.app_info.body_riassegna != null)
29047
+ if (this.app_info.body_riassegna != "")
29048
+ body_email = this.app_info.body_riassegna;
29049
+ oggetto_email = oggetto_email.split('{{TRANSITION_DESCRI}}').join(o.stat_stato);
29050
+ body_email = body_email.split('{{TRANSITION_DESCRI}}').join(o.stat_stato);
29051
+ this.sendEMail_ex(this.user_idp, arr_new_arr, oggetto_email, body_email, this.id_applicativo, o.uiid, this.app_info.COMPANY_SITE_ROOT +
29052
+ "#/" +
29053
+ this.app_info.modulo_swf +
29054
+ "/" +
29055
+ this.id_applicativo +
29056
+ "/" +
29057
+ o.uiid +
29058
+ "/edit", o.codice, "", true, "", false, '');
29059
+ }
29060
+ }
29061
+ });
29062
+ }
29063
+ });
29064
+ });
29065
+ }
28955
29066
  annulla_richiesta() {
28956
29067
  if (this.get_grid().sRow == null) {
28957
29068
  this._toastr.error(this.tsr.instant("Selezionare il documento da annullare"));