|
@@ -477,7 +477,7 @@ public function showPowiazaniaEnergaRumKontrahenciPowiazania($items) {
|
|
|
return ('f_' === substr($key, 0, 2));
|
|
|
});
|
|
|
foreach ($fieldFilterKeys as $key) {
|
|
|
- $filtersParams[ $key ] = $args[ $key ];
|
|
|
+ $filtersParams[ $key ] = '%' . $args[ $key ] . '%';
|
|
|
}
|
|
|
|
|
|
$acl = ACL::getAclByNamespace('default_db/BI_audit_ENERGA_RUM_KONTRAHENCI/BI_audit_ENERGA_RUM_KONTRAHENCI');
|
|
@@ -504,31 +504,31 @@ public function showPowiazaniaEnergaRumKontrahenciPowiazania($items) {
|
|
|
'body' => [
|
|
|
'ids' => array_map( V::makePick('ID'), $items ),
|
|
|
],
|
|
|
- '__args' => $args,
|
|
|
- '__args_$idGroup' => $idGroup,
|
|
|
- '__args_$filtersParams' => $filtersParams,
|
|
|
- '__args_$backRefFilter' => $backRefFilter,
|
|
|
+ '__DBG_args' => $args,
|
|
|
+ '__DBG_$idGroup' => $idGroup,
|
|
|
+ '__DBG_$filtersParams' => $filtersParams,
|
|
|
+ '__DBG_$backRefFilter' => $backRefFilter,
|
|
|
];
|
|
|
}
|
|
|
/**
|
|
|
* KONTRAHENCI
|
|
|
*/
|
|
|
public function fetchKontrahenciAjaxAction() {
|
|
|
- Response::sendTryCatchJson(array($this, 'fetchKontrahenciAjax'));
|
|
|
+ Response::sendTryCatchJson(array($this, 'fetchKontrahenciAjax'), $args = $_REQUEST);
|
|
|
}
|
|
|
public function fetchKontrahenciAjax($args) {
|
|
|
- $idGroup = V::get('filterIdGroup', 0, $_REQUEST, 'int'); // TODO: dla filtrów "Wysokiego ryzyka" - przekazywany ID rekodu
|
|
|
+ $idGroup = V::get('filterIdGroup', 0, $args, 'int'); // TODO: dla filtrów "Wysokiego ryzyka" - przekazywany ID rekodu
|
|
|
if ($idGroup < 0) $idGroup = 0;
|
|
|
|
|
|
$limit = 20;
|
|
|
|
|
|
- $limitstart = V::get('limitstart', 0, $_REQUEST, 'int');
|
|
|
+ $limitstart = V::get('limitstart', 0, $args, 'int');
|
|
|
if ($limitstart < 0) $limitstart = 0;
|
|
|
|
|
|
- $page = V::get('page', 0, $_REQUEST, 'int');
|
|
|
+ $page = V::get('page', 0, $args, 'int');
|
|
|
$limitstart = ($page - 1) * $limit;
|
|
|
|
|
|
- $search = V::get('search', '', $_REQUEST);
|
|
|
+ $search = V::get('search', '', $args);
|
|
|
$searchParams = [];
|
|
|
if (!empty($search)) {
|
|
|
$ogcSearch = "*{$search}*"; // wildCard="*" -> mysql '%'
|
|
@@ -565,6 +565,14 @@ public function showPowiazaniaEnergaRumKontrahenciPowiazania($items) {
|
|
|
// - 'default_db/BI_audit_ENERGA_RUM_KONTRAHENCI/BI_audit_ENERGA_KONTRAHENCI' minOccurs="0" maxOccurs="unbounded"
|
|
|
}
|
|
|
|
|
|
+ $filtersParams = [];
|
|
|
+ $fieldFilterKeys = array_filter(array_keys($args), function ($key) {
|
|
|
+ return ('f_' === substr($key, 0, 2));
|
|
|
+ });
|
|
|
+ foreach ($fieldFilterKeys as $key) {
|
|
|
+ $filtersParams[ $key ] = '%' . $args[ $key ] . '%';
|
|
|
+ }
|
|
|
+ DBG::log($filtersParams, 'Kontrahenci $filtersParams');
|
|
|
$acl = ACL::getAclByNamespace('default_db/BI_audit_ENERGA_RUM_KONTRAHENCI/BI_audit_ENERGA_RUM_KONTRAHENCI');
|
|
|
$query = $acl->buildQuery(array_merge([
|
|
|
'cols' => [ // TODO:? propertyName = []
|
|
@@ -599,7 +607,7 @@ public function showPowiazaniaEnergaRumKontrahenciPowiazania($items) {
|
|
|
//'f_ID' => $id,
|
|
|
'limit' => $limit,
|
|
|
'limitstart' => $limitstart, // offset
|
|
|
- ], $searchParams, $backRefFilter));
|
|
|
+ ], $searchParams, $filtersParams, $backRefFilter));
|
|
|
$total = $query->getTotal();
|
|
|
$items = $query->getItems();
|
|
|
|
|
@@ -613,13 +621,15 @@ public function showPowiazaniaEnergaRumKontrahenciPowiazania($items) {
|
|
|
return [
|
|
|
'type' => 'success',
|
|
|
'msg' => 'showKontrajenci',
|
|
|
- '__req_args' => $_REQUEST,
|
|
|
- '__args' => $args,
|
|
|
'body' => [
|
|
|
'items' => $items,
|
|
|
//'view' => $this->htmlViewFormBiAudit($items, 'KONTRAHENCI'),
|
|
|
'pagination' => $pagination
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ '__DBG_args' => $args,
|
|
|
+ '__DBG_$idGroup' => $idGroup,
|
|
|
+ '__DBG_$filtersParams' => $filtersParams,
|
|
|
+ '__DBG_$backRefFilter' => $backRefFilter,
|
|
|
];
|
|
|
}
|
|
|
|
|
@@ -658,6 +668,36 @@ public function showPowiazaniaEnergaRumKontrahenciPowiazania($items) {
|
|
|
<td>ownCompany</td>
|
|
|
<td>uwagi</td>
|
|
|
</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>
|
|
|
+ </tr>
|
|
|
</thead>
|
|
|
<tbody id="body-kontrahenci">
|
|
|
</tbody></table>
|
|
@@ -791,7 +831,7 @@ public function showPowiazaniaEnergaRumKontrahenciPowiazania($items) {
|
|
|
return ('f_' === substr($key, 0, 2));
|
|
|
});
|
|
|
foreach ($fieldFilterKeys as $key) {
|
|
|
- $filtersParams[ $key ] = $args[ $key ];
|
|
|
+ $filtersParams[ $key ] = '%' . $args[ $key ] . '%';
|
|
|
}
|
|
|
|
|
|
$acl = ACL::getAclByNamespace('default_db/BI_audit_ENERGA_PRACOWNICY/BI_audit_ENERGA_PRACOWNICY');
|
|
@@ -819,33 +859,33 @@ public function showPowiazaniaEnergaRumKontrahenciPowiazania($items) {
|
|
|
'ids' => array_map( V::makePick('ID'), $items ),
|
|
|
],
|
|
|
'__args' => $args,
|
|
|
- '__args_$idGroup' => $idGroup,
|
|
|
- '__args_$filtersParams' => $filtersParams,
|
|
|
- '__args_$backRefFilter' => $backRefFilter,
|
|
|
+ '__DBG_$idGroup' => $idGroup,
|
|
|
+ '__DBG_$filtersParams' => $filtersParams,
|
|
|
+ '__DBG_$backRefFilter' => $backRefFilter,
|
|
|
];
|
|
|
}
|
|
|
/*
|
|
|
* PRACOWNICY
|
|
|
*/
|
|
|
public function fetchPracownicyAjaxAction() {
|
|
|
- Response::sendTryCatchJson(array($this, 'fetchPracownicyAjax'));
|
|
|
+ Response::sendTryCatchJson(array($this, 'fetchPracownicyAjax'), $args = $_REQUEST);
|
|
|
}
|
|
|
public function fetchPracownicyAjax($args) {
|
|
|
|
|
|
- $idGroup = V::get('filterIdGroup', 0, $_REQUEST, 'int'); // dla filtrów "Wysokiego ryzyka" - przekazywany ID rekodu
|
|
|
+ $idGroup = V::get('filterIdGroup', 0, $args, 'int'); // dla filtrów "Wysokiego ryzyka" - przekazywany ID rekodu
|
|
|
if ($idGroup < 0) $idGroup = 0;
|
|
|
|
|
|
$limit = 20;
|
|
|
|
|
|
- $limitstart = V::get('limitstart', 0, $_REQUEST, 'int');
|
|
|
+ $limitstart = V::get('limitstart', 0, $args, 'int');
|
|
|
if ($limitstart < 0) $limitstart = 0;
|
|
|
|
|
|
|
|
|
- $page = V::get('page', 0, $_REQUEST, 'int');
|
|
|
+ $page = V::get('page', 0, $args, 'int');
|
|
|
$limitstart = ($page - 1) * $limit;
|
|
|
|
|
|
|
|
|
- $search = V::get('search', '', $_REQUEST);
|
|
|
+ $search = V::get('search', '', $args);
|
|
|
$searchParams = [];
|
|
|
if (!empty($search)) {
|
|
|
$ogcSearch = "*{$search}*"; // wildCard="*" -> mysql '%'
|
|
@@ -874,6 +914,14 @@ public function showPowiazaniaEnergaRumKontrahenciPowiazania($items) {
|
|
|
];
|
|
|
}
|
|
|
|
|
|
+ $filtersParams = [];
|
|
|
+ $fieldFilterKeys = array_filter(array_keys($args), function ($key) {
|
|
|
+ return ('f_' === substr($key, 0, 2));
|
|
|
+ });
|
|
|
+ foreach ($fieldFilterKeys as $key) {
|
|
|
+ $filtersParams[ $key ] = '%' . $args[ $key ] . '%';
|
|
|
+ }
|
|
|
+
|
|
|
$acl = ACL::getAclByNamespace('default_db/BI_audit_ENERGA_PRACOWNICY/BI_audit_ENERGA_PRACOWNICY');
|
|
|
$query = $acl->buildQuery(array_merge([
|
|
|
'cols' => [
|
|
@@ -900,7 +948,7 @@ public function showPowiazaniaEnergaRumKontrahenciPowiazania($items) {
|
|
|
// 'f_nip' = "12345", // szukamy dokładnie tej wartości - mysql: where nip like "%12345%"
|
|
|
// 'f_nip' = "12345%", // szukamy dokładnie tej wartości - mysql: where nip like "12345%"
|
|
|
// 'f_ID' = "=12345", // szukamy dokładnie tej wartości - mysql: where ID = "12345"
|
|
|
- ], $searchParams, $backRefFilter));
|
|
|
+ ], $searchParams, $filtersParams, $backRefFilter));
|
|
|
$total = $query->getTotal();
|
|
|
$items = $query->getItems();
|
|
|
|
|
@@ -928,13 +976,14 @@ public function showPowiazaniaEnergaRumKontrahenciPowiazania($items) {
|
|
|
return [
|
|
|
'type' => 'success',
|
|
|
'msg' => 'showPracownicy',
|
|
|
- '__req_args' => $_REQUEST,
|
|
|
- '__args' => $args,
|
|
|
'body' => [
|
|
|
'items' => $items,
|
|
|
//'view' => $this->htmlViewFormBiAudit($items, 'PRACOWNICY'),
|
|
|
'pagination' => $pagination
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ '__DBG_$idGroup' => $idGroup,
|
|
|
+ '__DBG_$filtersParams' => $filtersParams,
|
|
|
+ '__DBG_$backRefFilter' => $backRefFilter,
|
|
|
];
|
|
|
}
|
|
|
|
|
@@ -960,11 +1009,26 @@ public function showPowiazaniaEnergaRumKontrahenciPowiazania($items) {
|
|
|
<td>L_APPOITMENT_USER</td>
|
|
|
<td>Adresy</td>
|
|
|
</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_A_ADM_COMPANY" value="" placeholder="%"></td>
|
|
|
+ <td style="padding:0"><input style="padding:2px 8px; width:100%" onChange="return onChangeFiltersPracownicy(this)" type="text" name="f_A_CLASSIFIED" 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>
|
|
|
+ </tr>
|
|
|
</thead>
|
|
|
<tbody id="body-pracownicy">
|
|
|
</tbody></table>
|
|
|
</form>';
|
|
|
-
|
|
|
return $view;
|
|
|
|
|
|
}
|