PageSourceSearch

https://rekrutacja.pedagogium.pl/pdg-irk-app/content/script/irk/pages/dokumenty/dokumentyController.js

js pedagogium.pl collected 2026-10-04 13:34:52 UTC 4,013 bytes, 89 lines download raw bytes

1(function() {
2    'use strict';
3
4    angular    
5        .module("irk")
6        .controller("DokumentyController", DokumentyController)
7
8    function DokumentyController($scope, $http, toaster, $interval, $rootScope, i18n, POLA_OBOWIAZKOWE_EVENTS) {
9        $scope.dokumenty = undefined;
10        $scope.edycjaPlikow = undefined;
11        $scope.downloadState = {inProgress: 0};
12        
13        var updateDokumenty = function() {
14            return $http.get('REST/dokumenty', {})
15              .then(function (dokumenty) {
16                  $scope.dokumenty = dokumenty.data;
17                  $scope.edycjaPlikow = $scope.dokumenty.wymaganeDokumentyKampaniiRekrutacyjnejList.some(function(kampania) {
18                      return kampania.wymaganeDokumentyNaWydzialeList.some(function(wydzial) {
19                          return wydzial.wymaganeDokumentyEtapuStudiowList.some(function(etapStudiow) {
20                              return etapStudiow.wymaganeDokumentyNaKierunkuList.some(function(proces) {
21                                  return proces.dokumentyNiedostarczone.some(function(dokument) {
22                                      return dokument.edycjaPlikow;
23                                  });
24                              });
25                          });
26                      });
27                  });
28              });
29        };
30
31        var keepAlive = $interval(function() {
32            $http.get("REST/keepalive");
33        }, 10000);
34
35        $scope.$on('$destroy', function() {
36            $interval.cancel(keepAlive);
37        });
38        
39        var getDokumentRestDtoList = function() {
40            var dtoList = [];
41            $scope.dokumenty.wymaganeDokumentyKampaniiRekrutacyjnejList.forEach(function(kampania) {
42                return kampania.wymaganeDokumentyNaWydzialeList.forEach(function(wydzial) {
43                    return wydzial.wymaganeDokumentyEtapuStudiowList.forEach(function(etapStudiow) {
44                        return etapStudiow.wymaganeDokumentyNaKierunkuList.forEach(function(proces) {
45                            return proces.dokumentyNiedostarczone.forEach(function(dokument) {
46                                if(dokument.edycjaPlikow) {
47                                    dtoList.push({
48                                        idProcesuRekrutacyjnego: proces.idProcesuRekrutacyjnego,
49                                        idDokumentu: dokument.idDokumentu,
50                                        listyPlikow: dokument.listyPlikow.map(function(listaPlikow) {
51                                            return {
52                                                idZestawu: listaPlikow.idZestawu,
53                                                nrReguly: listaPlikow.nrReguly, 
54                                                pliki: listaPlikow.pliki
55                                            };
56                                        })
57                                    });
58                                }
59                            });
60                        });
61                    });
62                });
63            });
64            return dtoList;
65        };
66        
67        $scope.trwaZapisPlikow = false;
68        
69        $scope.zapiszPliki = function() {
70            $scope.trwaZapisPlikow = true;
71            $http.post('REST/dokumenty/pliki', getDokumentRestDtoList()).then(function() {
72                $scope.trwaZapisPlikow = false;
73                i18n.get('interfejs.irk.strona.Dokumenty.ZapisanoFormularz').then(function(komunikat) {
74                    toaster.pop('success', komunikat);
75                });
76                updateDokumenty();
77                $rootScope.$broadcast(POLA_OBOWIAZKOWE_EVENTS.odswiezPolaObowiazkowe);
78            });
79        };
80        
81        $scope.isPokazDokumentyDlaMnie = function(proces) {
82            return proces.plikiDoKandydata.some(function(listaPlikow) {
83                return listaPlikow.pliki.length > 0;
84            });
85        };
86        
87        updateDokumenty();
88    }
89})();

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.