|
@@ -1,3 +1,4 @@
|
|
|
+var DBG = DBG || 0;
|
|
|
|
|
|
if (!URL_TABLE_POWIAZANIA) throw "Brak URL_TABLE_POWIAZANIA";
|
|
|
if (!BASE_URLS) throw "Brak BASE_URLS"
|
|
@@ -1160,31 +1161,40 @@ function urlFetchPracownicy(page) {
|
|
|
}).join('&')
|
|
|
filterFields = (filterFields.length > 0) ? '&' + filterFields : ''
|
|
|
|
|
|
- // TODO: fetch data from API
|
|
|
- // p5WFS_GetFeature('default_db__x3A__BI_audit_ENERGA_PRACOWNICY:BI_audit_ENERGA_PRACOWNICY', {
|
|
|
- // sortBy: 'ID+D',
|
|
|
- // maxFeatures: 20,
|
|
|
- // // TODO: startIndex: 0, // TODO: from pagination
|
|
|
- // // TODO: backRefNS, backRefPK, backRefField - TODO: from groups
|
|
|
- // // resolve: 'all',
|
|
|
- // // resolveDepth: 2
|
|
|
- // 'ogc:Filter': '<wfs:Query>' + '\n' + [
|
|
|
- // '*',
|
|
|
- // 'default_db__x3A__BI_audit_ENERGA_PRACOWNICY_adresy:BI_audit_ENERGA_PRACOWNICY_adresy/*',
|
|
|
- // [
|
|
|
- // 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object',
|
|
|
- // 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row',
|
|
|
- // 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object',
|
|
|
- // 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI:BI_audit_ENERGA_RUM_KONTRAHENCI'
|
|
|
- // ].join('/')
|
|
|
- // ].map(function (fieldName) {
|
|
|
- // return '<wfs:PropertyName>' + fieldName + '</wfs:PropertyName>';
|
|
|
- // }).join('\n') + '\n' + '</wfs:Query>'
|
|
|
- // }).then(function (items) {
|
|
|
- // console.log('p5WFS_GetFeature: items: ', items);
|
|
|
- // }).catch(function (err) {
|
|
|
- // console.log('p5WFS_GetFeature: err: ', err);
|
|
|
- // })
|
|
|
+ var paginationLimit = 20;
|
|
|
+ p5WFS_GetFeature('default_db__x3A__BI_audit_ENERGA_PRACOWNICY:BI_audit_ENERGA_PRACOWNICY',
|
|
|
+ Object.assign({
|
|
|
+ sortBy: 'ID+D',
|
|
|
+ maxFeatures: paginationLimit,
|
|
|
+ startIndex: (page - 1) * paginationLimit,
|
|
|
+ // TODO: backRefNS, backRefPK, backRefField - TODO: from groups
|
|
|
+ // resolve: 'all',
|
|
|
+ // resolveDepth: 2
|
|
|
+ 'ogc:Filter': '<wfs:Query>' + '\n' + [
|
|
|
+ '*',
|
|
|
+ 'default_db__x3A__BI_audit_ENERGA_PRACOWNICY_adresy:BI_audit_ENERGA_PRACOWNICY_adresy/*',
|
|
|
+ [
|
|
|
+ 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object',
|
|
|
+ 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row',
|
|
|
+ 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object',
|
|
|
+ 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI:BI_audit_ENERGA_RUM_KONTRAHENCI'
|
|
|
+ ].join('/')
|
|
|
+ ].map(function (fieldName) {
|
|
|
+ return '<wfs:PropertyName>' + fieldName + '</wfs:PropertyName>';
|
|
|
+ }).join('\n') + '\n' + '</wfs:Query>'
|
|
|
+ }, (filterIdGroup > 0)
|
|
|
+ ? {
|
|
|
+ backRefNS: 'default_db/BI_audit_ENERGA_PRACOWNICY_group/BI_audit_ENERGA_PRACOWNICY_group',
|
|
|
+ backRefPK: filterIdGroup,
|
|
|
+ backRefField: 'default_db__x3A__BI_audit_ENERGA_PRACOWNICY:BI_audit_ENERGA_PRACOWNICY',
|
|
|
+ }
|
|
|
+ : {}
|
|
|
+ )
|
|
|
+ ).then(function (items) {
|
|
|
+ if(DBG)console.log('p5WFS_GetFeature: items: ', items);
|
|
|
+ }).catch(function (err) {
|
|
|
+ if(DBG)console.log('p5WFS_GetFeature: err: ', err);
|
|
|
+ })
|
|
|
|
|
|
fetch(URL_FETCH_PRACOWNICY + '&page=' + page + '&filterIdGroup=' + filterIdGroup + filterFields, {
|
|
|
credentials: 'same-origin'
|