diff --git a/app/Forms/CommonForm.php b/app/Forms/CommonForm.php index 78cd163..e5e36d1 100644 --- a/app/Forms/CommonForm.php +++ b/app/Forms/CommonForm.php @@ -20,7 +20,13 @@ abstract class CommonForm { $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 { $this->_attributes = $attributes; diff --git a/app/Forms/Customer/Wallet/AccountForm.php b/app/Forms/Customer/Wallet/AccountForm.php index 284d4ea..d379bf1 100644 --- a/app/Forms/Customer/Wallet/AccountForm.php +++ b/app/Forms/Customer/Wallet/AccountForm.php @@ -10,6 +10,7 @@ class AccountForm extends WalletForm } public function action_init_process(string $action, array $formDatas = []): void { + parent::action_init_process($action, $formDatas); $fields = [ "clientinfo_uid", "bank", @@ -26,8 +27,9 @@ class AccountForm extends WalletForm "status", ]; $indexFilter = $filters; - $actionButtons = ['view' => ICONS['SEARCH']]; $batchjobFilters = ['bank', 'status']; + $actionButtons = ['view' => ICONS['SEARCH']]; + $batchjobButtons = []; switch ($action) { case 'create': case 'create_form': @@ -58,8 +60,9 @@ class AccountForm extends WalletForm $this->setFormFilters($filters); $this->setFormOptions($action, $filters, $formDatas); $this->setIndexFilters($indexFilter); - $this->setActionButtons($actionButtons); $this->setBatchjobFilters($batchjobFilters); + $this->setActionButtons($actionButtons); + $this->setBatchjobButtons($batchjobButtons); } public function getFormRule(string $action, string $field, array $formRules): array diff --git a/app/Forms/Customer/Wallet/CouponForm.php b/app/Forms/Customer/Wallet/CouponForm.php index 60249a3..b7b843b 100644 --- a/app/Forms/Customer/Wallet/CouponForm.php +++ b/app/Forms/Customer/Wallet/CouponForm.php @@ -10,6 +10,7 @@ class CouponForm extends WalletForm } public function action_init_process(string $action, array $formDatas = []): void { + parent::action_init_process($action, $formDatas); $fields = [ "clientinfo_uid", "title", @@ -22,8 +23,9 @@ class CouponForm extends WalletForm "status", ]; $indexFilter = $filters; - $actionButtons = ['view' => ICONS['SEARCH']]; $batchjobFilters = ['status']; + $actionButtons = ['view' => ICONS['SEARCH']]; + $batchjobButtons = []; switch ($action) { case 'create': case 'create_form': @@ -49,7 +51,8 @@ class CouponForm extends WalletForm $this->setFormFilters($filters); $this->setFormOptions($action, $filters, $formDatas); $this->setIndexFilters($indexFilter); - $this->setActionButtons($actionButtons); $this->setBatchjobFilters($batchjobFilters); + $this->setActionButtons($actionButtons); + $this->setBatchjobButtons($batchjobButtons); } } diff --git a/app/Forms/Customer/Wallet/PointForm.php b/app/Forms/Customer/Wallet/PointForm.php index 745cfa0..b114de9 100644 --- a/app/Forms/Customer/Wallet/PointForm.php +++ b/app/Forms/Customer/Wallet/PointForm.php @@ -10,6 +10,7 @@ class PointForm extends WalletForm } public function action_init_process(string $action, array $formDatas = []): void { + parent::action_init_process($action, $formDatas); $fields = [ "clientinfo_uid", "title", @@ -22,8 +23,9 @@ class PointForm extends WalletForm "status", ]; $indexFilter = $filters; - $actionButtons = ['view' => ICONS['SEARCH']]; $batchjobFilters = ['status']; + $actionButtons = ['view' => ICONS['SEARCH']]; + $batchjobButtons = []; switch ($action) { case 'create': case 'create_form': @@ -49,7 +51,8 @@ class PointForm extends WalletForm $this->setFormFilters($filters); $this->setFormOptions($action, $filters, $formDatas); $this->setIndexFilters($indexFilter); - $this->setActionButtons($actionButtons); $this->setBatchjobFilters($batchjobFilters); + $this->setActionButtons($actionButtons); + $this->setBatchjobButtons($batchjobButtons); } } diff --git a/app/Forms/Equipment/CHASSISForm.php b/app/Forms/Equipment/CHASSISForm.php index 2070ceb..f78c4c5 100644 --- a/app/Forms/Equipment/CHASSISForm.php +++ b/app/Forms/Equipment/CHASSISForm.php @@ -20,6 +20,8 @@ class CHASSISForm extends EquipmentForm ]; $indexFilter = $filters; $batchjobFilters = ['status']; + $actionButtons = ['view' => ICONS['SEARCH']]; + $batchjobButtons = ['batchjob' => '일괄처리']; switch ($action) { case 'create': case 'create_form': @@ -41,6 +43,8 @@ class CHASSISForm extends EquipmentForm $this->setFormOptions($action, $filters, $formDatas); $this->setIndexFilters($indexFilter); $this->setBatchjobFilters($batchjobFilters); + $this->setActionButtons($actionButtons); + $this->setBatchjobButtons($batchjobButtons); } public function getFormRule(string $action, string $field, array $formRules): array { diff --git a/app/Forms/Equipment/LineForm.php b/app/Forms/Equipment/LineForm.php index 37ccb62..805d874 100644 --- a/app/Forms/Equipment/LineForm.php +++ b/app/Forms/Equipment/LineForm.php @@ -23,6 +23,8 @@ class LineForm extends EquipmentForm ]; $indexFilter = $filters; $batchjobFilters = ['status']; + $actionButtons = ['view' => ICONS['SEARCH']]; + $batchjobButtons = []; switch ($action) { case 'create': case 'create_form': @@ -44,15 +46,18 @@ class LineForm extends EquipmentForm $this->setFormOptions($action, $filters, $formDatas); $this->setIndexFilters($indexFilter); $this->setBatchjobFilters($batchjobFilters); + $this->setActionButtons($actionButtons); + $this->setBatchjobButtons($batchjobButtons); } public function getFormRule(string $action, string $field, array $formRules): array { switch ($field) { case "bandwith": case "type": + case "status": + case "start_at": $formRules[$field] = "required|trim|string"; break; - case "start_at": case "end_at": $formRules[$field] = "permit_empty|valid_date"; break; diff --git a/app/Forms/Part/IPForm.php b/app/Forms/Part/IPForm.php index 96cf1c7..530e76e 100644 --- a/app/Forms/Part/IPForm.php +++ b/app/Forms/Part/IPForm.php @@ -24,6 +24,8 @@ class IPForm extends PartForm ]; $indexFilter = $filters; $batchjobFilters = ['status']; + $actionButtons = ['view' => ICONS['SEARCH']]; + $batchjobButtons = ['batchjob' => '일괄처리']; switch ($action) { case 'create': case 'create_form': @@ -59,6 +61,8 @@ class IPForm extends PartForm $this->setFormOptions($action, $filters, $formDatas); $this->setIndexFilters($indexFilter); $this->setBatchjobFilters($batchjobFilters); + $this->setActionButtons($actionButtons); + $this->setBatchjobButtons($batchjobButtons); } public function getFormRule(string $action, string $field, array $formRules): array { diff --git a/app/Forms/Part/SWITCHForm.php b/app/Forms/Part/SWITCHForm.php index d438c32..3e6cdec 100644 --- a/app/Forms/Part/SWITCHForm.php +++ b/app/Forms/Part/SWITCHForm.php @@ -22,6 +22,8 @@ class SWITCHForm extends PartForm ]; $indexFilter = $filters; $batchjobFilters = ['status',]; + $actionButtons = ['view' => ICONS['SEARCH']]; + $batchjobButtons = ['batchjob' => '일괄처리']; switch ($action) { case 'create': case 'create_form': @@ -60,6 +62,8 @@ class SWITCHForm extends PartForm $this->setFormOptions($action, $filters, $formDatas); $this->setIndexFilters($indexFilter); $this->setBatchjobFilters($batchjobFilters); + $this->setActionButtons($actionButtons); + $this->setBatchjobButtons($batchjobButtons); } public function getFormRule(string $action, string $field, array $formRules): array { diff --git a/app/Forms/PaymentForm.php b/app/Forms/PaymentForm.php index 9e8f284..709e565 100644 --- a/app/Forms/PaymentForm.php +++ b/app/Forms/PaymentForm.php @@ -25,7 +25,7 @@ class PaymentForm extends CommonForm $filters = ['user_uid', 'clientinfo_uid', 'serviceinfo_uid', 'status', 'billing', 'pay']; $indexFilter = ['clientinfo_uid', 'serviceinfo_uid', 'status', 'billing', 'pay']; $batchjobFilters = ['status']; - $actionButtons = ['paid' => '결제', 'view' => ICONS['SEARCH'], 'delete' => ICONS['DELETE']]; + $actionButtons = ['paid' => '결제', 'view' => ICONS['SEARCH']]; $batchjobButtons = ['batchjob' => '일괄결제', 'invoice' => '청구서발행']; switch ($action) { case 'create': @@ -73,8 +73,8 @@ class PaymentForm extends CommonForm $this->setFormFilters($filters); $this->setFormOptions($action, $filters, $formDatas); $this->setIndexFilters($indexFilter); - $this->setActionButtons($actionButtons); $this->setBatchjobFilters($batchjobFilters); + $this->setActionButtons($actionButtons); $this->setBatchjobButtons($batchjobButtons); } public function getFormRule(string $action, string $field, array $formRules): array diff --git a/app/Helpers/Equipment/CHASSISHelper.php b/app/Helpers/Equipment/CHASSISHelper.php index 16aaabe..5dfa66a 100644 --- a/app/Helpers/Equipment/CHASSISHelper.php +++ b/app/Helpers/Equipment/CHASSISHelper.php @@ -25,25 +25,4 @@ class CHASSISHelper extends EquipmentHelper } 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; - } } diff --git a/app/Helpers/Part/DISKHelper.php b/app/Helpers/Part/DISKHelper.php index 82d3206..d41a0b7 100644 --- a/app/Helpers/Part/DISKHelper.php +++ b/app/Helpers/Part/DISKHelper.php @@ -8,25 +8,4 @@ class DISKHelper extends PartHelper { 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; - } } diff --git a/app/Helpers/Part/RAMHelper.php b/app/Helpers/Part/RAMHelper.php index 19cbdaa..8bac320 100644 --- a/app/Helpers/Part/RAMHelper.php +++ b/app/Helpers/Part/RAMHelper.php @@ -8,25 +8,4 @@ class RAMHelper extends PartHelper { 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; - } } diff --git a/app/Services/CommonService.php b/app/Services/CommonService.php index caaa4a8..0c47dc6 100644 --- a/app/Services/CommonService.php +++ b/app/Services/CommonService.php @@ -182,7 +182,6 @@ abstract class CommonService $this->getFormService()->validate($formDatas); // 💡 동적으로 가져온 Entity 클래스 이름으로 instanceof 검사 $entityClass = $this->getEntityClass(); - dd($formDatas); $entity = new $entityClass($formDatas); if (!$entity instanceof $entityClass) { throw new RuntimeException("Return Type은 {$entityClass}만 가능"); diff --git a/app/Views/cells/server/detail.php b/app/Views/cells/server/detail.php index 3b373f8..ad12420 100644 --- a/app/Views/cells/server/detail.php +++ b/app/Views/cells/server/detail.php @@ -14,6 +14,7 @@ getListButton('IP', '추가IP', ['serverinfo_uid' => $entity->getPK()]) ?> getListButton('CS', 'CS', ['serverinfo_uid' => $entity->getPK()]) ?> + getListButton('SOFTWARE', 'SOFTWARE', ['serverinfo_uid' => $entity->getPK()]) ?> diff --git a/app/Views/cells/serverpart/detail.php b/app/Views/cells/serverpart/detail.php index d0ad6a0..9693d55 100644 --- a/app/Views/cells/serverpart/detail.php +++ b/app/Views/cells/serverpart/detail.php @@ -7,7 +7,6 @@ -   @@ -24,5 +23,12 @@
getFieldView('CS', $entity->getPK(), $serverPartCellDatas) ?>
-   + + + + + +
getFieldView('SOFTWARE', $entity->getPK(), $serverPartCellDatas) ?>
+ + \ No newline at end of file