dariusz.andryskowski 7 лет назад
Родитель
Сommit
831289c3db
2 измененных файлов с 85 добавлено и 41 удалено
  1. 39 39
      tools/Bocian.php
  2. 46 2
      tools/Bocian.php.view.js

+ 39 - 39
tools/Bocian.php

@@ -726,33 +726,33 @@ public function showPowiazaniaEnergaRumKontrahenciPowiazania($items) {
 										 </tr>
 										 <tr>
 											<td style="padding:0" width=1><button style="padding:5px" id="filtersFieldRemoveBtn-KONTRAHENCI" onClick="return removeFiltersKontrahenci(event, this)" title="Kasuj filtry" class="btn btn-xs btn-link glyphicon glyphicon-remove"></button></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:80px" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_ID" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_Nazwa_grupy_kapitalowej" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_Pelna_nazwa_kontrahenta" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_Numer_kontrahenta" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_Skrocona_Nazwa_Kontrahenta" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_Typ_kontrahenta" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_NIP" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_KRS" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_REGON" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_PESEL" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_Forma_prawna_dzialalnosci" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_Ulica" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_Numer_budynku" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_Numer_mieszkania_lokalu" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_Miejscowosc" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_Kod_pocztowy" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_Kraj" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_Telefon" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_Fax" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_Mail" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_A_ADM_COMPANY" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_A_CLASSIFIED" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_Dodano" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_Podmiot_dominujacy" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_Tytul_dokumentu" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_ownCompany" value="" placeholder="%"></td>
-											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(this)" type="text" name="f_uwagi" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:80px" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_ID" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_Nazwa_grupy_kapitalowej" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_Pelna_nazwa_kontrahenta" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_Numer_kontrahenta" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_Skrocona_Nazwa_Kontrahenta" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_Typ_kontrahenta" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_NIP" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_KRS" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_REGON" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_PESEL" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_Forma_prawna_dzialalnosci" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_Ulica" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_Numer_budynku" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_Numer_mieszkania_lokalu" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_Miejscowosc" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_Kod_pocztowy" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_Kraj" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_Telefon" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_Fax" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_Mail" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_A_ADM_COMPANY" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_A_CLASSIFIED" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_Dodano" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_Podmiot_dominujacy" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_Tytul_dokumentu" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_ownCompany" value="" placeholder="%"></td>
+											<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersKontrahenci(event, this)" onKeypress="return onKeypressFiltersKontrahenci(event, this)" type="text" name="f_uwagi" value="" placeholder="%"></td>
 										 </tr>
 										 </thead>
 										 <tbody id="body-kontrahenci">
@@ -1122,18 +1122,18 @@ public function showPowiazaniaEnergaRumKontrahenciPowiazania($items) {
 											 </tr>
 											 <tr>
 												<td style="padding:0" width=1><button style="padding:5px" id="filtersFieldRemoveBtn-PRACOWNICY" onClick="return removeFiltersPracownicy(event, this)" title="Kasuj filtry" class="btn btn-xs btn-link glyphicon glyphicon-remove"></button></td>
-												<td style="padding:0"><input style="padding:2px 8px; width:80px" onChange="return onChangeFiltersPracownicy(this)" type="text" name="f_ID" value="" placeholder="%"></td>
-												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(this)" type="text" name="f_imiona" value="" placeholder="%"></td>
-												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(this)" type="text" name="f_nazwisko" value="" placeholder="%"></td>
-												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(this)" type="text" name="f_nip" value="" placeholder="%"></td>
-												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(this)" type="text" name="f_pesel" value="" placeholder="%"></td>
-												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(this)" type="text" name="f_regon" value="" placeholder="%"></td>
-												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(this)" type="text" name="f_source" value="" placeholder="%"></td>
-												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(this)" type="text" name="f_jednostka_organizacyjna" value="" placeholder="%"></td>
-												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(this)" type="text" name="f_A_STATUS" value="" placeholder="%"></td>
-												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(this)" type="text" name="f_A_STATUS_INFO" value="" placeholder="%"></td>
-												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(this)" type="text" name="f_L_APPOITMENT_USER" value="" placeholder="%"></td>
-												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(this)" type="text" name="f_Adresy" value="" placeholder="%"></td>
+												<td style="padding:0"><input style="padding:2px 8px; width:80px" onChange="return onChangeFiltersPracownicy(event, this)" onKeypress="return onKeypressFiltersPracownicy(event, this)" type="text" name="f_ID" value="" placeholder="%"></td>
+												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(event, this)" onKeypress="return onKeypressFiltersPracownicy(event, this)" type="text" name="f_imiona" value="" placeholder="%"></td>
+												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(event, this)" onKeypress="return onKeypressFiltersPracownicy(event, this)" type="text" name="f_nazwisko" value="" placeholder="%"></td>
+												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(event, this)" onKeypress="return onKeypressFiltersPracownicy(event, this)" type="text" name="f_nip" value="" placeholder="%"></td>
+												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(event, this)" onKeypress="return onKeypressFiltersPracownicy(event, this)" type="text" name="f_pesel" value="" placeholder="%"></td>
+												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(event, this)" onKeypress="return onKeypressFiltersPracownicy(event, this)" type="text" name="f_regon" value="" placeholder="%"></td>
+												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(event, this)" onKeypress="return onKeypressFiltersPracownicy(event, this)" type="text" name="f_source" value="" placeholder="%"></td>
+												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(event, this)" onKeypress="return onKeypressFiltersPracownicy(event, this)" type="text" name="f_jednostka_organizacyjna" value="" placeholder="%"></td>
+												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(event, this)" onKeypress="return onKeypressFiltersPracownicy(event, this)" type="text" name="f_A_STATUS" value="" placeholder="%"></td>
+												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(event, this)" onKeypress="return onKeypressFiltersPracownicy(event, this)" type="text" name="f_A_STATUS_INFO" value="" placeholder="%"></td>
+												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(event, this)" onKeypress="return onKeypressFiltersPracownicy(event, this)" type="text" name="f_L_APPOITMENT_USER" value="" placeholder="%"></td>
+												<td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(event, this)" onKeypress="return onKeypressFiltersPracownicy(event, this)" type="text" name="f_Adresy" value="" placeholder="%"></td>
 											 </tr>
 										 </thead>
 										 <tbody id="body-pracownicy">

+ 46 - 2
tools/Bocian.php.view.js

@@ -1050,6 +1050,32 @@ 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);
+			// })
+
 			fetch(URL_FETCH_PRACOWNICY + '&page=' + page + '&filterIdGroup=' + filterIdGroup + filterFields, {
 				credentials: 'same-origin'
 			})
@@ -1838,12 +1864,28 @@ function removeFiltersKontrahenci(event, btnNode) {
 	urlFetchKontrahenci(1)
 }
 
-function onChangeFiltersPracownicy(inputNode) {
+function onChangeFiltersPracownicy(event, inputNode) {
 	urlFetchPracownicy(1)
 }
-function onChangeFiltersKontrahenci(inputNode) {
+function onKeypressFiltersPracownicy(event, inputNode) {
+	if ("Enter" === event.key) {
+		event.stopPropagation()
+		event.preventDefault()
+		urlFetchPracownicy(1)
+		return false
+	}
+}
+function onChangeFiltersKontrahenci(event, inputNode) {
 	urlFetchKontrahenci(1)
 }
+function onKeypressFiltersKontrahenci(event, inputNode) {
+	if ("Enter" === event.key) {
+		event.stopPropagation()
+		event.preventDefault()
+		urlFetchKontrahenci(1)
+		return false
+	}
+}
 
 function loadMoreRecordFunctions(event, node, rowPK, namespace) {
 	var _node = node
@@ -1966,7 +2008,9 @@ global.kontrahenciLoadMoreRecordFunctions = function(event, node, rowPK) {
 global.removeFiltersPracownicy = removeFiltersPracownicy;
 global.removeFiltersKontrahenci = removeFiltersKontrahenci;
 global.onChangeFiltersPracownicy = onChangeFiltersPracownicy;
+global.onKeypressFiltersPracownicy = onKeypressFiltersPracownicy;
 global.onChangeFiltersKontrahenci = onChangeFiltersKontrahenci;
+global.onKeypressFiltersKontrahenci = onKeypressFiltersKontrahenci;
 
 global.checkAll = checkAll;
 global.checkedChoiseItems = checkedChoiseItems;