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('formFilters', $this->service->getFormService()->getFormFilters());
$this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions()); $this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions());
$this->addViewDatas('index_batchjobFields', $this->service->getFormService()->getBatchjobFilters()); $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); parent::action_init_process($action);
} }
protected function create_form_process(array $formDatas = []): array protected function create_form_process(array $formDatas = []): array

View File

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

View File

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

View File

@ -16,7 +16,7 @@ class TrafficHelper extends CommonHelper
switch ($action) { switch ($action) {
case 'dashboard': case 'dashboard':
$action = form_label( $action = form_label(
$label ? $label : ICONS['SEARCH'], $label,
$action, $action,
[ [
"data-src" => current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK() . '?' . $viewDatas['uri']->getQuery(), "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> <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 ?> <?php foreach ($viewDatas['formFields'] as $field => $label): ?><td><?= $viewDatas['helper']->getFieldView($field, $entity->$field, $viewDatas) ?></td><?php endforeach ?>
<td nowrap> <td nowrap>
<?= $viewDatas['helper']->getListButton('view', '', $viewDatas) ?>&nbsp; <?php foreach ($viewDatas['index_batchjobButtons'] as $action => $label): ?>
<?= $viewDatas['helper']->getListButton('delete', '', $viewDatas) ?> <?= $viewDatas['helper']->getListButton($action, $label, $viewDatas) ?>&nbsp;
<?php endforeach ?>
</td> </td>
</tr> </tr>
<?php $cnt++ ?> <?php $cnt++ ?>

View File

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