trafficmonitor init...1

This commit is contained in:
choi.jh 2025-11-13 16:03:47 +09:00
parent 81a3951f6b
commit 00cacff154
6 changed files with 29 additions and 17 deletions

View File

@ -48,7 +48,7 @@ abstract class AdminController extends CommonController
$this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters());
$this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions());
$this->addViewDatas('index_batchjobFields', $this->service->getFormService()->getBatchjobFilters());
$this->addViewDatas('index_batchjobButtions', $this->service->getFormService()->getBatchjobButtons());
$this->addViewDatas('index_batchjobButtons', $this->service->getFormService()->getBatchjobButtons());
parent::action_init_process($action);
}
protected function create_form_process(array $formDatas = []): array

View File

@ -13,6 +13,8 @@ abstract class CommonForm
private array $_formFilters = [];
private array $_batchjobFilters = [];
private array $_formOptions = [];
private array $_actionButtons = ['view' => ICONS['SEARCH'], 'delete' => ICONS['DELETE']];
private array $_batchjobButtons = ['batchjob' => '일괄처리', 'batchjob_delete' => '일괄삭제'];
protected function __construct() {}
final public function setAttributes(array $attributes): void
{
@ -94,12 +96,21 @@ abstract class CommonForm
{
return $this->_batchjobFilters;
}
final public function getBatchjobButtons(array $buttions = [
'batchjob' => '일괄 처리',
'batchjob_delete' => '일괄 삭제',
]): array
final public function setActionButtons(array $buttions): array
{
return $buttions;
return $this->_actionButtons = $buttions;
}
final public function getActionButtons(): array
{
return $this->_actionButtons;
}
final public function setBatchjobButtons(array $buttions): array
{
return $this->_batchjobButtons = $buttions;
}
final public function getBatchjobButtons(): array
{
return $this->_batchjobButtons;
}
//Validation용
public function validate(array $formDatas): bool

View File

@ -212,7 +212,7 @@ class CommonHelper
switch ($action) {
case 'create':
$action = form_label(
$label ? $label : '입력',
$label,
$action,
[
"data-src" => current_url() . '/' . $action . '?' . $viewDatas['uri']->getQuery(),
@ -234,7 +234,7 @@ class CommonHelper
"checked" => in_array($viewDatas['entity']->getPK(), $oldBatchJobUids)
]);
$action = $checkbox . form_label(
$label ? $label : '수정',
$label,
$action,
[
"data-src" => current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK() . '?' . $viewDatas['uri']->getQuery(),
@ -247,7 +247,7 @@ class CommonHelper
break;
case 'view':
$action = form_label(
$label ? $label : ICONS['SEARCH'],
$label,
$action,
[
"data-src" => current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK() . '?' . $viewDatas['uri']->getQuery(),
@ -261,7 +261,7 @@ class CommonHelper
case 'delete':
$action = anchor(
current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK(),
$label ? $label : ICONS['DELETE'],
$label,
[
"class" => "btn btn-sm btn-danger form-label-sm",
...$extras
@ -269,7 +269,7 @@ class CommonHelper
);
break;
case 'batchjob':
$action = form_submit("batchjob_submit", $label ? $label : '일괄처리', [
$action = form_submit("batchjob_submit", $label, [
"formaction" => current_url() . '/batchjob',
"class" => "btn btn-sm btn-warning form-label-sm",
...$extras,
@ -277,7 +277,7 @@ class CommonHelper
]);
break;
case 'batchjob_delete':
$action = form_submit("batchjob_submit", $label ? $label : '일괄삭제', [
$action = form_submit("batchjob_submit", $label, [
"formaction" => current_url() . '/batchjob_delete',
"class" => "btn btn-sm btn-danger form-label-sm",
...$extras,

View File

@ -16,7 +16,7 @@ class TrafficHelper extends CommonHelper
switch ($action) {
case 'dashboard':
$action = form_label(
$label ? $label : ICONS['SEARCH'],
$label,
$action,
[
"data-src" => current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK() . '?' . $viewDatas['uri']->getQuery(),

View File

@ -37,8 +37,9 @@ $template = "templates" . DIRECTORY_SEPARATOR . "{$viewDatas['layout']}";
<td nowrap><?= $viewDatas['helper']->getListButton('modify', $num, $viewDatas) ?></td>
<?php foreach ($viewDatas['formFields'] as $field => $label): ?><td><?= $viewDatas['helper']->getFieldView($field, $entity->$field, $viewDatas) ?></td><?php endforeach ?>
<td nowrap>
<?= $viewDatas['helper']->getListButton('view', '', $viewDatas) ?>&nbsp;
<?= $viewDatas['helper']->getListButton('delete', '', $viewDatas) ?>
<?php foreach ($viewDatas['index_batchjobButtons'] as $action => $label): ?>
<?= $viewDatas['helper']->getListButton($action, $label, $viewDatas) ?>&nbsp;
<?php endforeach ?>
</td>
</tr>
<?php $cnt++ ?>

View File

@ -1,11 +1,11 @@
<div class="index_batchjob">
<ul class="nav justify-content-center">
<li class="nav-item"><?= $viewDatas['helper']->getListButton('create', '', $viewDatas) ?></li>
<li class="nav-item"><?= $viewDatas['helper']->getListButton('create', "입력", $viewDatas) ?></li>
<li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li>
<?php foreach ($viewDatas['index_batchjobFields'] as $field): ?>
<?= $viewDatas['helper']->getListFilter($field, null, $viewDatas, ['data-batchjob' => 'true']) ?>&nbsp;
<?php endforeach ?>
<?php foreach ($viewDatas['index_batchjobButtions'] as $action => $label): ?>
<?php foreach ($viewDatas['index_batchjobButtons'] as $action => $label): ?>
<li class="nav-item"><?= $viewDatas['helper']->getListButton($action, $label, $viewDatas) ?></li>
<?php endforeach ?>
</ul>