update
This commit is contained in:
@@ -247,7 +247,7 @@ class CalcController extends MainController implements ControllerInterface {
|
||||
|
||||
$dalData = MfParticipantDAL::GetDalDataObj();
|
||||
$dalData->addCondition('location', $location);
|
||||
//$dalData->setSortBy();
|
||||
$dalData->setSortBy('id_mf_participant DESC');
|
||||
|
||||
$arrayObjReg = MfParticipantDAL::GetResult($dalData);
|
||||
//Utils::ArrayDisplay($arrayObjReg);
|
||||
|
||||
@@ -52,7 +52,8 @@
|
||||
Ulica i numer: {$obj->getAddress()}</br>
|
||||
Kod pocztowy: {$obj->getPostCode()}</br>
|
||||
Miejscowość: {$obj->getCity()}</br>
|
||||
NIP Instytucji: {$obj->getNip()}</br></td>
|
||||
NIP Instytucji: {$obj->getNip()}</br>
|
||||
Dodatkowe informacje: {$obj->getAdditionalInfo()}</br></td>
|
||||
<td>Referat: {$obj->getReferat()|replace:1:$registrationYes|replace:0:$registrationNo|replace:2:$registrationNo}</br>
|
||||
Poster: {$obj->getPoster()|replace:1:$registrationYes|replace:0:$registrationNo|replace:2:$registrationNo}
|
||||
<p>{'registration_topic'|translate}: {$obj->getMessage()|default:$registrationMissing}</p>
|
||||
|
||||
BIN
_rejestracja/Static/image/Admin/Thumbs.db
Normal file
BIN
_rejestracja/Static/image/Admin/Thumbs.db
Normal file
Binary file not shown.
@@ -161,6 +161,7 @@ class IndexController extends MainController implements ControllerInterface {
|
||||
$objParticipant->setPostCode(Request::GetPost('post_code'));
|
||||
$objParticipant->setCity(Request::GetPost('city'));
|
||||
$objParticipant->setNip(Request::GetPost('nip'));
|
||||
$objParticipant->setAdditionalInfo(Request::GetPost('additional_info'));
|
||||
$objParticipant->setReferat(Request::GetPost('referat'));
|
||||
$objParticipant->setPoster(Request::GetPost('poster'));
|
||||
$objParticipant->setMessage(Request::GetPost('message'));
|
||||
|
||||
@@ -45,6 +45,7 @@ class MfParticipant extends DataObject{
|
||||
'autor' => 'autor',
|
||||
'name' => 'name',
|
||||
'nip' => 'nip',
|
||||
'additional_info' => 'additionalInfo',
|
||||
'phone' => 'phone',
|
||||
'position' => 'position',
|
||||
'post_code' => 'postCode',
|
||||
@@ -89,6 +90,7 @@ class MfParticipant extends DataObject{
|
||||
private $autor;
|
||||
private $name;
|
||||
private $nip;
|
||||
private $additionalInfo;
|
||||
private $phone;
|
||||
private $position;
|
||||
private $postCode;
|
||||
@@ -314,7 +316,15 @@ class MfParticipant extends DataObject{
|
||||
$this->nip = $nip;
|
||||
}
|
||||
|
||||
|
||||
public function getAdditionalInfo(){
|
||||
return $this->additionalInfo;
|
||||
}
|
||||
|
||||
public function setAdditionalInfo($additionalInfo){
|
||||
$this->additionalInfo = $additionalInfo;
|
||||
}
|
||||
|
||||
|
||||
public function getPhone(){
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
1
_rejestracja/sql/2026-04-27-additional-info-field.sql
Normal file
1
_rejestracja/sql/2026-04-27-additional-info-field.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE `mf_participant` ADD COLUMN `additional_info` TEXT NULL DEFAULT NULL AFTER `nip`;
|
||||
99
_rejestracja/sql/apply-2026-04-27-additional-info-field.php
Normal file
99
_rejestracja/sql/apply-2026-04-27-additional-info-field.php
Normal file
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
/**
|
||||
* One-off migration: adds additional_info column to mf_participant.
|
||||
*
|
||||
* Usage:
|
||||
* - Browser: /_rejestracja/sql/apply-2026-04-27-additional-info-field.php?run=20260427
|
||||
* - CLI: php apply-2026-04-27-additional-info-field.php --run
|
||||
*
|
||||
* Remove this file from the server after a successful production run.
|
||||
*/
|
||||
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$isCli = PHP_SAPI === 'cli';
|
||||
$approved = $isCli
|
||||
? in_array('--run', $argv, true)
|
||||
: (isset($_GET['run']) && $_GET['run'] === '20260427');
|
||||
|
||||
header_safe('Content-Type: text/plain; charset=utf-8');
|
||||
|
||||
if (!$approved) {
|
||||
echo "DRY RUN ONLY\n";
|
||||
echo "To apply migration, run with ?run=20260427 in browser or --run in CLI.\n";
|
||||
echo "No database changes were made.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$configPath = __DIR__ . '/../core/config/Strona/db.config.ini';
|
||||
if (!is_file($configPath)) {
|
||||
fail("Config file not found: " . $configPath);
|
||||
}
|
||||
|
||||
$config = parse_ini_file($configPath, true);
|
||||
if (!isset($config['db'])) {
|
||||
fail("Missing [db] section in config.");
|
||||
}
|
||||
|
||||
$dbConfig = $config['db'];
|
||||
foreach (array('prodHost', 'prodUser', 'prodPass', 'prodDb') as $key) {
|
||||
if (!array_key_exists($key, $dbConfig)) {
|
||||
fail("Missing db config key: " . $key);
|
||||
}
|
||||
}
|
||||
|
||||
$mysqli = new mysqli(
|
||||
$dbConfig['prodHost'],
|
||||
$dbConfig['prodUser'],
|
||||
$dbConfig['prodPass'],
|
||||
$dbConfig['prodDb']
|
||||
);
|
||||
|
||||
if ($mysqli->connect_errno) {
|
||||
fail("MySQL connection failed: " . $mysqli->connect_error);
|
||||
}
|
||||
|
||||
$mysqli->set_charset('utf8');
|
||||
|
||||
echo "Checking mf_participant.additional_info column...\n";
|
||||
|
||||
$result = $mysqli->query(
|
||||
"SELECT COUNT(*) AS cnt
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'mf_participant'
|
||||
AND COLUMN_NAME = 'additional_info'"
|
||||
);
|
||||
|
||||
if (!$result) {
|
||||
fail("INFORMATION_SCHEMA query failed: " . $mysqli->error);
|
||||
}
|
||||
|
||||
$row = $result->fetch_assoc();
|
||||
|
||||
if ((int)$row['cnt'] > 0) {
|
||||
echo "Column additional_info already exists. Nothing to do.\n";
|
||||
$mysqli->close();
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!$mysqli->query("ALTER TABLE `mf_participant` ADD COLUMN `additional_info` TEXT NULL DEFAULT NULL AFTER `nip`")) {
|
||||
fail("ALTER TABLE failed: " . $mysqli->error);
|
||||
}
|
||||
|
||||
echo "Column additional_info added successfully.\n";
|
||||
$mysqli->close();
|
||||
|
||||
function fail($message) {
|
||||
echo "ERROR: " . $message . "\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
function header_safe($header) {
|
||||
if (!headers_sent() && PHP_SAPI !== 'cli') {
|
||||
header($header);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -74,9 +74,15 @@
|
||||
<div class="label">{translate word='NIP Instytucji'}:</div>
|
||||
<div class="value">
|
||||
{formField name="nip" type="text" errorClass="warning"}
|
||||
<div style="font-size: 11px; line-height: 1.3; margin-top: 4px;">{translate word='Do wypełnienia w przypadku posiadania identyfikatora wewnętrznego w KSEF i prośba o podanie KSeF ID wew.'}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="entry">
|
||||
<div class="label">Dodatkowe informacje:</div>
|
||||
<div class="value">
|
||||
<div style="font-size: 11px; line-height: 1.3; margin-bottom: 4px;">{translate word='Do wypełnienia w przypadku posiadania identyfikatora wewnętrznego w KSEF i prośba o podanie KSeF ID wew.'}</div>
|
||||
<textarea name="additional_info" rows="3" style="width:100%; box-sizing:border-box;">{if isset($smarty.post.additional_info)}{$smarty.post.additional_info|escape}{/if}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cb"></div>
|
||||
<div class="entry">
|
||||
<div class="label">{translate word='registration_submit_talk'}</div>
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
Kod pocztowy: {$objParticipant->getPostCode()|default:$registrationMissing}<br>
|
||||
Miejscowość: {$objParticipant->getCity()|default:$registrationMissing}<br>
|
||||
NIP Instytucji: {$objParticipant->getNip()|default:$registrationMissing}<br>
|
||||
Dodatkowe informacje: {$objParticipant->getAdditionalInfo()|default:$registrationMissing}<br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
Kod pocztowy: {$objParticipant->getPostCode()|default:'brak'}<br>
|
||||
Miejscowość: {$objParticipant->getCity()|default:'brak'}<br>
|
||||
NIP Instytucji: {$objParticipant->getNip()|default:'brak'}<br>
|
||||
Dodatkowe informacje: {$objParticipant->getAdditionalInfo()|default:'brak'}<br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -73,7 +73,14 @@
|
||||
<div class="entry">
|
||||
<div class="label">{translate word='NIP Instytucji'}:</div>
|
||||
<div class="value">{formField name="nip" type="text" errorClass="warning"}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="entry">
|
||||
<div class="label">Dodatkowe informacje:</div>
|
||||
<div class="value">
|
||||
<div style="font-size: 11px; line-height: 1.3; margin-bottom: 4px;">{translate word='Do wypełnienia w przypadku posiadania identyfikatora wewnętrznego w KSEF i prośba o podanie KSeF ID wew.'}</div>
|
||||
<textarea name="additional_info" rows="3" style="width:100%; box-sizing:border-box;">{if isset($smarty.post.additional_info)}{$smarty.post.additional_info|escape}{/if}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cb"></div>
|
||||
<div class="entry">
|
||||
<div class="label">Zgłaszam referat</div>
|
||||
|
||||
Reference in New Issue
Block a user