Projet

Général

Profil

Anomalie #13109

[Visa] Changement de statut non demandé si enchainement d'action

Ajouté par Laurent GIOVANNONI il y a environ 4 ans. Mis à jour il y a presque 3 ans.

Statut:
R&D - Terminé
Priorité:
1-Majeur
Assigné à:
Version cible:
Début:
03/02/2020
Echéance:
Version applicable MC:
Tags Courrier:
18.10.15, 19.04.12

Description

Sur l'écran de visa, il y a un souci si on effectue d'abord une action qui change un statut sur un premier courrier, puis sur un deuxième courrier on fait l'action par défaut (qui ne change pas de statut).

Après audit du code, je vois que la fonction close_action de apps/maarch_entreprise/js/functions.js utilise la variable JS actions_status.
hors cette dernière n'est réinitialisée que lors du rechargement de la page.
Comme via dans l'écran visa on ne recharge pas la page (page angular), du coup l'action par défaut réalisée sur un deuxième document prend le statut de l'action précédente.

voici un fix pour résoudre le souci sur la 18.10 :

/**
 * If the action has open a modal, destroy the action modal, and if this is the last action of the pile, reload the opener window
 *
 */
function close_action(id_action, page, path_manage_script, mode_req, res_id_values, tablename, id_coll) {
    var modal = $('modal_' + id_action);
    if (modal) {
        destroyModal('modal_' + id_action);
    }
    if (pile_actions.values.length == 0) {
        if (actions_status.values.length > 0) {
            var status = actions_status.values[actions_status.values.length - 1];
            action_done = action_change_status(path_manage_script, mode_req, res_id_values, tablename, id_coll, status, page);
            if (typeof window['angularSignatureBookComponent'] != "undefined") {
                actions_status.values = [];
            }
        } else {
            if (page != '' && page != NaN && page && page != null) {
                if (typeof window['angularSignatureBookComponent'] != "undefined") {
                    window.angularSignatureBookComponent.componentAfterAction();
                } else {
                    do_nothing = false;
                    window.top.location.href = page;
                }

            } else if (do_nothing == false) {
                if (typeof window['angularSignatureBookComponent'] != "undefined") {
                    window.angularSignatureBookComponent.componentAfterAction();
                } else {
                    window.top.location.hash = "";
                    window.top.location.reload();
                }


            }
            do_nothing = false;
        }

    }
}

Le code suivant inséré dans la fonction permet de reinit la variable actions_status au bon moment

if (typeof window['angularSignatureBookComponent'] != "undefined") {
                actions_status.values = [];
            }

Patch à prendre en compte à partir de la 18.10

Historique

#1 Mis à jour par Emmanuel DILLARD il y a environ 4 ans

  • Statut changé de A traiter à R&D - A planifier

#2 Mis à jour par Emmanuel DILLARD il y a environ 4 ans

  • Projet changé de Backlog à CURRENT SPRINT
  • Statut changé de R&D - A planifier à R&D - En cours
  • Version cible changé de 18.10 (support sécurité) à 20.03 (Fin de vie)
  • Tags Courrier 18.10.15, 19.04.12 ajouté

#4 Mis à jour par Florian AZIZIAN il y a environ 4 ans

  • Statut changé de R&D - En cours à R&D - Terminé

#5 Mis à jour par Emmanuel DILLARD il y a environ 4 ans

  • Projet changé de CURRENT SPRINT à Backlog

#8 Mis à jour par Emmanuel DILLARD il y a presque 3 ans

  • Projet changé de Backlog à Backlog Courrier
  • Version cible changé de 20.03 (Fin de vie) à 20.03 (Sécurité)

Formats disponibles : Atom PDF