123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539 |
- if (!URL_TABLE_POWIAZANIA) throw "Brak URL_TABLE_POWIAZANIA";
- if (!BASE_URLS) {
- throw "Brak BASE_URLS"
- }
- console.log('BASE_URLS',BASE_URLS);
- $(window).on('hashchange', function() {
- initLocalStorage();
- rootChangeForm();
- });
- function urlFetchKontrahenciPowiazania() {
-
- fetch(URL_FETCH_KONTRAHENCI_POWIAZANIA, {
- credentials: 'same-origin'
- })
- .then(function parseJSON(response) {
- return response.json()
- })
- .then(function(data) {
- var reaportItemsKontrahenciPowiazani = null;
- data.body.items.forEach (function(row) {
- reaportItemsKontrahenciPowiazani += '<tr><td><input type="checkbox" name="kontrID[]" value="'+row['ID']+'" /></td>'+
- '<td align="right">'+row["ID"]+'</td>';
- });
- $( "#body-reaport-kontrahenci-powiazani-tree" ).html(reaportItemsKontrahenciPowiazani);
- }).catch(function(error) {
- console.log('request failed', error)
- });
- }
- function loadCurrentDepthInInput(idInput) {
- var depthValue = getItemLocalStorage('Bocian.biAuditForm.depth');
- $(idInput).val(function() {
- return depthValue;
- });
- }
- function updateLocalStorageBiAuditDepth(idInput) {
- $(idInput).keyup(function() {
- delayUpdate(function(){
- var newValue = $(idInput).val();
- var responseValue = validateValueDepth(parseInt(newValue));
- setItemLocalStorage('Bocian.biAuditForm.depth', responseValue);
- loadCurrentDepthInInput('.smad-depth');
- }, 1000 );
- });
- }
- function validateValueDepth(newValue) {
- var value = null;
- value = newValue;
- if (parseInt(newValue) < 0) {
- value = 1;
- }
- if (parseInt(newValue) > 16) {
- value = 16;
- }
- return value;
- }
- var delayUpdate = (function() {
- var timer = 0;
- return function(callback, ms) {
- clearTimeout (timer);
- timer = setTimeout(callback, ms);
- };
- })();
- function initLocalStorage() {
- if (getItemLocalStorage('Bocian.biAuditForm.pracownicyIds') === null) {
- setItemLocalStorage('Bocian.biAuditForm.pracownicyIds', []);
- }
- if (getItemLocalStorage('Bocian.biAuditForm.kontrahenciIds') === null) {
- setItemLocalStorage('Bocian.biAuditForm.kontrahenciIds', []);
- }
- setItemLocalStorage('Bocian.biAuditForm.pracownicy.filterIdGroup', 0);
- setItemLocalStorage('Bocian.biAuditForm.kontrahenci.filterIdGroup', 0);
- if (getItemLocalStorage('Bocian.biAuditForm.depth') === null) {
- updateLocalStorageBiAuditDepth(7);
- }
- }
- function showViewUploadFile( event, headerTitle, enumType, showCheckbox, csvFileExample ) {
- event.preventDefault();
- var enumType = enumType;
- if( csvFileExample !== undefined) {
- csvFileExample = '<div><a href="'+csvFileExample+'" title="Pobierz przykład" download target="_balnk">Pobierz przykład</a></div>';
- }
- swal({
- title: 'Importuj plik csv',
- input: 'file',
- html: csvFileExample,
- inputAttributes: {
- 'accept': 'text/csv',
- 'aria-label': 'Upload csv file'
- },
- confirmButtonText: 'Importuj',
- preConfirm: function (file) {
- return new Promise(function (resolve, reject) {
- if (!file) {
- reject("Proszę wybrać plik csv");
- return
- }
- var input = document.querySelector('input[type="file"]');
- var data = new FormData()
- data.append('file', input.files[0])
- data.append('showCheckbox', showCheckbox);
- var responseParseFile = parseCsvFile( data, enumType );
- resolve('file imported')
- })
- },
- }).then(function (result) {
- console.log('result', result)
- }).catch(function (e) {
- console.log('catch: ', e)
- });
- }
- function parseCsvFile( fileData, enumType ) {
- event.preventDefault();
- console.log( 'parseCsvFile fileData', fileData);
- fetch(URL_FORM_DATA_CSV_FILE_AJAX, {
- method: 'POST',
- credentials: 'same-origin',
- body: fileData
- })
- .then(function(response) {
- return response.json()
- }).then(function(json) {
- swal({
- title: 'Dane załadowane z pliku CSV',
- html: json.body.view,
- width: Math.round(window.innerWidth * 0.9),
- allowOutsideClick: false,
- showCloseButton: true,
- confirmButtonText: 'Zapisz',
- preConfirm: function (dataForm) {
- return new Promise(function (resolve, reject) {
- if (!dataForm) {
- reject("Formularz nie zawiera danych do zapisania");
- return
- }
-
- var responseSaveData = saveFormCsvFileAjaxAction(enumType);
- resolve('data save from form')
- })
- },
- }).then(function (result) {
- console.log('result', result)
- }).catch(function (e) {
- console.log('catch: ', e)
- });
- }).catch(function(ex) {
- console.log('parsing failed', ex)
- });
- }
- function saveFormCsvFileAjaxAction(enumType) {
- event.preventDefault();
- var formDataFrom = $("#formDataFromCsv").serialize();
- formDataFrom = formDataFrom.replace(/%5B/g,"[");
- formDataFrom = formDataFrom.replace(/%5D/g,"]");
- console.log('dane z formularza formDataFrom ', formDataFrom );
- fetch(URL_SAVE_FORM_CSV_FILE_AJAX, {
- method: 'POST',
- credentials: 'same-origin',
- headers: {
- 'Content-Type': 'application/json'
- },
- body: JSON.stringify({
- formData: formDataFrom,
- enumType: enumType
- })
- })
- .then(function(response) {
- return response.json()
- }).then(function(json) {
- console.log('parsed json', json)
- if (response.type == 'success') {
- p5UI__notifyAjaxCallback(response.msg);
- }
-
- }).catch(function(ex) {
- console.log('parsing failed', ex)
- });
- }
- function defaultBIAuditLocalStorage() {
- localStorage.removeItem('Bocian.biAuditForm.pracownicyIds');
- localStorage.removeItem('Bocian.biAuditForm.kontrahenciIds');
- setItemLocalStorage('Bocian.biAuditForm.pracownicy.pagination.page', 1);
- setItemLocalStorage('Bocian.biAuditForm.kontrahenci.pagination.page', 1);
- setItemLocalStorage('Bocian.biAuditForm.pracownicy.filterIdGroup', 0);
- setItemLocalStorage('Bocian.biAuditForm.kontrahenci.filterIdGroup', 0);
- setItemLocalStorage('Bocian.biAuditForm.depth', 7);
- }
- function generateBiAuditRaport(event) {
- event.preventDefault();
- var pracownicyIdsArray = getItemLocalStorage('Bocian.biAuditForm.pracownicyIds');
- var kontrahenciIdsArray = getItemLocalStorage('Bocian.biAuditForm.kontrahenciIds');
- var depthValue = getItemLocalStorage('Bocian.biAuditForm.depth');
-
- if (!depthValue || depthValue === 0) {
- p5UI__notifyAjaxCallback({ type: 'error', msg: 'Nie podano wartości dla głębokości powiązań' });
- } else if (!pracownicyIdsArray || pracownicyIdsArray.length === 0) {
- p5UI__notifyAjaxCallback({ type: 'error', msg: 'Nie wybrano pracowników' });
- } else if (!kontrahenciIdsArray || kontrahenciIdsArray.length === 0) {
- p5UI__notifyAjaxCallback({ type: 'error', msg: 'Nie wybrano kontrahentów' });
- } else {
-
- window.fetch(URL_GENERATE_BI_AUDIT_RAPORT_AJAX, {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- credentials: 'same-origin',
- body: JSON.stringify({
- pracownicyIds: pracownicyIdsArray,
- kontrahenciIds: kontrahenciIdsArray,
- depthValue: depthValue
- })
- })
- .then(function(response) {
- console.log('Firsst then', response);
- return response.text();
- })
- .then(function(responseText) {
- try {
- return JSON.parse(responseText);
- } catch (e) {
- throw responseText;
- }
- })
- .then(function(result) {
- if (result.type == 'success') {
- p5UI__notifyAjaxCallback(result);
- defaultBIAuditLocalStorage();
- window.setTimeout(URL_TABLE_POWIAZANIA, 6000);
- resolve(result.msg);
- } else {
- reject(result.msg);
- }
- })
- .catch(function(error) {
- console.log('request failed', error)
- });
- }
- }
- function addPracownikToGroup(event) {
- event.preventDefault();
- var pracownicyIdsArray = getItemLocalStorage('Bocian.biAuditForm.pracownicyIds');
- console.log(pracownicyIdsArray);
- if (pracownicyIdsArray === null) {
- showTextListIdPracownikow = 'ID pracowników: nie wybrano';
- } else {
- showTextListIdPracownikow = 'ID pracowników: ' + pracownicyIdsArray;
- }
- var arrayGroupOptions = [];
- var listGroupStorage = getItemLocalStorage('Bocian.biAuditForm.pracownicy.groups');
-
- listGroupStorage.map(function(item) {
- if (item.ID !== undefined) {
- arrayGroupOptions[item.ID] = item.NAZWA;
- }
- });
- swal({
- title: 'Przenieś do grupy',
- input: 'select',
- text: showTextListIdPracownikow,
- inputOptions: arrayGroupOptions,
- inputPlaceholder: 'Wybierz grupę',
- showCancelButton: true,
- confirmButtonText: 'Zapisz',
- showLoaderOnConfirm: true,
- preConfirm: function (idGroup) {
- return new Promise(function (resolve, reject) {
- console.log('idGrupy value', idGroup);
- if ( !pracownicyIdsArray || pracownicyIdsArray === null || pracownicyIdsArray === 'undefined' ) {
- reject('Wybierz pracowników');
- } else if ( pracownicyIdsArray.length === 0 ) {
- reject('Wybierz pracowników');
- }
- if (!idGroup) reject('Proszę wybrać nazwę grupy');
- window.fetch(URL_ADD_PRACOWNICY_TO_GROUP, {
- method: 'POST',
- header: {
- 'contentType': 'applications/json'
- },
- credentials: 'same-origin',
- body: JSON.stringify({
- 'idGroup': idGroup,
- 'pracownicyIds': getItemLocalStorage('Bocian.biAuditForm.pracownicyIds'),
- })
- })
- .then(function(response) {
- return response.text();
- })
- .then(function(responseText) {
- try {
- return JSON.parse(responseText);
- } catch (e) {
- throw responseText;
- }
- })
- .then(function(result) {
- if (result.type == 'success') {
- p5UI__notifyAjaxCallback(result);
- resolve(result.msg);
- } else {
- reject(result.msg);
- }
- })
- .catch(function(error) {
- console.log('request failed', error)
- });
- })
- },
- allowOutsideClick: false
- }).then(function (groupPracownicyData) {
-
- });
- }
- function addKontrahenciToGroup(event) {
- event.preventDefault();
- var kontrahenciIdsArray = getItemLocalStorage('Bocian.biAuditForm.kontrahenciIds');
- if (kontrahenciIdsArray === null) {
- showTextListIdKontrahentow = 'ID kontrahentów: nie wybrano';
- } else {
- showTextListIdKontrahentow = 'ID kontrahentów: ' + kontrahenciIdsArray;
- }
- var arrayGroupOptions = [];
- var listGroupStorage = getItemLocalStorage('Bocian.biAuditForm.kontrahenci.groups');
-
- listGroupStorage.map(function(item) {
- if (item.ID !== undefined) {
- arrayGroupOptions[item.ID] = item.NAZWA;
- }
- });
- swal({
- title: 'Przenieś do grupy',
- input: 'select',
- text: showTextListIdKontrahentow,
- inputOptions: arrayGroupOptions,
- inputPlaceholder: 'Wybierz grupę',
- showCancelButton: true,
- confirmButtonText: 'Zapisz',
- showLoaderOnConfirm: true,
- preConfirm: function (idGroup) {
- return new Promise(function (resolve, reject) {
- if (!idGroup) reject('Proszę wybrać nazwę grupy');
- if ( !kontrahenciIdsArray || kontrahenciIdsArray === null || kontrahenciIdsArray === 'undefined' ) {
- reject('Wybierz kontrahentów');
- } else if ( kontrahenciIdsArray.length === 0 ) {
- reject('Wybierz kontrahentów');
- }
- window.fetch(URL_ADD_KONTRAHENCI_TO_GROUP, {
- method: 'POST',
- header: {
- 'contentType': 'applications/json'
- },
- credentials: 'same-origin',
- body: JSON.stringify({
- 'idGroup': idGroup,
- 'kontrahenciIds': getItemLocalStorage('Bocian.biAuditForm.kontrahenciIds'),
- })
- })
- .then(function(response) {
- return response.text();
- })
- .then(function(responseText) {
- try {
- return JSON.parse(responseText);
- } catch (e) {
- throw responseText;
- }
- })
- .then(function(result) {
- result
- if (result.type == 'success') {
- p5UI__notifyAjaxCallback(result);
- resolve(result.msg);
- } else {
- reject(result.msg);
- }
- })
- ;
- })
- },
- allowOutsideClick: false
- }).then(function (groupKontrahenciData) {
-
- });
- }
- function createGroupKontrahenci(event) {
- event.preventDefault();
- swal({
- title: 'Utwórz grupę',
- input: 'text',
- showCancelButton: true,
- confirmButtonText: 'Zapisz',
- showLoaderOnConfirm: true,
- preConfirm: function (NAZWA) {
- return new Promise(function (resolve, reject) {
- if (!NAZWA) reject('Proszę podać nazwę grupy');
- window.fetch(URL_CREATE_KONTRAHENCIS_GROUP, {
- method: 'POST',
- header: {
- 'contentType': 'applications/json'
- },
- credentials: 'same-origin',
- body: JSON.stringify({
- 'NAZWA': NAZWA
- })
- })
- .then(function(response) {
- return response.text();
- })
- .then(function(responseText) {
- try {
- return JSON.parse(responseText);
- } catch (e) {
- throw responseText;
- }
- })
- .then(function(result) {
- if (result.type == 'success') {
- p5UI__notifyAjaxCallback(result);
- resolve(result.body);
- } else {
- reject("Proszę podać inną nazwę grupy");
- }
- })
- .catch(function(error) {
- console.log('request failed', error)
- })
- })
- },
- allowOutsideClick: false
- }).then(function (groupKontrahenciData) {
-
- groupsKontrahenci = '<button class="btn btn-default" title="'+groupKontrahenciData['nazwa']+'" data-group-filter="'+groupKontrahenciData['id']+'">'+groupKontrahenciData['nazwa']+'</button>';
- $('#group-kontrahenci').append(groupsKontrahenci);
- });
- }
- function createGroupPracownicy(event) {
- event.preventDefault();
- swal({
- title: 'Utwórz grupę',
- input: 'text',
- showCancelButton: true,
- confirmButtonText: 'Zapisz',
- showLoaderOnConfirm: true,
- preConfirm: function (NAZWA) {
- return new Promise(function (resolve, reject) {
- if (!NAZWA) reject('Proszę podać nazwę grupy');
- window.fetch(URL_CREATE_PRACOWNICY_GROUP, {
- method: 'POST',
- header: {
- 'contentType': 'applications/json'
- },
- credentials: 'same-origin',
- body: JSON.stringify({
- 'NAZWA': NAZWA
- })
- })
- .then(function(response) {
- return response.text();
- })
- .then(function(responseText) {
- try {
- return JSON.parse(responseText);
- } catch (e) {
- throw responseText;
- }
- })
- .then(function(result) {
- if (result.type == 'success') {
- console.log('grupa prac1: ', result);
- p5UI__notifyAjaxCallback(result);
- resolve(result.body);
- } else {
- reject("Proszę podać inną nazwę grupy");
- }
- })
- .catch(function(error) {
- console.log('request failed', error)
- })
- })
- },
- allowOutsideClick: false
- }).then(function (groupPracownicyData) {
- console.log('grupa prac2: ', groupPracownicyData);
-
- groupsPracownicy = '<button class="btn btn-default" title="'+groupPracownicyData['nazwa']+'" data-group-filter="'+groupPracownicyData['id']+'">'+groupPracownicyData['nazwa']+'</button>';
- $('#group-pracownicy').append(groupsPracownicy);
- });
- }
- function rootChangeForm() {
- urlFetchKontrahenciPowiazania();
- var valueUrl = global.location.hash;
- console.log('URL', valueUrl);
- switch (valueUrl) {
- case '#KONTRAHENCI':
- $( ".container-bi_audit_form_kontrahenci_raport" ).html( VIEW_KONTRAHENCI );
- urlFetchKontrahenci(1);
- fetchGroupKontrahenci();
- $( ".container-bi_audit_form_pracownicy_raport" ).hide();
- $( ".container-bi_audit_form_kontrahenci_raport" ).show();
- break;
- case '#PRACOWNICY':
- $( ".container-bi_audit_form_pracownicy_raport" ).html( VIEW_PRACOWNICY );
- urlFetchPracownicy(1);
- fetchGroupPracownicy();
- $( ".container-bi_audit_form_kontrahenci_raport" ).hide();
- $( ".container-bi_audit_form_pracownicy_raport" ).show();
- break;
-
-
-
-
-
-
-
- default:
- $( ".container-bi_audit_form_pracownicy_raport" ).html( VIEW_PRACOWNICY );
- urlFetchPracownicy(1);
- fetchGroupPracownicy();
- $( ".container-bi_audit_form_kontrahenci_raport" ).hide();
- $( ".container-bi_audit_form_pracownicy_raport" ).show();
- break;
- }
-
- loadCurrentDepthInInput('.smad-depth');
- updateLocalStorageBiAuditDepth('.smad-depth');
- }
- function getAddressData(objectValue) {
- var objectValue = objectValue || [];
- var listData = '';
- if (!objectValue) {
- return true;
- }
- objectValue.forEach (function(item) {
- if (item['kodPocztowy']) { listData += '<div>kod pocztowy: ' + item['kodPocztowy'] + '<div>'; }
- if (item['miejscowosc']) { listData += '<div>miejscowość: ' + item['miejscowosc'] + '<div>'; }
- if (item['nrBudynku']) { listData += '<div>nr budynku: ' + item['nrBudynku'] + '<div>'; }
- if (item['nrLokalu']) { listData += '<div>nr lokalu: ' + item['nrLokalu'] + '<div>'; }
- if (item['typAdresu']) { listData += '<div>typ adresu: ' + item['typAdresu'] + '<div>'; }
- if (item['ulica']) { listData += '<div>ulica: ' + item['ulica'] + '<div>'; }
- listData += '<div>------<div>';
- });
- return listData;
- }
- function getNameGroupById(store, filterIdGroup) {
- var NAZWA = '';
- if (!store || filterIdGroup === 0 ) {
- NAZWA = 'Wszyscy';
- } else {
- $(store).each(function() {
- if ( parseInt(filterIdGroup) === parseInt(this.ID) ) {
- NAZWA = this.NAZWA;
- }
- });
- }
- return NAZWA;
- }
- function urlFetchKontrahenci(page) {
- var page = page || getItemLocalStorage('Bocian.biAuditForm.kontrahenci.pagination.page');
- selectPage('KONTRAHENCI', page);
- if ( page === 1) {
- setItemLocalStorage('Bocian.biAuditForm.kontrahenci.pagination.page', 1);
- }
- var filterIdGroup = getItemLocalStorage('Bocian.biAuditForm.kontrahenci.filterIdGroup');
- fetch(URL_FETCH_KONTRAHENCI + '&page=' + page + '&filterIdGroup=' + filterIdGroup, {
- credentials: 'same-origin'
- })
- .then(function parseJSON(response) {
- return response.json()
- var filterIdGroup = filterIdGroup || getItemLocalStorage('Bocian.biAuditForm.kontrahenci.filterIdGroup');
- })
- .then(function(data) {
- var listItemsKontrahenci = null;
- data.body.items.forEach (function(row) {
- listItemsKontrahenci += '<tr><td><input type="checkbox" name="kontrID[]" value="'+row['ID']+'" /></td>'+
- '<td align="right">'+row["ID"]+'</td>'+
- '<td align="right">'+row["Nazwa_grupy_kapitalowej"]+'</td>'+
- '<td align="right">'+row["Pelna_nazwa_kontrahenta"]+'</td>'+
- '<td align="right">'+row["Numer_kontrahenta"]+'</td>'+
- '<td align="right">'+row["Skrocona_Nazwa_Kontrahenta"]+'</td>'+
- '<td align="right">'+row["Typ_kontrahenta"]+'</td>'+
- '<td align="right">'+row["NIP"]+'</td>'+
- '<td align="right">'+row["KRS"]+'</td>'+
- '<td align="right">'+row["REGON"]+'</td>'+
- '<td align="right">'+row["PESEL"]+'</td>'+
- '<td align="right">'+row["Forma_prawna_dzialalnosci"]+'</td>'+
- '<td align="right">'+row["Ulica"]+'</td>'+
- '<td align="right">'+row["Numer_budynku"]+'</td>'+
- '<td align="right">'+row["Numer_mieszkania_lokalu"]+'</td>'+
- '<td align="right">'+row["Miejscowosc"]+'</td>'+
- '<td align="right">'+row["Kod_pocztowy"]+'</td>'+
- '<td align="right">'+row["Kraj"]+'</td>'+
- '<td align="right">'+row["Telefon"]+'</td>'+
- '<td align="right">'+row["Fax"]+'</td>'+
- '<td align="right">'+row["Mail"]+'</td>'+
- '<td align="right">'+row["A_ADM_COMPANY"]+'</td>'+
- '<td align="right">'+row["A_CLASSIFIED"]+'</td>'+
- '<td align="right">'+row["Dodano"]+'</td>'+
- '<td align="right">'+row["Podmiot_dominujacy"]+'</td>'+
- '<td align="right">'+row["Tytul_dokumentu"]+'</td>'+
- '<td align="right">'+row["ownCompany"]+'</td>'+
- '<td align="right">'+row["uwagi"]+'</td></tr>';
- });
- if (data.body.pagination !== undefined) {
- Pagination.Init(document.getElementById('pagination-kontrahenci'), {
- url: BASE_URLS+'index.php?_route=UrlAction_Bocian#KONTRAHENCI',
- id_pagination: 'pagination-kontrahenci',
- type: 'KONTRAHENCI',
- limit: data.body.pagination.limit,
- total_items: data.body.pagination.total_items,
- size: data.body.pagination.size,
- page: page,
- step: 1
- });
- var paginationShowNextCount = 1;
- if ( parseInt(data.body.pagination.current) !== 1) {
- paginationShowNextCount = parseInt(data.body.pagination.limit) * (parseInt(data.body.pagination.current) - 1 ) + 1;
- }
- $('#paginationShowNextCount-KONTRAHENCI').text(paginationShowNextCount);
- $('#smad-filter-desc-kontrahenci').text(data.body.pagination.total_items);
- }
- var groupSelectData = getNameGroupById(getItemLocalStorage('Bocian.biAuditForm.kontrahenci.groups'), filterIdGroup);
- $('#smad-filter-head-title-kontrahenci').text(groupSelectData);
- console.log('kontrahenci groupSelectData: ', groupSelectData);
- $( "#body-kontrahenci" ).html(listItemsKontrahenci);
- checkAll('KONTRAHENCI');
- catchEventCheckbox('KONTRAHENCI');
- checkedChoiseItems('KONTRAHENCI', getItemLocalStorage('Bocian.biAuditForm.kontrahenciIds') );
-
- console.log('request succeeded with JSON responseKontrahenci', data)
- }).catch(function(error) {
- console.log('request failed', error)
- })
- }
- function urlFetchPracownicy(page) {
- var page = page || getItemLocalStorage('Bocian.biAuditForm.pracownicy.pagination.page');
- if ( page === 1) {
- setItemLocalStorage('Bocian.biAuditForm.pracownicy.pagination.page', 1);
- }
- var filterIdGroup = getItemLocalStorage('Bocian.biAuditForm.pracownicy.filterIdGroup');
- selectPage('PRACOWNICY', page);
- fetch(URL_FETCH_PRACOWNICY + '&page=' + page + '&filterIdGroup=' + filterIdGroup, {
- credentials: 'same-origin'
- })
- .then(function parseJSON(response) {
- return response.json()
- })
- .then(function(data) {
- var addresPerson = '';
- var listItemsPracownik = null;
- console.log('urlFetchPracownicy', data.body.items);
- data.body.items.forEach (function(row) {
- if (row["default_db__x3A__BI_audit_ENERGA_PRACOWNICY_adresy:BI_audit_ENERGA_PRACOWNICY_adresy"]) {
- addresPerson = getAddressData(row["default_db__x3A__BI_audit_ENERGA_PRACOWNICY_adresy:BI_audit_ENERGA_PRACOWNICY_adresy"]);
- }
- listItemsPracownik += '<tr><td><input type="checkbox" name="prID[]" value="'+row['ID']+'" /></td>'+
- '<td align="right">'+row["ID"]+'</td>'+
- '<td align="right">'+row["imiona"]+'</td>'+
- '<td align="right">'+row["nazwisko"]+'</td>'+
- '<td align="right">'+row["nip"]+'</td>'+
- '<td align="right">'+row["pesel"]+'</td>'+
- '<td align="right">'+row["regon"]+'</td>'+
- '<td align="right">'+row["source"]+'</td>'+
- '<td align="right">'+row["A_ADM_COMPANY"]+'</td>'+
- '<td align="right">'+row["A_CLASSIFIED"]+'</td>'+
- '<td align="right">'+row["A_STATUS"]+'</td>'+
- '<td align="right">'+row["A_STATUS_INFO"]+'</td>'+
- '<td align="right">'+row["L_APPOITMENT_USER"]+'</td>'+
- '<td align="right">'+ addresPerson +'</td></tr>';
- });
- if (data.body.pagination.size) {
- Pagination.Init(document.getElementById('pagination-pracownicy'), {
- url: BASE_URLS+'index.php?_route=UrlAction_Bocian#PRACOWNICY',
- id_pagination: 'pagination-pracownicy',
- type: 'PRACOWNICY',
- limit: data.body.pagination.limit,
- total_items: data.body.pagination.total_items,
- size: data.body.pagination.size,
- page: data.body.pagination.current,
- step: 1
- });
- var paginationShowNextCount = 1;
- if ( parseInt(data.body.pagination.current) !== 1) {
- paginationShowNextCount = parseInt(data.body.pagination.limit) * (parseInt(data.body.pagination.current) - 1 ) + 1;
- }
- $('#paginationShowNextCount-PRACOWNICY').text(paginationShowNextCount);
- $('#smad-filter-desc-pracownicy').text(data.body.pagination.total_items);
- }
-
- var groupSelectData = getNameGroupById(getItemLocalStorage('Bocian.biAuditForm.pracownicy.groups'), filterIdGroup);
- $('#smad-filter-head-title-pracownicy').text(groupSelectData);
-
- $( "#body-pracownicy" ).html( listItemsPracownik);
- checkAll('PRACOWNICY');
- catchEventCheckbox('PRACOWNICY');
- checkedChoiseItems('PRACOWNICY', getItemLocalStorage('Bocian.biAuditForm.pracownicyIds') );
- }).catch(function(error) {
- console.log('request failed', error)
- })
- }
- function selectPage(type, nrPage) {
- var type = type.toLowerCase();
- $('#pagination-' + type + ' ul li a').each(function(index, value){
- if (this.text === nrPage) {
- $(this).addClass('active');
- } else {
- $(this).removeClass('active');
- }
- });
- }
- function checkAll(type) {
- $('#checkAll-' + type).change(function() {
- var valueCheckbox = null;
- var checkboxes = $('form').find(':checkbox');
- if($(this).prop('checked')) {
- checkboxes.prop('checked', true);
-
- var allValsChecked = [];
- var checkedValues = $('#smad-table-' + type + ' input:checkbox:checked').map(function() {
- if (this.value !== 'on') {
- allValsChecked.push(parseInt(this.value));
- }
- }).get();
- updateListIdBiAuditReaport(type, allValsChecked);
- } else {
- checkboxes.prop('checked', false);
- var allValsUnChecked = [];
- var checkedValues = $('#smad-table-' + type + ' input:checkbox:not(:checked)').map(function() {
- if (this.value !== 'on') {
- allValsUnChecked.push(parseInt(this.value));
- }
- }).get();
- deleteListIdBiAuditReaport(type, allValsUnChecked);
- }
-
- updateCountItemCheckedByType(type.toLowerCase());
- });
- }
- function checkedChoiseItems(type, store) {
- updateCountItemCheckedByType(type.toLowerCase());
- var idElement = 'smad-table-' + type;
-
- if (document.getElementById(idElement)) {
-
- if (!store) {
- return false;
- }
-
- for (i = 0; i < store.length; i++) {
- $('#body-'+type.toLowerCase() +' input[type=checkbox] ').map(function(k, v) {
- if ( store[i] === parseInt(this.value) ){
- $(this).prop('checked', true);
- }
- }).get();
- }
- }
- $('#smad-table-' + type + ' input[type=checkbox]').on( 'load', function() {
- var itemsCHecked = getItemLocalStorage('Bocian.biAuditForm.pracownicyIds');
- getItemLocalStorage('Bocian.biAuditForm.kontrahenciIds');
- if (itemsCHecked.lenght === 0 ) {
- return;
- }
- var valueCheckbox = null;
- var checkboxes = $('form').find(':checkbox');
- if($(this).prop('checked')) {
- checkboxes.prop('checked', true);
- var allValsChecked = [];
- var checkedValues = $('#smad-table-' + type + ' input:checkbox:checked').map(function() {
- if (this.value !== 'on') {
- allValsChecked.push(parseInt(this.value));
- }
- }).get();
- updateListIdBiAuditReaport(type, allValsChecked);
- } else {
- checkboxes.prop('checked', false);
- var allValsUnChecked = [];
- var checkedValues = $('#smad-table-' + type + ' input:checkbox:not(:checked)').map(function() {
- if (this.value !== 'on') {
- allValsUnChecked.push(parseInt(this.value));
- }
- }).get();
- deleteListIdBiAuditReaport(type, allValsUnChecked);
- }
- });
- }
- function catchEventCheckbox(type) {
- $('#smad-table-' + type + ' input[type="checkbox"]').on('change', function() {
- if($(this).is(":checked")) {
- var allValsChecked = [];
- if (this.value !== 'on') {
- allValsChecked.push(parseInt(this.value));
- }
- updateListIdBiAuditReaport(type, allValsChecked);
- } else {
- var allValsUnChecke = [];
- if (this.value !== 'on') {
- allValsUnChecke.push(parseInt(this.value));
- }
- deleteListIdBiAuditReaport(type, allValsUnChecke);
- }
-
- updateCountItemCheckedByType(type.toLowerCase());
- });
- }
- function clearSelectedCheckbox() {
- $('#checkAll-PRACOWNICY').prop('checked', false)
- $('#checkAll-KONTRAHENCI').prop('checked', false)
- }
- function updateListIdBiAuditReaport(type, valueArray) {
- var currentStoragePracownicyIds = [];
- var updateListPracownicyIds = null;
- var currentStorageKontrahenciIds = [];
- var updateListKontrahenciIds = null;
- if ( type == 'PRACOWNICY') {
- currentStoragePracownicyIds = getItemLocalStorage('Bocian.biAuditForm.pracownicyIds');
- if(currentStoragePracownicyIds !== null) {
- updateListPracownicyIds = [...new Set([...currentStoragePracownicyIds ,...valueArray])];
- }
- else {
- updateListPracownicyIds = valueArray;
- }
- setItemLocalStorage('Bocian.biAuditForm.pracownicyIds', updateListPracownicyIds);
- }
- if ( type == 'KONTRAHENCI') {
- currentStorageKontrahenciIds = getItemLocalStorage('Bocian.biAuditForm.kontrahenciIds');
- if(currentStorageKontrahenciIds !== null) {
- updateListKontrahenciIds = [...new Set([...currentStorageKontrahenciIds ,...valueArray])];
- }
- else {
- updateListKontrahenciIds = valueArray;
- }
- setItemLocalStorage('Bocian.biAuditForm.kontrahenciIds', updateListKontrahenciIds);
- }
- }
- function deleteListIdBiAuditReaport(type, valueArray) {
- var currentStoragePracownicyIds = [];
- var updateListPracownicyIds = null;
- if ( type == 'PRACOWNICY') {
- deleteItemLocalStorage('Bocian.biAuditForm.pracownicyIds', valueArray);
- }
- if ( type == 'KONTRAHENCI') {
- deleteItemLocalStorage('Bocian.biAuditForm.kontrahenciIds', valueArray);
- }
- }
- function fetchGroupPracownicy() {
- fetch(URL_FETCH_GROUP_PRACOWNICY, {
- credentials: 'same-origin'
- })
- .then(function parseJSON(response) {
- return response.json()
- })
- .then(function(data) {
- setItemLocalStorage('Bocian.biAuditForm.pracownicy.groups', data.body.itmesGroupPracownicy);
- if (data.body.itmesGroupPracownicy === null) {
- return;
- }
- var filterIdGroup = getItemLocalStorage('Bocian.biAuditForm.pracownicy.filterIdGroup');
- var currentDepthValue = getItemLocalStorage('Bocian.biAuditForm.depth');
- setItemLocalStorage('Bocian.biAuditForm.pracownicy.filterIdGroup', filterIdGroup);
- setItemLocalStorage('Bocian.biAuditForm.depth', currentDepthValue);
- var groupsPracownicy = '';
- var activeButton = '';
- data.body.itmesGroupPracownicy.forEach (function(row) {
- if ( filterIdGroup === row['ID'] ) { activeButton = 'active'; $('#group-pracownicy button.active').removeClass('active'); }
- groupsPracownicy += '<button class="btn btn-default '+activeButton+'" title="' + row['NAZWA'] + '" data-group-filter="' + row['ID'] + '">' + row['NAZWA'] + '</button>';
- });
- $("#group-pracownicy").append(groupsPracownicy);
- updateCountItemCheckedByType('pracownicy');
-
- detectChoiseFilter();
- }).catch(function(error) {
- console.log('request failed', error)
- });
- }
- function fetchGroupKontrahenci() {
- fetch(URL_FETCH_GROUP_KONTRAHENCI, {
- credentials: 'same-origin'
- })
- .then(function parseJSON(response) {
- return response.json()
- })
- .then(function(data) {
- setItemLocalStorage('Bocian.biAuditForm.kontrahenci.groups', data.body.itemsGroupKontrahenci);
- if (data.body.itemsGroupKontrahenci === null) {
- return;
- }
- var filterIdGroup = getItemLocalStorage('Bocian.biAuditForm.kontrahenci.filterIdGroup');
- var currentDepthValue = getItemLocalStorage('Bocian.biAuditForm.depth');
- setItemLocalStorage('Bocian.biAuditForm.kontrahenci.filterIdGroup', filterIdGroup);
- setItemLocalStorage('Bocian.biAuditForm.depth', currentDepthValue);
- var groupsKontrahenci = '';
- var activeButton = '';
- data.body.itemsGroupKontrahenci.forEach (function(row) {
- if ( filterIdGroup === row['ID'] ) { activeButton = 'active'; $('#group-kontrahenci button.active').removeClass('active'); }
- groupsKontrahenci += '<button class="btn btn-default '+activeButton+'" title="'+row['NAZWA']+'" data-group-filter="'+row['ID']+'">'+row['NAZWA']+'</button>';
- });
- $("#group-kontrahenci").append(groupsKontrahenci);
- updateCountItemCheckedByType('kontrahenci');
-
- detectChoiseFilter();
- console.log('request succeeded with JSON fetchGroupKontrahenci', data.body.itemsGroupKontrahenci);
- }).catch(function(error) {
- console.log('request failed', error)
- });
- }
- function detectChoiseFilter() {
- $('#group-kontrahenci').on('click', 'button', function(evt) {
- $('#group-kontrahenci button.active').removeClass('active');
- $(this).addClass('active');
-
- var filterIdGroup = $(this).attr("data-group-filter");
-
- var currentDepthValue = getItemLocalStorage('Bocian.biAuditForm.depth');
-
-
-
- setItemLocalStorage('Bocian.biAuditForm.depth', currentDepthValue);
-
- setItemLocalStorage('Bocian.biAuditForm.kontrahenci.filterIdGroup', parseInt(filterIdGroup));
-
- urlFetchKontrahenci(1);
- });
- $('#group-pracownicy').on('click', 'button', function(evt) {
- $('#group-pracownicy button.active').removeClass('active');
- $(this).addClass('active');
-
- var filterIdGroup = $(this).attr("data-group-filter");
-
- var currentDepthValue = getItemLocalStorage('Bocian.biAuditForm.depth');
-
-
-
- setItemLocalStorage('Bocian.biAuditForm.depth', currentDepthValue);
-
- setItemLocalStorage('Bocian.biAuditForm.pracownicy.filterIdGroup', parseInt(filterIdGroup));
-
- urlFetchPracownicy(1);
- });
- }
- function setItemLocalStorage(key, array) {
- localStorage.setItem(key, JSON.stringify(array));
- }
- function getItemLocalStorage(key) {
- var retrievedData = localStorage.getItem(key);
- var response = JSON.parse(retrievedData);
- return response;
- }
- function deleteItemLocalStorage(key, itemsArray) {
- var currentStorageArray = getItemLocalStorage(key);
- var newStorageArray = removeItemArrayInArray(currentStorageArray, itemsArray);
- setItemLocalStorage(key, newStorageArray);
- }
- function removeItemInArray(arr, item) {
- for(var i = arr.length; i--;) {
- if(arr[i] === item) {
- arr.splice(i, 1);
- }
- }
- return arr;
- }
- function removeItemArrayInArray(arr, itemsArray) {
- for(var i = arr.length; i--;) {
- for(var j = itemsArray.length; j--;) {
- if(arr[i] === itemsArray[j]) {
- arr.splice(i, 1);
- }
- }
- }
- return arr;
- }
- function clearListLocalStorageByType(typeNameLocalStorage) {
- if (typeNameLocalStorage === 'pracownicy') {
- setItemLocalStorage('Bocian.biAuditForm.pracownicyIds', []);
- }
- if (typeNameLocalStorage === 'kontrahenci') {
- setItemLocalStorage('Bocian.biAuditForm.kontrahenciIds', []);
- }
-
- updateCountItemCheckedByType(typeNameLocalStorage);
-
- $('#smad-table-'+typeNameLocalStorage.toUpperCase()+' form').find(':checkbox').prop('checked', false);
- }
- function updateCountItemCheckedByType(typeNameLocalStorage) {
- var countId = 0;
- if (typeNameLocalStorage === 'pracownicy') {
- var countPracownicy = getItemLocalStorage('Bocian.biAuditForm.pracownicyIds');
- if (countPracownicy === null || countPracownicy === undefined) {
- return countId;
- }
- countId = Object.keys(countPracownicy).length;
- $('#count-selected-item-pracownicy').text(countId);
- }
- if (typeNameLocalStorage === 'kontrahenci') {
- var countKontrahenci = getItemLocalStorage('Bocian.biAuditForm.kontrahenciIds');
- if (countKontrahenci === null || countKontrahenci === undefined) {
- return countId;
- }
- countId = Object.keys(countKontrahenci).length;
- $('#count-selected-item-kontrahenci').text(countId);
- }
- return countId;
- }
- var Pagination = {
- code: '',
- clickPage: 1,
-
-
-
-
- Extend: function(data) {
- data = data || {};
- Pagination.url = data.url;
- Pagination.id_pagination = data.id_pagination;
- Pagination.type = data.type;
- Pagination.limit = data.limit;
- Pagination.total_items = data.total_items;
- Pagination.size = data.size || 2;
- Pagination.page = data.page || 1;
- Pagination.step = data.step || 3;
- },
-
- Add: function(s, f) {
- for (var i = s; i < f; i++) {
- Pagination.code += '<li><a href="' + Pagination.url + '" class="btn btn-default">' + i + '</a></li>';
- }
- },
-
- Last: function() {
- Pagination.code += '<li><a href="' + Pagination.url + '" class="btn btn-default">>></a></li>';
- },
-
- First: function() {
- Pagination.code += '<li><a href="' + Pagination.url + '" class="btn btn-default"><<</a></li>';
- },
-
- Next: function() {
- Pagination.code += '<li><a href="' + Pagination.url + '" class="btn btn-default">></a></li>';
- },
-
- Prev: function() {
- Pagination.code += '<li><a href="' + Pagination.url + '" class="btn btn-default"><</a></li>';
- },
-
-
-
-
- Click: function() {
- clearSelectedCheckbox();
- var selectPage = $("#pagination-"+Pagination.type.toLowerCase()+' .tblAjax__footer__toolbar__pagination').find('a.active').text();
- Pagination.clickPage = +this.innerHTML || '';
- if ( selectPage === NaN || selectPage > Pagination.size) { selectPage = 1; }
- switch (this.innerHTML) {
- case '>>':
- Pagination.clickPage = Pagination.size;
- break;
- case '<<':
- Pagination.clickPage = 1;
- break;
- case '<':
- Pagination.clickPage = parseInt(selectPage) - 1;
- if (Pagination.clickPage < 1) {
- Pagination.clickPage = 1;
- }
- break;
- case '>':
- Pagination.clickPage = parseInt(selectPage) + 1;
- if (Pagination.clickPage > Pagination.size) {
- Pagination.clickPage = Pagination.size;
- }
- break;
- }
- if ( Pagination.type === 'KONTRAHENCI' ) {
- setItemLocalStorage('Bocian.biAuditForm.kontrahenci.pagination.page', Pagination.clickPage);
- Pagination.page = urlFetchKontrahenci(Pagination.clickPage);
- }
- else if ( Pagination.type === 'PRACOWNICY' ){
- setItemLocalStorage('Bocian.biAuditForm.pracownicy.pagination.page', Pagination.clickPage);
- Pagination.page = urlFetchPracownicy(Pagination.clickPage);
- }
- Pagination.Start();
- },
-
-
-
-
- Bind: function() {
- var a = Pagination.e.getElementsByTagName('a');
- var currentPage = Pagination.clickPage || 1;
- for (var i = 0; i < a.length; i++) {
- if (+a[i].innerHTML === Pagination.page) a[i].className = 'btn btn-default active';
- a[i].addEventListener('click', Pagination.Click, false);
- }
- },
-
- Finish: function() {
- Pagination.e.innerHTML = Pagination.code;
- Pagination.code = '</ul></nav>';
- Pagination.Bind();
- },
-
- Start: function() {
- Pagination.code = '';
- if ( Pagination.type === 'KONTRAHENCI' ) {
- Pagination.code = '<div class="foot-info tblAjax__footer__toolbar__info footer_pagination_menu_items"><p>Wiersze od <span id="paginationShowNextCount-KONTRAHENCI"></span> do ' + Pagination.total_items + ' z ' + Pagination.total_items + '</p></div>';
- } else if ( Pagination.type === 'PRACOWNICY' ) {
- Pagination.code = '<div class="foot-info tblAjax__footer__toolbar__info footer_pagination_menu_items"><p>Wiersze od <span id="paginationShowNextCount-PRACOWNICY"></span> do ' + Pagination.total_items + ' z ' + Pagination.total_items + '</p></div>';
- }
- Pagination.code += '<nav aria-label="Page navigation" class="footer_pagination_menu_items"><ul class="btn-group tblAjax__footer__toolbar__pagination smad-pagination">';
- Pagination.First();
- Pagination.Prev();
- if ( Pagination.type === 'KONTRAHENCI' ) {
- Pagination.page = getItemLocalStorage('Bocian.biAuditForm.kontrahenci.pagination.page') || 1;
- }
- else if ( Pagination.type === 'PRACOWNICY' ) {
- Pagination.page = getItemLocalStorage('Bocian.biAuditForm.pracownicy.pagination.page') || 1;
- }
- if ( Pagination.page > Pagination.size ) {
- Pagination.page = 1;
- }
- if (Pagination.size < Pagination.step * 2 + 6) {
- Pagination.Add(1, Pagination.size + 1);
- }
- else if (Pagination.page < Pagination.step * 2 + 1) {
- Pagination.Add(1, Pagination.step * 2 + 4);
- }
- else if (Pagination.page > Pagination.size - Pagination.step * 2) {
- Pagination.Add(Pagination.size - Pagination.step * 2 - 2, Pagination.size + 1);
- }
- else {
- Pagination.Add(Pagination.page - Pagination.step, Pagination.page + Pagination.step + 1);
- }
- Pagination.Next();
- Pagination.Last();
- Pagination.Finish();
- },
-
-
-
-
- Buttons: function(e) {
- var nav = e.getElementsByTagName('a');
- },
-
- Create: function(e) {
- var html = [
- '<div></div>'
- ];
- e.innerHTML = html.join('');
- Pagination.e = e.getElementsByTagName('div')[0];
- Pagination.Buttons(e);
- },
-
- Init: function(e, data) {
- Pagination.Extend(data);
- Pagination.Create(e);
- Pagination.Start();
- }
- };
- function todo__fetchRaport(id) {
- p5WFS_GetFeature('default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA', {
- primaryKey: id,
- resolve: 'all',
- resolveDepth: 3,
- }).then(function (features) {
- console.log('features', features)
- }).catch(function (e) {
- console.warn(e)
- p5UI__notifyAjaxCallback({ type: 'error', msg: e })
- })
- }
- $(document).ready(function(){
- rootChangeForm();
- detectChoiseFilter();
- });
- global.checkAll = checkAll;
- global.checkedChoiseItems = checkedChoiseItems;
- global.catchEventCheckbox = catchEventCheckbox;
- global.clearSelectedCheckbox = clearSelectedCheckbox;
- global.getNameGroupById = getNameGroupById;
- global.createGroupPracownicy = createGroupPracownicy;
- global.createGroupKontrahenci = createGroupKontrahenci;
- global.selectPage = selectPage;
- global.detectChoiseFilter = detectChoiseFilter;
- global.updateListIdBiAuditReaport = updateListIdBiAuditReaport;
- global.deleteListIdBiAuditReaport = deleteListIdBiAuditReaport;
- global.urlFetchPracownicy = urlFetchPracownicy;
- global.generateBiAuditRaport = generateBiAuditRaport;
- global.getAddressData = getAddressData;
- global.Pagination = Pagination;
- global.todo__fetchRaport = todo__fetchRaport;
- global.initLocalStorage = initLocalStorage;
- global.setItemLocalStorage = setItemLocalStorage;
- global.getItemLocalStorage = getItemLocalStorage;
- global.deleteItemLocalStorage = deleteItemLocalStorage;
- global.defaultBIAuditLocalStorage = defaultBIAuditLocalStorage;
- global.removeItemInArray = removeItemInArray;
- global.removeItemArrayInArray = removeItemArrayInArray;
- global.addPracownikToGroup = addPracownikToGroup;
- global.addKontrahenciToGroup = addKontrahenciToGroup;
- global.showViewUploadFile = showViewUploadFile;
- global.parseCsvFile = parseCsvFile;
- global.clearListLocalStorageByType = clearListLocalStorageByType;
|