|
@@ -22,6 +22,7 @@ function graphFetchData(node, nameSection) {
|
|
|
}
|
|
|
|
|
|
var filterIdGroup = getItemLocalStorage('Bocian.biAuditForm.'+nameSection+'.filterIdGroup');
|
|
|
+ var filterIdRaport = getItemLocalStorage('Bocian.biAuditForm.'+nameSection+'.filterIdRaport');
|
|
|
|
|
|
var frm = document.getElementById('filtersFieldRemoveBtn-' + nameSection.toUpperCase()).form
|
|
|
var fieldNameList = ('pracownicy' === nameSection) ? FIELD_LIST_PRACOWNICY : FIELD_LIST_KONTRAHENCI
|
|
@@ -67,6 +68,7 @@ function graphFetchData(node, nameSection) {
|
|
|
paginationLimit: paginationLimit,
|
|
|
page: page,
|
|
|
filterIdGroup: filterIdGroup,
|
|
|
+ filterIdRaport: filterIdRaport,
|
|
|
filterFields: filterFields,
|
|
|
ogcFilterFields: ogcFilterFields,
|
|
|
});
|
|
@@ -86,7 +88,7 @@ function graphFetchData(node, nameSection) {
|
|
|
return flatList;
|
|
|
}
|
|
|
|
|
|
- p5WFS_GetFeature('default_db__x3A__BI_audit_ENERGA_PRACOWNICY:BI_audit_ENERGA_PRACOWNICY',
|
|
|
+ p5WFS_GetFeature(('pracownicy' === nameSection) ? 'default_db__x3A__BI_audit_ENERGA_PRACOWNICY:BI_audit_ENERGA_PRACOWNICY' : 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI:BI_audit_ENERGA_RUM_KONTRAHENCI',
|
|
|
Object.assign({
|
|
|
sortBy: 'ID+D',
|
|
|
maxFeatures: paginationLimit,
|
|
@@ -94,12 +96,26 @@ function graphFetchData(node, nameSection) {
|
|
|
// TODO: backRefNS, backRefPK, backRefField - TODO: from groups
|
|
|
// resolve: 'all',
|
|
|
// resolveDepth: 2
|
|
|
- 'ogc:Filter': '<wfs:Query>' + '\n' + [
|
|
|
- 'ID',
|
|
|
- 'imiona',
|
|
|
- 'nazwisko',
|
|
|
- 'miejscowosc'
|
|
|
- ].concat(refFieldsOnPathToList('default_db__x3A__BI_audit_KRS:BI_audit_KRS', [ 'ID', 'nazwa', 'krs', 'S_miejscowosc' ]))
|
|
|
+ // 'ogc:Filter': '<wfs:Query>' + '\n' + [
|
|
|
+ // 'ID',
|
|
|
+ // 'imiona',
|
|
|
+ // 'nazwisko',
|
|
|
+ // 'miejscowosc'
|
|
|
+ // ]
|
|
|
+
|
|
|
+ 'ogc:Filter': '<wfs:Query>' + '\n' + [].concat(
|
|
|
+ ('pracownicy' === nameSection)
|
|
|
+ ? [
|
|
|
+ 'ID',
|
|
|
+ 'imiona',
|
|
|
+ 'nazwisko',
|
|
|
+ 'miejscowosc'
|
|
|
+ ] : [
|
|
|
+ 'ID',
|
|
|
+ 'Pelna_nazwa_kontrahenta'
|
|
|
+ ]
|
|
|
+ )
|
|
|
+ .concat(refFieldsOnPathToList('default_db__x3A__BI_audit_KRS:BI_audit_KRS', [ 'ID', 'nazwa', 'krs', 'S_miejscowosc' ]))
|
|
|
.concat(refFieldsOnPathToList('default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI:BI_audit_ENERGA_RUM_KONTRAHENCI', [ 'ID', 'Pelna_nazwa_kontrahenta' ]))
|
|
|
.concat(refFieldsOnPathToList('default_db__x3A__BI_audit_MSIG:BI_audit_MSIG', [ 'ID', 'nazwa' ]))
|
|
|
.concat(refFieldsOnPathToList('default_db__x3A__BI_audit_CEIDG:BI_audit_CEIDG', [ 'ID', 'nazwisko', 'firma' ]))
|
|
@@ -126,13 +142,34 @@ function graphFetchData(node, nameSection) {
|
|
|
}).join('\n') + '\n' +
|
|
|
( ogcFilterFields ? ogcFilterFields : '' ) +
|
|
|
'</wfs:Query>'
|
|
|
- }, (filterIdGroup > 0)
|
|
|
+ }, ('pracownicy' === nameSection && filterIdRaport > 0)
|
|
|
+ ? {
|
|
|
+ backRefNS: 'default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA',
|
|
|
+ backRefPK: filterIdRaport,
|
|
|
+ backRefField: 'default_db__x3A__BI_audit_ENERGA_PRACOWNICY:BI_audit_ENERGA_PRACOWNICY',
|
|
|
+ }
|
|
|
+ : {}
|
|
|
+ , ('kontrahenci' === nameSection && filterIdRaport > 0)
|
|
|
+ ? {
|
|
|
+ backRefNS: 'default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA',
|
|
|
+ backRefPK: filterIdRaport,
|
|
|
+ backRefField: 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI:BI_audit_ENERGA_RUM_KONTRAHENCI',
|
|
|
+ }
|
|
|
+ : {}
|
|
|
+ , ('pracownicy' === nameSection && 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',
|
|
|
}
|
|
|
: {}
|
|
|
+ , ('kontrahenci' === nameSection && filterIdGroup > 0)
|
|
|
+ ? {
|
|
|
+ backRefNS: 'default_db/BI_audit_ENERGA_PRACOWNICY_group/BI_audit_ENERGA_PRACOWNICY_group',
|
|
|
+ backRefPK: filterIdGroup,
|
|
|
+ backRefField: 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI:BI_audit_ENERGA_RUM_KONTRAHENCI',
|
|
|
+ }
|
|
|
+ : {}
|
|
|
)
|
|
|
).then(function (items) {
|
|
|
if(DBG)console.log('p5WFS_GetFeature: items: ', items);
|