1(function() { 2 'use strict'; 3 4 angular 5 .module('irk') 6 // TODO #5586 przenieÅÄ filtr sanitize do osobnego pliku 7 .controller('OswiadczeniaController', OswiadczeniaController); 8 9 function OswiadczeniaController($scope, toaster, i18n, $http, $window) { 10 $scope.typyAnkietPytanDodatkowych = ['OSWIADCZENIA_I_ZGODY_OBOWIAZKOWE']; 11 $scope.bledneOswiadczenia = []; 12 $scope.istniejaZgody = undefined; 13 $scope.oswiadczeniaKandydata = undefined; 14 $http.get('REST/pytaniadodatkowe/pule', { 15 params: {typPuliTestow: ['OSWIADCZENIA_I_ZGODY_OBOWIAZKOWE']} 16 }).then(function(res) { 17 $scope.istniejaZgody = res.data.length > 0; 18 }); 19 var getOswiadczeniaKandydata = function() { 20 $http 21 .get('REST/oswiadczeniaKandydata', {}) 22 .then(function (res) { 23 $scope.oswiadczeniaKandydata = res.data; 24 }); 25 }; 26 getOswiadczeniaKandydata(); 27 28 29 $scope.zapiszOswiadczenia = function() { 30 var zaakceptowaneOswiadczenia = []; 31 angular.forEach($scope.oswiadczeniaKandydata, function(oswiadczenie) { 32 if(oswiadczenie.wyrazonoZgode) { 33 zaakceptowaneOswiadczenia.push(oswiadczenie.wymaganeOswiadczenie.oswiadczenieKey); 34 } 35 }); 36 $http 37 .post('REST/oswiadczeniaKandydata', { 38 zaakceptowaneOswiadczenia: zaakceptowaneOswiadczenia 39 }) 40 .then(function (res) { 41 console.debug($scope.bledneOswiadczenia); 42 $scope.bledneOswiadczenia = res.data; 43 if($scope.bledneOswiadczenia.length == 0) { 44 i18n.get('interfejs.irk.strona.Oswiadczenia.SaveOK').then(function(komunikat) { 45 toaster.pop('success', komunikat); 46 }).finally(function(){ 47 $window.location.reload(); 48 }); 49 } 50 else { 51 i18n.get('interfejs.irk.strona.Oswiadczenia.SaveError').then(function(komunikat) { 52 toaster.pop('error', komunikat); 53 }); 54 } 55 }); 56 } 57 58 } 59})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.