|
|
@@ -502,39 +502,44 @@ function validate() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private function powiazania() {
|
|
|
+ private function urlActionOnItem() {
|
|
|
try {
|
|
|
if (!$this->SOURCE) throw new Exception("Błąd danych");
|
|
|
elseif (!(isset($this->SOURCE['TABLE']) && isset($this->SOURCE['ID']))) throw new Exception("Błąd danych");
|
|
|
- switch ($this->SOURCE['TABLE']) {
|
|
|
- case "BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA":
|
|
|
- $powiazania = DB::getPDO()->fetchall("select * from BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA where ID = '{$this->SOURCE['ID']}'");
|
|
|
- if (!$powiazania) throw new Exception("Błąd danych");
|
|
|
- $this->powiazanie = $powiazania[0];
|
|
|
- switch ($this->powiazanie['FILE_STATUS']) {
|
|
|
- case "NONE":
|
|
|
- $this->initializePowiazania();
|
|
|
- break;
|
|
|
- case "IN_PROGRESS":
|
|
|
- $this->showPowiazania_progress();
|
|
|
+ $_subUrlAction = V::get('_subUrlAction', '', $_GET);
|
|
|
+ switch ($_subUrlAction) {
|
|
|
+ case "importToPracownicy":
|
|
|
+ if (in_array($this->SOURCE['TABLE'], ['BI_audit_KRS', 'BI_audit_MSIG'])) $this->importToPracownicySearch($this->SOURCE['ID']);
|
|
|
+ else throw new Exception("Błąd wyzwolenia funkcji BiAuditGenerate");
|
|
|
+ break;
|
|
|
+ case "showKrsForKrsPerson":
|
|
|
+ if (in_array($this->SOURCE['TABLE'], ['BI_audit_KRS_person'])) $this->showKrsForKrsPerson();
|
|
|
+ else throw new Exception("Błąd wyzwolenia funkcji BiAuditGenerate");
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ switch ($this->SOURCE['TABLE']) {
|
|
|
+ case "BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA":
|
|
|
+ $powiazania = DB::getPDO()->fetchall("select * from BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA where ID = '{$this->SOURCE['ID']}'");
|
|
|
+ if (!$powiazania) throw new Exception("Błąd danych");
|
|
|
+ $this->powiazanie = $powiazania[0];
|
|
|
+ switch ($this->powiazanie['FILE_STATUS']) {
|
|
|
+ case "NONE":
|
|
|
+ $this->initializePowiazania();
|
|
|
+ break;
|
|
|
+ case "IN_PROGRESS":
|
|
|
+ $this->showPowiazania_progress();
|
|
|
+ break;
|
|
|
+ case "GENERATED":
|
|
|
+ $this->showPowiazania();
|
|
|
+ break;
|
|
|
+ default: throw new Exception("Błędny status rekordu");
|
|
|
+ }
|
|
|
break;
|
|
|
- case "GENERATED":
|
|
|
- $this->showPowiazania();
|
|
|
+ case "BI_audit_ENERGA_PRACOWNICY":
|
|
|
+ $this->showPowiazaniaList();
|
|
|
break;
|
|
|
- default: throw new Exception("Błędny status rekordu");
|
|
|
+ default: throw new Exception("Błąd wyzwolenia funkcji BiAuditGenerate");
|
|
|
}
|
|
|
- break;
|
|
|
- case "BI_audit_ENERGA_PRACOWNICY":
|
|
|
- $this->showPowiazaniaList();
|
|
|
- break;
|
|
|
- case "BI_audit_KRS":
|
|
|
- case "BI_audit_MSIG":
|
|
|
- $this->importToPracownicySearch($this->SOURCE['ID']);
|
|
|
- break;
|
|
|
- case "BI_audit_KRS_person":
|
|
|
- $this->showKrsForKrsPerson();
|
|
|
- break;
|
|
|
- default: throw new Exception("Błąd wyzwolenia funkcji BiAuditGenerate");
|
|
|
}
|
|
|
} catch (Exception $e) {
|
|
|
SE_Layout::alert('danger',$e->getMessage());
|
|
|
@@ -1768,7 +1773,7 @@ function toggleCheckSecond(check) {
|
|
|
elseif (($ID = V::get('ID_BI_audit_KRS_person', 0, $_GET, 'int')) > 0) $this->SOURCE['TABLE'] = 'BI_audit_KRS_person';
|
|
|
if ($this->SOURCE) {
|
|
|
$this->SOURCE['ID'] = $ID;
|
|
|
- $this->powiazania();
|
|
|
+ $this->urlActionOnItem();
|
|
|
}
|
|
|
elseif ($TABLE = V::get('_fromNamespace', '', $_GET)) {
|
|
|
$this->SOURCE['TABLE'] = ACL::getAclByTypeName($TABLE)->getRootTableName();
|
|
|
@@ -3716,7 +3721,7 @@ class BiAuditPowiazania {
|
|
|
$query = "select `note`.* from `BI_audit_operational_raport_note` `note` join `{$refTable}` `ref` on `note`.`ID` = `ref`.`PRIMARY_KEY` where `ref`.`REMOTE_PRIMARY_KEY` = '{$row['REMOTE_ID']}'";
|
|
|
$notes = DB::getPDO()->fetchAll($query);
|
|
|
foreach ($notes as $note) {
|
|
|
- $item_result[$row['REMOTE_TABLE']]['BI_audit_operational_raport_note'] = array_merge(['@attributes' => ['fid' => "BI_audit_operational_raport_note.{$note['ID']}"]], $note);
|
|
|
+ $item_result[$row['REMOTE_TABLE']]['BI_audit_operational_raport_note'][] = array_merge(['@attributes' => ['fid' => "BI_audit_operational_raport_note.{$note['ID']}"]], $note);
|
|
|
}
|
|
|
}
|
|
|
|