1(function() { 2 'use strict'; 3 4 angular.module("irk").controller("kierunkiStudiowController", kierunkiStudiowController); 5 6 function kierunkiStudiowController($scope, $http, $modal, toaster) { 7 $scope.aktualneKierunki = undefined; 8 9 $http.get('REST/aktualneKierunki', {}).then(function(aktualneKierunki) { 10 $scope.aktualneKierunki = aktualneKierunki.data; 11 }); 12 13 let getKierunkiNaKtoreMoznaPrzeniescDokumentyZProcesu = function(procesZrodlowy) { 14 let kierunki = []; 15 for(let kampania of $scope.aktualneKierunki.aktualneKampanieRekrutacyjneList) 16 { 17 for(let wydzial of kampania.aktualneWydzialyList) 18 { 19 for(let etap of wydzial.aktualneEtapyStudiowList) 20 { 21 for(let proces of etap.aktualnyKierunekList) 22 { 23 if(proces.stanKandydata == 'ZAKWALIFIKOWANY' 24 && procesZrodlowy.idProcesuRekrutacyjnego != proces.idProcesuRekrutacyjnego) 25 { 26 kierunki.push({ 27 label: etap.title + " - " + proces.nazwaKierunku, 28 idProcesu: proces.idProcesuRekrutacyjnego 29 }); 30 } 31 } 32 } 33 } 34 } 35 return kierunki; 36 }; 37 38 let isKandydatPrzyjetyTylkoNaJedenKierunek = function() { 39 let licznik = 0; 40 for(let kampania of $scope.aktualneKierunki.aktualneKampanieRekrutacyjneList) { 41 for(let wydzial of kampania.aktualneWydzialyList) { 42 for(let etap of wydzial.aktualneEtapyStudiowList) { 43 for(let proces of etap.aktualnyKierunekList) { 44 if(proces.stanKandydata == 'PRZYJETY') { 45 licznik++; 46 if(licznik > 1){ 47 return false; 48 } 49 } 50 } 51 } 52 } 53 } 54 if(licznik == 1) { 55 return true; 56 } 57 return false; 58 } 59 60 /** 61 * Otworzenie dialogu z formularzem rezygnacji z procesu. 62 */ 63 $scope.openRezygnacjaKandydata = function(proces) { 64 $modal.open({ 65 animation : true, 66 templateUrl: 'rezygnacjaKandydata.html', 67 controller: 'RezygnacjaKandydataController', 68 resolve: { 69 proces: function() { 70 return proces; 71 }, 72 kierunkiNaKtoreMoznaPrzeniescDokumenty: function() { 73 return getKierunkiNaKtoreMoznaPrzeniescDokumentyZProcesu(proces); 74 }, 75 kandydatPrzyjetyTylkoNaJedenKierunek: function() { 76 return isKandydatPrzyjetyTylkoNaJedenKierunek(); 77 } 78 } 79 }); 80 }; 81 82 /** 83 * ZgÅoszenie procesu przez kandydata. 84 */ 85 $scope.zglosProces = function(proces, confirmMsg) { 86 if(!confirm(confirmMsg)) { 87 return; 88 } 89 $http.post('REST/zgloszenieKandydata/'+proces.idProcesuRekrutacyjnego).then(function(result) { 90 var wynik = result.data; 91 var bledy = wynik.bledy.length > 0; 92 if(bledy) 93 { 94 toaster.pop("error", wynik.bledy.join(', ')); 95 return; 96 } 97 proces.stanKandydata = wynik.nowyStan; 98 proces.stanKandydataI18n = wynik.nowyStanI18n; 99 proces.moznaZglosic = false; 100 }); 101 }; 102 } 103 104 angular.module("irk").directive("kierunkiStudiowComponent", kierunkiStudiowComponent); 105 106 function kierunkiStudiowComponent() { 107 return { 108 restrict : "E", 109 replace : true, 110 transclude : true, 111 templateUrl : "irk.auth.stronaglowna.KierunkiStudiowComponent" 112 } 113 } 114})();
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.