Skip to content

Commit

Permalink
Merge branch 'master' into testing
Browse files Browse the repository at this point in the history
  • Loading branch information
bkralik committed Jan 7, 2025
2 parents 8980cea + e62b04b commit 960edf0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
14 changes: 12 additions & 2 deletions app/model/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ public function logujDelete($staraData, $sloupecPrefix, &$log) {
}
}

// Uzivatel_id je ten, kdo zmenu provedl
public function loguj($tabulka, $tabulka_id, $data, $uzivatel_id = null) {
if (!is_array($data) || count($data) == 0) {
return true;
Expand All @@ -181,16 +182,25 @@ public function loguj($tabulka, $tabulka_id, $data, $uzivatel_id = null) {
// Je bezpodminecne nutne mit stejny cas pro vsechny polozky, proto se
// vytvari uz tady a ne az triggerem v DB!
$ted = new Nette\Utils\DateTime();

// Zmenu udelal prihlaseny uzivatel
if (empty($uzivatel_id)) {
$uzivatel_id = $this->userService->getId();
}

// Pokud neni zadny uzivatel prihlaseny (napr verejny callback) a logujeme neco u uzivatele, vem jeho
if (empty($uzivatel_id) & $tabulka == 'Uzivatel') {
$uzivatel_id = $tabulka_id;
}

// A pokud ani to nevyjde, zaloguj to pod systemovym uzivatelem
if (empty($uzivatel_id)) {
$uzivatel_id = $this->userService->getId();
$uzivatel_id = 1;
}

$spolecne = array(
'Uzivatel_id' => $uzivatel_id,
'ip_adresa' => $this->request->getRemoteAddress(),
'ip_adresa' => $this->request->getRemoteAddress() ?? '',
'tabulka' => $tabulka,
'tabulka_id' => $tabulka_id,
'datum' => $ted
Expand Down
3 changes: 2 additions & 1 deletion app/templates/email/druzstvoContractButton.latte
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@
[email protected] – </span><span
style="font-size: 12px; color: #000000; font-weight: 700; text-decoration: none;">&nbsp;📞</span><span
style="font-size: 12px; color: #000000; font-weight: 400; text-decoration: none;">
608&nbsp;10&nbsp;10&nbsp;70 (pracovní dny 9-17h) – 🌐 https://www.hkfree.org</span>
608&nbsp;10&nbsp;10&nbsp;70 nebo <a href="https://wa.me/420608101070">WhatsApp</a> (pracovní dny 9-17h)
– 🌐 https://www.hkfree.org</span>
<div></div>
<div>
<span style="font-size:9pt; color:#000000; font-weight:r00; text-decoration:none;">
Expand Down
2 changes: 1 addition & 1 deletion pdfGenerator/www/smlouvaUcastnicka.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
$content = file_get_contents("$templateRandomizedName/content.xml");
$content = str_replace(
array_map(fn ($s): string => '{'.$s.'}', array_keys($_GET)),
array_values($_GET),
array_map(fn ($s): string => htmlspecialchars($s), array_values($_GET)),
$content
);
// Zbylý placeholdery vyhodit
Expand Down

0 comments on commit 960edf0

Please sign in to comment.