﻿(function() {
    if (typeof (this.ModuleSchedulePublic.Intervention) == "undefined") {
    this.ModuleSchedulePublic.Intervention = {};
    }

    // Affichage de la fenêtre modale du détail d'une intervention
    ModuleSchedulePublic.Intervention.DisplayIntervention = function(interventionAbout, interventionTitle) {
        dojo.require("dijit.Dialog");

        // destruction de l'ancien composant, le cas échéant
        dojo.query("body > div#ModuleSchedulePublicInterventionModalWindow").forEach(
                    function(tag) {
                        if (typeof (dijit.byNode(tag)) != "undefined") {
                            dijit.byNode(tag).destroy();
                        }
                    });

        // création de la fenetre
        var InterventionModalWindow = new dijit.Dialog({ id: "ModuleSchedulePublicInterventionModalWindow",
            autofocus: false,
            href: "DisplayPresentation.phtml?interventionAbout=" + interventionAbout + "&random=" + Math.random()
        });
        InterventionModalWindow.show();
        InterventionModalWindow.titleNode.innerHTML = interventionTitle;
    }

})();