dbmsv4 init...3
This commit is contained in:
parent
a2d07c384b
commit
2558691116
@ -20,7 +20,13 @@ abstract class CommonForm
|
|||||||
{
|
{
|
||||||
$this->_validation = service('validation');
|
$this->_validation = service('validation');
|
||||||
}
|
}
|
||||||
abstract public function action_init_process(string $action, array $formDatas = []): void;
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
|
{
|
||||||
|
$actionButtons = ['view' => ICONS['SEARCH'], 'delete' => ICONS['DELETE']];
|
||||||
|
$batchjobButtons = [];
|
||||||
|
$this->setActionButtons($actionButtons);
|
||||||
|
$this->setBatchjobButtons($batchjobButtons);
|
||||||
|
}
|
||||||
final public function setAttributes(array $attributes): void
|
final public function setAttributes(array $attributes): void
|
||||||
{
|
{
|
||||||
$this->_attributes = $attributes;
|
$this->_attributes = $attributes;
|
||||||
|
|||||||
@ -10,6 +10,7 @@ class AccountForm extends WalletForm
|
|||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
{
|
{
|
||||||
|
parent::action_init_process($action, $formDatas);
|
||||||
$fields = [
|
$fields = [
|
||||||
"clientinfo_uid",
|
"clientinfo_uid",
|
||||||
"bank",
|
"bank",
|
||||||
@ -26,8 +27,9 @@ class AccountForm extends WalletForm
|
|||||||
"status",
|
"status",
|
||||||
];
|
];
|
||||||
$indexFilter = $filters;
|
$indexFilter = $filters;
|
||||||
$actionButtons = ['view' => ICONS['SEARCH']];
|
|
||||||
$batchjobFilters = ['bank', 'status'];
|
$batchjobFilters = ['bank', 'status'];
|
||||||
|
$actionButtons = ['view' => ICONS['SEARCH']];
|
||||||
|
$batchjobButtons = [];
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'create':
|
case 'create':
|
||||||
case 'create_form':
|
case 'create_form':
|
||||||
@ -58,8 +60,9 @@ class AccountForm extends WalletForm
|
|||||||
$this->setFormFilters($filters);
|
$this->setFormFilters($filters);
|
||||||
$this->setFormOptions($action, $filters, $formDatas);
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
$this->setIndexFilters($indexFilter);
|
$this->setIndexFilters($indexFilter);
|
||||||
$this->setActionButtons($actionButtons);
|
|
||||||
$this->setBatchjobFilters($batchjobFilters);
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
$this->setActionButtons($actionButtons);
|
||||||
|
$this->setBatchjobButtons($batchjobButtons);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFormRule(string $action, string $field, array $formRules): array
|
public function getFormRule(string $action, string $field, array $formRules): array
|
||||||
|
|||||||
@ -10,6 +10,7 @@ class CouponForm extends WalletForm
|
|||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
{
|
{
|
||||||
|
parent::action_init_process($action, $formDatas);
|
||||||
$fields = [
|
$fields = [
|
||||||
"clientinfo_uid",
|
"clientinfo_uid",
|
||||||
"title",
|
"title",
|
||||||
@ -22,8 +23,9 @@ class CouponForm extends WalletForm
|
|||||||
"status",
|
"status",
|
||||||
];
|
];
|
||||||
$indexFilter = $filters;
|
$indexFilter = $filters;
|
||||||
$actionButtons = ['view' => ICONS['SEARCH']];
|
|
||||||
$batchjobFilters = ['status'];
|
$batchjobFilters = ['status'];
|
||||||
|
$actionButtons = ['view' => ICONS['SEARCH']];
|
||||||
|
$batchjobButtons = [];
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'create':
|
case 'create':
|
||||||
case 'create_form':
|
case 'create_form':
|
||||||
@ -49,7 +51,8 @@ class CouponForm extends WalletForm
|
|||||||
$this->setFormFilters($filters);
|
$this->setFormFilters($filters);
|
||||||
$this->setFormOptions($action, $filters, $formDatas);
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
$this->setIndexFilters($indexFilter);
|
$this->setIndexFilters($indexFilter);
|
||||||
$this->setActionButtons($actionButtons);
|
|
||||||
$this->setBatchjobFilters($batchjobFilters);
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
$this->setActionButtons($actionButtons);
|
||||||
|
$this->setBatchjobButtons($batchjobButtons);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,7 @@ class PointForm extends WalletForm
|
|||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
{
|
{
|
||||||
|
parent::action_init_process($action, $formDatas);
|
||||||
$fields = [
|
$fields = [
|
||||||
"clientinfo_uid",
|
"clientinfo_uid",
|
||||||
"title",
|
"title",
|
||||||
@ -22,8 +23,9 @@ class PointForm extends WalletForm
|
|||||||
"status",
|
"status",
|
||||||
];
|
];
|
||||||
$indexFilter = $filters;
|
$indexFilter = $filters;
|
||||||
$actionButtons = ['view' => ICONS['SEARCH']];
|
|
||||||
$batchjobFilters = ['status'];
|
$batchjobFilters = ['status'];
|
||||||
|
$actionButtons = ['view' => ICONS['SEARCH']];
|
||||||
|
$batchjobButtons = [];
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'create':
|
case 'create':
|
||||||
case 'create_form':
|
case 'create_form':
|
||||||
@ -49,7 +51,8 @@ class PointForm extends WalletForm
|
|||||||
$this->setFormFilters($filters);
|
$this->setFormFilters($filters);
|
||||||
$this->setFormOptions($action, $filters, $formDatas);
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
$this->setIndexFilters($indexFilter);
|
$this->setIndexFilters($indexFilter);
|
||||||
$this->setActionButtons($actionButtons);
|
|
||||||
$this->setBatchjobFilters($batchjobFilters);
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
$this->setActionButtons($actionButtons);
|
||||||
|
$this->setBatchjobButtons($batchjobButtons);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,8 @@ class CHASSISForm extends EquipmentForm
|
|||||||
];
|
];
|
||||||
$indexFilter = $filters;
|
$indexFilter = $filters;
|
||||||
$batchjobFilters = ['status'];
|
$batchjobFilters = ['status'];
|
||||||
|
$actionButtons = ['view' => ICONS['SEARCH']];
|
||||||
|
$batchjobButtons = ['batchjob' => '일괄처리'];
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'create':
|
case 'create':
|
||||||
case 'create_form':
|
case 'create_form':
|
||||||
@ -41,6 +43,8 @@ class CHASSISForm extends EquipmentForm
|
|||||||
$this->setFormOptions($action, $filters, $formDatas);
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
$this->setIndexFilters($indexFilter);
|
$this->setIndexFilters($indexFilter);
|
||||||
$this->setBatchjobFilters($batchjobFilters);
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
$this->setActionButtons($actionButtons);
|
||||||
|
$this->setBatchjobButtons($batchjobButtons);
|
||||||
}
|
}
|
||||||
public function getFormRule(string $action, string $field, array $formRules): array
|
public function getFormRule(string $action, string $field, array $formRules): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -23,6 +23,8 @@ class LineForm extends EquipmentForm
|
|||||||
];
|
];
|
||||||
$indexFilter = $filters;
|
$indexFilter = $filters;
|
||||||
$batchjobFilters = ['status'];
|
$batchjobFilters = ['status'];
|
||||||
|
$actionButtons = ['view' => ICONS['SEARCH']];
|
||||||
|
$batchjobButtons = [];
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'create':
|
case 'create':
|
||||||
case 'create_form':
|
case 'create_form':
|
||||||
@ -44,15 +46,18 @@ class LineForm extends EquipmentForm
|
|||||||
$this->setFormOptions($action, $filters, $formDatas);
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
$this->setIndexFilters($indexFilter);
|
$this->setIndexFilters($indexFilter);
|
||||||
$this->setBatchjobFilters($batchjobFilters);
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
$this->setActionButtons($actionButtons);
|
||||||
|
$this->setBatchjobButtons($batchjobButtons);
|
||||||
}
|
}
|
||||||
public function getFormRule(string $action, string $field, array $formRules): array
|
public function getFormRule(string $action, string $field, array $formRules): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case "bandwith":
|
case "bandwith":
|
||||||
case "type":
|
case "type":
|
||||||
|
case "status":
|
||||||
|
case "start_at":
|
||||||
$formRules[$field] = "required|trim|string";
|
$formRules[$field] = "required|trim|string";
|
||||||
break;
|
break;
|
||||||
case "start_at":
|
|
||||||
case "end_at":
|
case "end_at":
|
||||||
$formRules[$field] = "permit_empty|valid_date";
|
$formRules[$field] = "permit_empty|valid_date";
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -24,6 +24,8 @@ class IPForm extends PartForm
|
|||||||
];
|
];
|
||||||
$indexFilter = $filters;
|
$indexFilter = $filters;
|
||||||
$batchjobFilters = ['status'];
|
$batchjobFilters = ['status'];
|
||||||
|
$actionButtons = ['view' => ICONS['SEARCH']];
|
||||||
|
$batchjobButtons = ['batchjob' => '일괄처리'];
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'create':
|
case 'create':
|
||||||
case 'create_form':
|
case 'create_form':
|
||||||
@ -59,6 +61,8 @@ class IPForm extends PartForm
|
|||||||
$this->setFormOptions($action, $filters, $formDatas);
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
$this->setIndexFilters($indexFilter);
|
$this->setIndexFilters($indexFilter);
|
||||||
$this->setBatchjobFilters($batchjobFilters);
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
$this->setActionButtons($actionButtons);
|
||||||
|
$this->setBatchjobButtons($batchjobButtons);
|
||||||
}
|
}
|
||||||
public function getFormRule(string $action, string $field, array $formRules): array
|
public function getFormRule(string $action, string $field, array $formRules): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -22,6 +22,8 @@ class SWITCHForm extends PartForm
|
|||||||
];
|
];
|
||||||
$indexFilter = $filters;
|
$indexFilter = $filters;
|
||||||
$batchjobFilters = ['status',];
|
$batchjobFilters = ['status',];
|
||||||
|
$actionButtons = ['view' => ICONS['SEARCH']];
|
||||||
|
$batchjobButtons = ['batchjob' => '일괄처리'];
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'create':
|
case 'create':
|
||||||
case 'create_form':
|
case 'create_form':
|
||||||
@ -60,6 +62,8 @@ class SWITCHForm extends PartForm
|
|||||||
$this->setFormOptions($action, $filters, $formDatas);
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
$this->setIndexFilters($indexFilter);
|
$this->setIndexFilters($indexFilter);
|
||||||
$this->setBatchjobFilters($batchjobFilters);
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
$this->setActionButtons($actionButtons);
|
||||||
|
$this->setBatchjobButtons($batchjobButtons);
|
||||||
}
|
}
|
||||||
public function getFormRule(string $action, string $field, array $formRules): array
|
public function getFormRule(string $action, string $field, array $formRules): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -25,7 +25,7 @@ class PaymentForm extends CommonForm
|
|||||||
$filters = ['user_uid', 'clientinfo_uid', 'serviceinfo_uid', 'status', 'billing', 'pay'];
|
$filters = ['user_uid', 'clientinfo_uid', 'serviceinfo_uid', 'status', 'billing', 'pay'];
|
||||||
$indexFilter = ['clientinfo_uid', 'serviceinfo_uid', 'status', 'billing', 'pay'];
|
$indexFilter = ['clientinfo_uid', 'serviceinfo_uid', 'status', 'billing', 'pay'];
|
||||||
$batchjobFilters = ['status'];
|
$batchjobFilters = ['status'];
|
||||||
$actionButtons = ['paid' => '결제', 'view' => ICONS['SEARCH'], 'delete' => ICONS['DELETE']];
|
$actionButtons = ['paid' => '결제', 'view' => ICONS['SEARCH']];
|
||||||
$batchjobButtons = ['batchjob' => '일괄결제', 'invoice' => '청구서발행'];
|
$batchjobButtons = ['batchjob' => '일괄결제', 'invoice' => '청구서발행'];
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'create':
|
case 'create':
|
||||||
@ -73,8 +73,8 @@ class PaymentForm extends CommonForm
|
|||||||
$this->setFormFilters($filters);
|
$this->setFormFilters($filters);
|
||||||
$this->setFormOptions($action, $filters, $formDatas);
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
$this->setIndexFilters($indexFilter);
|
$this->setIndexFilters($indexFilter);
|
||||||
$this->setActionButtons($actionButtons);
|
|
||||||
$this->setBatchjobFilters($batchjobFilters);
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
$this->setActionButtons($actionButtons);
|
||||||
$this->setBatchjobButtons($batchjobButtons);
|
$this->setBatchjobButtons($batchjobButtons);
|
||||||
}
|
}
|
||||||
public function getFormRule(string $action, string $field, array $formRules): array
|
public function getFormRule(string $action, string $field, array $formRules): array
|
||||||
|
|||||||
@ -25,25 +25,4 @@ class CHASSISHelper extends EquipmentHelper
|
|||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
switch ($action) {
|
|
||||||
case 'modify':
|
|
||||||
$action = form_label(
|
|
||||||
$label,
|
|
||||||
'disk_modify',
|
|
||||||
[
|
|
||||||
"data-src" => "admin/equipment/chassis/modify/{$viewDatas['entity']->getPK()}",
|
|
||||||
"data-bs-toggle" => "modal",
|
|
||||||
"data-bs-target" => "#modal_action_form",
|
|
||||||
"class" => "text-primary form-label-sm",
|
|
||||||
]
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$action = parent::getListButton($action, $label, $viewDatas, $extras);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $action;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,25 +8,4 @@ class DISKHelper extends PartHelper
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
switch ($action) {
|
|
||||||
case 'modify':
|
|
||||||
$action = form_label(
|
|
||||||
$label,
|
|
||||||
'disk_modify',
|
|
||||||
[
|
|
||||||
"data-src" => "admin/part/disk/modify/{$viewDatas['entity']->getPK()}",
|
|
||||||
"data-bs-toggle" => "modal",
|
|
||||||
"data-bs-target" => "#modal_action_form",
|
|
||||||
"class" => "text-primary form-label-sm",
|
|
||||||
]
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$action = parent::getListButton($action, $label, $viewDatas, $extras);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $action;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,25 +8,4 @@ class RAMHelper extends PartHelper
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
switch ($action) {
|
|
||||||
case 'modify':
|
|
||||||
$action = form_label(
|
|
||||||
$label,
|
|
||||||
'ram_modify',
|
|
||||||
[
|
|
||||||
"data-src" => "admin/part/ram/modify/{$viewDatas['entity']->getPK()}",
|
|
||||||
"data-bs-toggle" => "modal",
|
|
||||||
"data-bs-target" => "#modal_action_form",
|
|
||||||
"class" => "text-primary form-label-sm",
|
|
||||||
]
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$action = parent::getListButton($action, $label, $viewDatas, $extras);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $action;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -182,7 +182,6 @@ abstract class CommonService
|
|||||||
$this->getFormService()->validate($formDatas);
|
$this->getFormService()->validate($formDatas);
|
||||||
// 💡 동적으로 가져온 Entity 클래스 이름으로 instanceof 검사
|
// 💡 동적으로 가져온 Entity 클래스 이름으로 instanceof 검사
|
||||||
$entityClass = $this->getEntityClass();
|
$entityClass = $this->getEntityClass();
|
||||||
dd($formDatas);
|
|
||||||
$entity = new $entityClass($formDatas);
|
$entity = new $entityClass($formDatas);
|
||||||
if (!$entity instanceof $entityClass) {
|
if (!$entity instanceof $entityClass) {
|
||||||
throw new RuntimeException("Return Type은 {$entityClass}만 가능");
|
throw new RuntimeException("Return Type은 {$entityClass}만 가능");
|
||||||
|
|||||||
@ -14,6 +14,7 @@
|
|||||||
</th>
|
</th>
|
||||||
<th style="width: 200px"><?= $serverCellDatas['serverPartHelper']->getListButton('IP', '추가IP', ['serverinfo_uid' => $entity->getPK()]) ?></th>
|
<th style="width: 200px"><?= $serverCellDatas['serverPartHelper']->getListButton('IP', '추가IP', ['serverinfo_uid' => $entity->getPK()]) ?></th>
|
||||||
<th style="width: 200px"><?= $serverCellDatas['serverPartHelper']->getListButton('CS', 'CS', ['serverinfo_uid' => $entity->getPK()]) ?></th>
|
<th style="width: 200px"><?= $serverCellDatas['serverPartHelper']->getListButton('CS', 'CS', ['serverinfo_uid' => $entity->getPK()]) ?></th>
|
||||||
|
<th style="width: 200px"><?= $serverCellDatas['serverPartHelper']->getListButton('SOFTWARE', 'SOFTWARE', ['serverinfo_uid' => $entity->getPK()]) ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="text-center">
|
<tr class="text-center">
|
||||||
<td nowrap>
|
<td nowrap>
|
||||||
|
|||||||
@ -7,7 +7,6 @@
|
|||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?php foreach ($serverPartCellDatas['entities']['IP'] as $entities): ?>
|
<?php foreach ($serverPartCellDatas['entities']['IP'] as $entities): ?>
|
||||||
@ -24,5 +23,12 @@
|
|||||||
<div><?= $serverPartCellDatas['helper']->getFieldView('CS', $entity->getPK(), $serverPartCellDatas) ?></div>
|
<div><?= $serverPartCellDatas['helper']->getFieldView('CS', $entity->getPK(), $serverPartCellDatas) ?></div>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php foreach ($serverPartCellDatas['entities']['SOFTWARE'] as $entities): ?>
|
||||||
|
<?php foreach ($entities as $entity): ?>
|
||||||
|
<?php $serverPartCellDatas['entity'] = $entity ?>
|
||||||
|
<div><?= $serverPartCellDatas['helper']->getFieldView('SOFTWARE', $entity->getPK(), $serverPartCellDatas) ?></div>
|
||||||
|
<?php endforeach ?>
|
||||||
|
<?php endforeach ?>
|
||||||
</td>
|
</td>
|
||||||
Loading…
Reference in New Issue
Block a user