--- /dev/null
+(function() {
+ "use strict";
+
+ angular.module("nero.app.gestionApps").controller("WarningDiffuseController",
+ WarningDiffuseController);
+
+ WarningDiffuseController.$inject = [ "$uibModalInstance", "$uibModal", "toastr", "$timeout", "currentApp" ];
+
+ function WarningDiffuseController($uibModalInstance, $uibModal, toastr, $timeout, currentApp ) {
+
+ var vm = this;
+
+
+
+ vm.currentApp = JSON.parse(JSON.stringify(currentApp));
+
+ vm.currentApp.profil = [];
+
+ vm.saveNoDiffusion = saveNoDiffusion;
+
+
+ vm.closeWarningModal = closeWarningModal;
+
+ for (var i = 0 ; i < vm.currentApp.rules.length ; i++){
+ var rule = vm.currentApp.rules[i];
+
+ for (var j =0 ; j < rule.roles.length ; j++){
+ if(!rule.roles[j].isForClass){
+ vm.currentApp.profil.push(rule.roles[j].displayText);
+ vm.currentApp.profil.toString();
+ break;
+ }
+ }
+
+ }
+
+
+ function saveNoDiffusion(){
+
+ $uibModalInstance.close();
+
+ }
+
+
+
+ /**
+ * On cancel (close clicked)
+ */
+ function closeWarningModal() {
+
+ $uibModalInstance.dismiss("cancel");
+ }
+
+ }
+})();