@fluxhub/fluxhub-lib 19.0.220 → 19.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.
@@ -32577,6 +32577,14 @@ class FHWorkflowForm {
32577
32577
  }
32578
32578
  }
32579
32579
  this.clevel = this.check_n_levels(this.clevel);
32580
+ UtilityService.dlog('[WKF] doApprova(): clevel', {
32581
+ clevel: this.clevel,
32582
+ stato: this.m_obj?.stato,
32583
+ livs_dello_step: (this.livs || []).filter((l) => Number(l.step) === Number(this.m_obj?.stato)),
32584
+ });
32585
+ if (this.clevel == null) {
32586
+ UtilityService.dlog('[WKF] doApprova(): STOP, clevel NULL: nessun livello dello step corrente combacia con l utente');
32587
+ }
32580
32588
  this.calcolanextandjump();
32581
32589
  }
32582
32590
  wkf_rule_before(transazioni, step, context, oper) {
@@ -32594,10 +32602,17 @@ class FHWorkflowForm {
32594
32602
  }
32595
32603
  p.values = [this.id_applicativo, this.clevel.step];
32596
32604
  p.types = ['string', 'int'];
32605
+ UtilityService.dlog('[WKF] calcolanextandjump()', {
32606
+ sql: p.sql,
32607
+ step: this.clevel?.step,
32608
+ oper: this.oper,
32609
+ b_respingi_button: this.b_respingi_button,
32610
+ });
32597
32611
  this.m_dataService.doQuery(p).subscribe((data) => {
32598
32612
  if (data != null)
32599
32613
  if (data.result_msg == 'OK') {
32600
32614
  let transazioni = data.result_data;
32615
+ UtilityService.dlog('[WKF] transizioni trovate:', transazioni.length, transazioni.map((t) => t.step_d + ' ' + t.description));
32601
32616
  transazioni = this.wkf_rule_before(transazioni, this.clevel.step, this.clevel.context, this.oper);
32602
32617
  if (transazioni.length == 0) {
32603
32618
  this.alert('Nessuna transizione definita dallo step: ' + this.clevel.step, 1);
@@ -33372,17 +33387,23 @@ class FHWorkflowForm {
33372
33387
  this.salva();
33373
33388
  }
33374
33389
  procedi() {
33375
- if (!this.can_save())
33390
+ if (!this.can_save()) {
33391
+ UtilityService.dlog('[WKF] procedi(): STOP, can_save()=false');
33376
33392
  return;
33377
- if (this.b_saving)
33393
+ }
33394
+ if (this.b_saving) {
33395
+ UtilityService.dlog('[WKF] procedi(): STOP, b_saving=true');
33378
33396
  return;
33397
+ }
33379
33398
  this.oper = 'procedi';
33380
33399
  this.btnprocedi = true;
33381
33400
  this.update_status(false, false, null, null, 9);
33382
33401
  if (!this.ck_field('proceed')) {
33402
+ UtilityService.dlog("[WKF] procedi(): STOP, ck_field('proceed')=false");
33383
33403
  this.update_status(true, this.respingi_enabled, null, null, 10);
33384
33404
  return;
33385
33405
  }
33406
+ UtilityService.dlog('[WKF] procedi(): ok, salva()');
33386
33407
  this.salva();
33387
33408
  }
33388
33409
  open_wkf(em, inser_c = false, edit_c = true, show_wkf = true) {
@@ -33592,6 +33613,11 @@ class FHWorkflowForm {
33592
33613
  }
33593
33614
  ok_insert_aggiuntivi() {
33594
33615
  this.b_saving = false;
33616
+ UtilityService.dlog('[WKF] ok_insert_aggiuntivi()', {
33617
+ btnprocedi: this.btnprocedi,
33618
+ b_edit: this.b_edit,
33619
+ prossimo: this.btnprocedi ? 'load_document() -> doApprova()' : 'solo salvataggio',
33620
+ });
33595
33621
  if (!this.btnprocedi) {
33596
33622
  this.alert('DOCUMENTO SALVATO', 0);
33597
33623
  this.after_save();
@@ -34419,13 +34445,30 @@ class FHWorkflowForm {
34419
34445
  // gira anche all'APERTURA del documento: se l'utente aveva chiuso l'ultimo task e
34420
34446
  // poi il dialog di scelta transizione con la X, il documento restava fermo con
34421
34447
  // tutti i task chiusi e senza pulsante Procedi -- bloccato. Riaprendolo, avanza.
34448
+ UtilityService.dlog('[TASK] load_step_tasks', {
34449
+ step_mode: this.step_mode,
34450
+ stato: this.m_obj?.stato,
34451
+ tasks: this.step_tasks.length,
34452
+ tasks_all_done: this.tasks_all_done,
34453
+ b_edit: this.b_edit,
34454
+ b_saving: this.b_saving,
34455
+ btnprocedi: this.btnprocedi,
34456
+ });
34422
34457
  if (this.step_mode == 'T' &&
34423
34458
  this.tasks_all_done &&
34424
34459
  this.b_edit &&
34425
34460
  !this.b_saving &&
34426
34461
  !this.btnprocedi) {
34462
+ UtilityService.dlog('[TASK] -> avanzamento automatico: chiamo procedi()');
34427
34463
  this.procedi();
34428
34464
  }
34465
+ else if (this.step_mode == 'T' && this.tasks_all_done) {
34466
+ UtilityService.dlog('[TASK] tutti i task chiusi ma NON avanzo', {
34467
+ b_edit: this.b_edit,
34468
+ b_saving: this.b_saving,
34469
+ btnprocedi: this.btnprocedi,
34470
+ });
34471
+ }
34429
34472
  },
34430
34473
  error: () => {
34431
34474
  this.b_tasks_loading = false;
@@ -34517,13 +34560,23 @@ class FHWorkflowForm {
34517
34560
  * `tasks_all_done=true` e avanza il primo autore che apre la pratica.
34518
34561
  */
34519
34562
  close_task(task, nota) {
34563
+ UtilityService.dlog('[TASK] close_task', {
34564
+ title: task?.title,
34565
+ stato: task?.stato,
34566
+ mine: task?.mine,
34567
+ locked: task?.locked,
34568
+ });
34520
34569
  if (task == null || task.stato == 1 || task.locked)
34521
34570
  return false;
34522
- if (Number(task.mine || 0) != 1)
34571
+ if (Number(task.mine || 0) != 1) {
34572
+ UtilityService.dlog('[TASK] close_task: STOP, task non preso in carico');
34523
34573
  return false; // serve la presa in carico
34574
+ }
34524
34575
  const errs = this.ck_task(task.check_key || '');
34525
- if (errs && errs.length > 0)
34576
+ if (errs && errs.length > 0) {
34577
+ UtilityService.dlog('[TASK] close_task: STOP, ck_task', errs);
34526
34578
  return false;
34579
+ }
34527
34580
  const p = new QParam();
34528
34581
  p.sql = 'CLOSE_WKF_DOC_TASK';
34529
34582
  p.values = [