Bug fix for Edit Order not loading

This commit is contained in:
2023-09-26 18:47:02 +09:00
parent 6ad844b519
commit 027c35f9f0
3 changed files with 57 additions and 4 deletions

View File

@@ -35,6 +35,8 @@ class EditBase
private \CoreLibs\Output\Form\Generate $form; private \CoreLibs\Output\Form\Generate $form;
/** @var \CoreLibs\Logging\Logging */ /** @var \CoreLibs\Logging\Logging */
public \CoreLibs\Logging\Logging $log; public \CoreLibs\Logging\Logging $log;
/** @var \CoreLibs\Language\L10n */
public \CoreLibs\Language\L10n $l;
/** @var \CoreLibs\ACL\Login */ /** @var \CoreLibs\ACL\Login */
public \CoreLibs\ACL\Login $login; public \CoreLibs\ACL\Login $login;
@@ -57,6 +59,7 @@ class EditBase
) { ) {
$this->log = $log; $this->log = $log;
$this->login = $login; $this->login = $login;
$this->l = $l10n;
// smarty template engine (extended Translation version) // smarty template engine (extended Translation version)
$this->smarty = new \CoreLibs\Template\SmartyExtend( $this->smarty = new \CoreLibs\Template\SmartyExtend(
$l10n, $l10n,
@@ -77,7 +80,7 @@ class EditBase
echo "I am sorry, but this page cannot be viewed by a mobile phone"; echo "I am sorry, but this page cannot be viewed by a mobile phone";
exit; exit;
} }
// $this->form->log->debug('POST', $this->form->log->prAr($_POST)); // $this->log->debug('POST', $this->log->prAr($_POST));
} }
/** /**
@@ -179,7 +182,7 @@ class EditBase
} // while read data ... } // while read data ...
// html title // html title
$this->HEADER['HTML_TITLE'] = $this->form->l->__('Edit Order'); $this->HEADER['HTML_TITLE'] = $this->l->__('Edit Order');
$messages = []; $messages = [];
$error = $_POST['error'] ?? 0; $error = $_POST['error'] ?? 0;
@@ -632,7 +635,7 @@ class EditBase
'editAdmin_' . $this->smarty->lang 'editAdmin_' . $this->smarty->lang
); );
$this->form->log->debug('DEBUGEND', '==================================== [Form END]'); $this->log->debug('DEBUGEND', '==================================== [Form END]');
} }
} }

View File

@@ -300,7 +300,8 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
// log // log
/** @var \CoreLibs\Logging\Logging */ /** @var \CoreLibs\Logging\Logging */
public \CoreLibs\Logging\Logging $log; public \CoreLibs\Logging\Logging $log;
/** @var \CoreLibs\DB\Extended\ArrayIO */
public \CoreLibs\DB\Extended\ArrayIO $dba;
// now some default error msgs (english) // now some default error msgs (english)
/** @var array<mixed> */ /** @var array<mixed> */
public array $language_array = []; public array $language_array = [];
@@ -382,6 +383,15 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
$this->base_acl_level, $this->base_acl_level,
$this->acl_admin $this->acl_admin
); );
$this->dba = new \CoreLibs\DB\Extended\ArrayIO(
$db_config,
$config_array['table_array'],
$config_array['table_name'],
$this->log,
// set the ACL
$this->base_acl_level,
$this->acl_admin
);
// here should be a check if the config_array is correct ... // here should be a check if the config_array is correct ...
if (isset($config_array['show_fields']) && is_array($config_array['show_fields'])) { if (isset($config_array['show_fields']) && is_array($config_array['show_fields'])) {
$this->field_array = $config_array['show_fields']; $this->field_array = $config_array['show_fields'];

View File

@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
namespace CoreLibs\Output\Form\TableArrays;
class EditOrder implements Interface\TableArraysInterface
{
/** @var \CoreLibs\Output\Form\Generate */
private \CoreLibs\Output\Form\Generate $form;
/**
* constructor
* @param \CoreLibs\Output\Form\Generate $form base form class
*/
public function __construct(\CoreLibs\Output\Form\Generate $form)
{
$this->form = $form;
$this->form->log->debug('CLASS LOAD', __NAMESPACE__ . __CLASS__);
}
/**
* NOTE: this is a dummy array to just init the Form\Generate class and is not used for anything else
*
* @return array<mixed>
*/
public function setTableArray(): array
{
return [
'table_array' => [
'-'
],
'table_name' => '-',
'load_query' => '',
'show_fields' => [],
];
}
}
// __END__