From d71a88c58439e7b6b9fc1c3f75b6f03ab806259a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Mon, 24 Nov 2025 11:11:53 +0900 Subject: [PATCH] dbmsv4 init...1 --- app/Controllers/AbstractCRUDController.php | 4 +-- app/Controllers/AbstractWebController.php | 2 +- app/Controllers/Admin/AdminController.php | 6 ++-- .../Admin/Customer/ServiceController.php | 11 +++++++ .../Admin/Equipment/ServerController.php | 5 ++++ app/Controllers/CLI/Collector.php | 5 ++-- app/Controllers/CommonController.php | 5 ++-- app/Forms/BoardForm.php | 4 +-- app/Forms/CommonForm.php | 29 +++++++++++++++---- app/Forms/Customer/ServiceForm.php | 6 ++-- app/Forms/Equipment/ServerForm.php | 4 +-- app/Forms/Equipment/ServerPartForm.php | 4 +-- app/Forms/Part/IPForm.php | 4 +-- app/Forms/Part/PartForm.php | 4 +-- app/Forms/PaymentForm.php | 4 +-- app/Helpers/Customer/ServiceHelper.php | 5 ++-- app/Services/Auth/GoogleService.php | 2 +- app/Services/Auth/LocalService.php | 2 +- app/Services/BoardService.php | 4 +-- app/Services/CommonService.php | 2 +- app/Services/Customer/AccountService.php | 4 +-- app/Services/Customer/ClientService.php | 4 +-- app/Services/Customer/CouponService.php | 4 +-- app/Services/Customer/PointService.php | 4 +-- app/Services/Customer/ServiceService.php | 4 +-- app/Services/Equipment/LineService.php | 4 +-- app/Services/Equipment/ServerPartService.php | 4 +-- app/Services/Equipment/ServerService.php | 4 +-- app/Services/MylogService.php | 4 +-- app/Services/Part/CPUService.php | 4 +-- app/Services/Part/CSService.php | 4 +-- app/Services/Part/DISKService.php | 4 +-- app/Services/Part/IPService.php | 4 +-- app/Services/Part/RAMService.php | 4 +-- app/Services/Part/SOFTWAREService.php | 4 +-- app/Services/Part/SWITCHService.php | 4 +-- app/Services/PaymentService.php | 4 +-- app/Services/UserService.php | 4 +-- 38 files changed, 111 insertions(+), 73 deletions(-) diff --git a/app/Controllers/AbstractCRUDController.php b/app/Controllers/AbstractCRUDController.php index 06db23a..2a66733 100644 --- a/app/Controllers/AbstractCRUDController.php +++ b/app/Controllers/AbstractCRUDController.php @@ -95,8 +95,6 @@ abstract class AbstractCRUDController extends AbstractWebController final public function modify_form($uid): string|RedirectResponse { try { - $action = __FUNCTION__; - $this->action_init_process($action); $entity = $this->modify_form_process($uid); // πŸ’‘ λ™μ μœΌλ‘œ κ°€μ Έμ˜¨ Entity 클래슀 μ΄λ¦„μœΌλ‘œ instanceof 검사 $entityClass = $this->getEntityClass(); @@ -104,6 +102,8 @@ abstract class AbstractCRUDController extends AbstractWebController throw new RuntimeException(__METHOD__ . "μ—μ„œ 였λ₯˜λ°œμƒ:Return Type은 {$entityClass}만 κ°€λŠ₯"); } $this->addViewDatas('entity', $entity); + $action = __FUNCTION__; + $this->action_init_process($action, $entity); return $this->modify_form_result_process($action); } catch (\Exception $e) { return $this->action_redirect_process('error', "{$this->getTitle()}μ—μ„œ {$uid} μˆ˜μ •νΌ 였λ₯˜:" . $e->getMessage()); diff --git a/app/Controllers/AbstractWebController.php b/app/Controllers/AbstractWebController.php index 5265175..5eaa6a8 100644 --- a/app/Controllers/AbstractWebController.php +++ b/app/Controllers/AbstractWebController.php @@ -76,7 +76,7 @@ abstract class AbstractWebController extends Controller /** * λͺ¨λ“  μ•‘μ…˜ μ‹€ν–‰ μ „ 곡톡 μ΄ˆκΈ°ν™” μž‘μ—… */ - protected function action_init_process(string $action): void + protected function action_init_process(string $action, ?object $entity = null): void { $this->addViewDatas('action', $action); $this->addViewDatas('authContext', $this->getAuthContext()); diff --git a/app/Controllers/Admin/AdminController.php b/app/Controllers/Admin/AdminController.php index 7f85482..1ee4e76 100644 --- a/app/Controllers/Admin/AdminController.php +++ b/app/Controllers/Admin/AdminController.php @@ -18,10 +18,10 @@ abstract class AdminController extends CommonController { return 'admin'; } - protected function action_init_process(string $action): void + protected function action_init_process(string $action, ?object $entity = null): void { - $this->service->action_init_process($action); - parent::action_init_process($action); + $this->service->action_init_process($action, $entity); + parent::action_init_process($action, $entity); $this->addViewDatas('layout', $this->getLayout()); $this->addViewDatas('title', $this->getTitle()); $this->addViewDatas('helper', $this->service->getHelper()); diff --git a/app/Controllers/Admin/Customer/ServiceController.php b/app/Controllers/Admin/Customer/ServiceController.php index 900d277..ad73ec9 100644 --- a/app/Controllers/Admin/Customer/ServiceController.php +++ b/app/Controllers/Admin/Customer/ServiceController.php @@ -23,4 +23,15 @@ class ServiceController extends CustomerController } //κΈ°λ³Έ ν•¨μˆ˜ μž‘μ—… //Custom μΆ”κ°€ ν•¨μˆ˜ + public function create_form_process(array $formDatas = []): array + { + $formDatas['location'] = 'chiba'; + $formDatas['rack'] = '100000'; + $formDatas['line'] = '300000'; + $formDatas['type'] = 'normal'; + $formDatas['billing_at'] = date("Y-m-d"); + $formDatas['start_at'] = date("Y-m-d"); + $formDatas['status'] = STATUS['AVAILABLE']; + return $formDatas; + } } diff --git a/app/Controllers/Admin/Equipment/ServerController.php b/app/Controllers/Admin/Equipment/ServerController.php index b441dfc..0fbb068 100644 --- a/app/Controllers/Admin/Equipment/ServerController.php +++ b/app/Controllers/Admin/Equipment/ServerController.php @@ -23,4 +23,9 @@ class ServerController extends EquipmentController } //κΈ°λ³Έ ν•¨μˆ˜ μž‘μ—… //Custom μΆ”κ°€ ν•¨μˆ˜ + public function create_form_process(array $formDatas = []): array + { + $formDatas['code'] = sprintf("%d%dXX-M%d", date("y"), ceil((int)date("m") / 3), $this->service->getNextPK()); + return $formDatas; + } } diff --git a/app/Controllers/CLI/Collector.php b/app/Controllers/CLI/Collector.php index 35340ab..5120fde 100644 --- a/app/Controllers/CLI/Collector.php +++ b/app/Controllers/CLI/Collector.php @@ -16,13 +16,14 @@ class Collector extends BaseController { parent::initController($request, $response, $logger); if ($this->service === null) { + $action = 'create'; $this->service = service('collectorservice'); $fields = ['trafficinfo_uid', 'in', 'out', 'raw_in', 'raw_out']; $filters = ['trafficinfo_uid']; $this->service->getFormService()->setFormFields($fields); - $this->service->getFormService()->setFormRules('create', $fields); + $this->service->getFormService()->setFormRules($action, $fields); $this->service->getFormService()->setFormFilters($filters); - $this->service->getFormService()->setFormOptions($filters); + $this->service->getFormService()->setFormOptions($action, $filters); $this->service->getFormService()->setBatchjobFilters($filters); } } diff --git a/app/Controllers/CommonController.php b/app/Controllers/CommonController.php index 4856785..f34b403 100644 --- a/app/Controllers/CommonController.php +++ b/app/Controllers/CommonController.php @@ -61,12 +61,13 @@ abstract class CommonController extends AbstractCRUDController final public function batchjob(): string|RedirectResponse { try { + $action = __FUNCTION__; // μ‚¬μ „μž‘μ—… 및 데이터 μΆ”μΆœ μ΄ˆκΈ°ν™” list($uids, $selectedFields, $formDatas) = $this->batchjob_pre_process(); $this->service->getFormService()->setFormFields($selectedFields); - $this->service->getFormService()->setFormRules(__FUNCTION__, $selectedFields); + $this->service->getFormService()->setFormRules($action, $selectedFields); $this->service->getFormService()->setFormFilters($selectedFields); - $this->service->getFormService()->setFormOptions($selectedFields); + $this->service->getFormService()->setFormOptions($action, $selectedFields); $entities = []; $errors = []; foreach ($uids as $uid) { diff --git a/app/Forms/BoardForm.php b/app/Forms/BoardForm.php index cc57d86..f5a10f8 100644 --- a/app/Forms/BoardForm.php +++ b/app/Forms/BoardForm.php @@ -44,7 +44,7 @@ class BoardForm extends CommonForm } return $rule; } - public function getFormOption(string $field, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array + public function getFormOption(string $action, string $field, ?object $entity = null, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array { $tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"]; switch ($field) { @@ -56,7 +56,7 @@ class BoardForm extends CommonForm $options['options'] = $tempOptions; break; default: - $options = parent::getFormOption($field, $options); + $options = parent::getFormOption($action, $field, $entity, $options); break; } return $options; diff --git a/app/Forms/CommonForm.php b/app/Forms/CommonForm.php index 0983187..93ae4f4 100644 --- a/app/Forms/CommonForm.php +++ b/app/Forms/CommonForm.php @@ -57,10 +57,10 @@ abstract class CommonForm } return array_intersect_key($this->_formRules, array_flip($fields)); } - final public function setFormOptions(array $fields, $formOptions = []): void + final public function setFormOptions(string $action, array $fields, ?object $entity = null, $formOptions = []): void { foreach ($fields as $field) { - $formOptions[$field] = $formOptions[$field] ?? $this->getFormOption($field); + $formOptions[$field] = $formOptions[$field] ?? $this->getFormOption($action, $field, $entity); } $this->_formOptions = $formOptions; } @@ -183,19 +183,38 @@ abstract class CommonForm } return $rule; } - public function getFormOption(string $field, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array + protected function getFormOption_process($service, string $action, string $field, ?object $entity = null): array + { + $entities = []; + switch ($action) { + case 'create_form': + $entities = $service->getEntities(['status' => STATUS['AVAILABLE']]); + break; + case 'modify_form': + $where = sprintf("status = '%s' OR uid=%s", STATUS['AVAILABLE'], $entity->$field); + echo $where; + $entities = $service->getEntities([$where => null]); + break; + default: + $entities = $service->getEntities(); + break; + } + return $entities; + } + + public function getFormOption(string $action, string $field, ?object $entity = null, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array { $tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"]; switch ($field) { case 'user_uid': - foreach (service('userservice')->getEntities(['status' => STATUS['AVAILABLE']]) as $entity) { + foreach ($this->getFormOption_process(service('userservice'), $action, $field, $entity) as $entity) { $tempOptions[$entity->getPK()] = $entity->getTitle(); // $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())]; } $options['options'] = $tempOptions; break; case 'clientinfo_uid': - foreach (service('customer_clientservice')->getEntities(['status' => STATUS['AVAILABLE']]) as $entity) { + foreach ($this->getFormOption_process(service('customer_clientservice'), $action, $field, $entity) as $entity) { $tempOptions[$entity->getPK()] = $entity->getTitle(); // $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())]; } diff --git a/app/Forms/Customer/ServiceForm.php b/app/Forms/Customer/ServiceForm.php index a22cdb4..623c26a 100644 --- a/app/Forms/Customer/ServiceForm.php +++ b/app/Forms/Customer/ServiceForm.php @@ -46,19 +46,19 @@ class ServiceForm extends CustomerForm return $rule; } - public function getFormOption(string $field, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array + public function getFormOption(string $action, string $field, ?object $entity = null, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array { $tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"]; switch ($field) { case 'serverinfo_uid': - foreach (service('equipment_serverservice')->getEntities() as $entity) { + foreach ($this->getFormOption_process(service('equipment_serverservice'), $action, $field, $entity) as $entity) { $tempOptions[$entity->getPK()] = $entity->getTitle(); // $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())]; } $options['options'] = $tempOptions; break; default: - $options = parent::getFormOption($field, $options); + $options = parent::getFormOption($action, $field, $entity, $options); break; } return $options; diff --git a/app/Forms/Equipment/ServerForm.php b/app/Forms/Equipment/ServerForm.php index 86e2f09..89e3975 100644 --- a/app/Forms/Equipment/ServerForm.php +++ b/app/Forms/Equipment/ServerForm.php @@ -45,7 +45,7 @@ class ServerForm extends EquipmentForm } return $rule; } - public function getFormOption(string $field, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array + public function getFormOption(string $action, string $field, ?object $entity = null, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array { $tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"]; switch ($field) { @@ -59,7 +59,7 @@ class ServerForm extends EquipmentForm $options['options'] = $tempOptions; break; default: - $options = parent::getFormOption($field, $options); + $options = parent::getFormOption($action, $field, $entity, $options); break; } return $options; diff --git a/app/Forms/Equipment/ServerPartForm.php b/app/Forms/Equipment/ServerPartForm.php index 16df1b3..8b2b4d6 100644 --- a/app/Forms/Equipment/ServerPartForm.php +++ b/app/Forms/Equipment/ServerPartForm.php @@ -42,7 +42,7 @@ class ServerPartForm extends EquipmentForm { return service('part_' . strtolower($type) . 'service'); } - public function getFormOption(string $field, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array + public function getFormOption(string $action, string $field, ?object $entity = null, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array { $tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"]; switch ($field) { @@ -76,7 +76,7 @@ class ServerPartForm extends EquipmentForm $options['options'] = $tempOptions; break; default: - $options = parent::getFormOption($field, $options); + $options = parent::getFormOption($action, $field, $entity, $options); break; } return $options; diff --git a/app/Forms/Part/IPForm.php b/app/Forms/Part/IPForm.php index a1983ab..9a75b3b 100644 --- a/app/Forms/Part/IPForm.php +++ b/app/Forms/Part/IPForm.php @@ -27,7 +27,7 @@ class IPForm extends PartForm } return $rule; } - public function getFormOption(string $field, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array + public function getFormOption(string $action, string $field, ?object $entity = null, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array { $tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"]; switch ($field) { @@ -47,7 +47,7 @@ class IPForm extends PartForm $options['options'] = $tempOptions; break; default: - $options = parent::getFormOption($field, $options); + $options = parent::getFormOption($action, $field, $entity, $options); break; } return $options; diff --git a/app/Forms/Part/PartForm.php b/app/Forms/Part/PartForm.php index dbc584e..35410ee 100644 --- a/app/Forms/Part/PartForm.php +++ b/app/Forms/Part/PartForm.php @@ -35,7 +35,7 @@ abstract class PartForm extends CommonForm } return $rule; } - public function getFormOption(string $field, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array + public function getFormOption(string $action, string $field, ?object $entity = null, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array { $tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"]; switch ($field) { @@ -54,7 +54,7 @@ abstract class PartForm extends CommonForm $options['options'] = $tempOptions; break; default: - $options = parent::getFormOption($field, $options); + $options = parent::getFormOption($action, $field, $entity, $options); break; } return $options; diff --git a/app/Forms/PaymentForm.php b/app/Forms/PaymentForm.php index d746c82..fcc9880 100644 --- a/app/Forms/PaymentForm.php +++ b/app/Forms/PaymentForm.php @@ -41,7 +41,7 @@ class PaymentForm extends CommonForm return $rule; } - public function getFormOption(string $field, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array + public function getFormOption(string $action, string $field, ?object $entity = null, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array { $tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"]; switch ($field) { @@ -53,7 +53,7 @@ class PaymentForm extends CommonForm $options['options'] = $tempOptions; break; default: - $options = parent::getFormOption($field, $options); + $options = parent::getFormOption($action, $field, $entity, $options); break; } return $options; diff --git a/app/Helpers/Customer/ServiceHelper.php b/app/Helpers/Customer/ServiceHelper.php index 690dbfb..06894e0 100644 --- a/app/Helpers/Customer/ServiceHelper.php +++ b/app/Helpers/Customer/ServiceHelper.php @@ -12,12 +12,13 @@ class ServiceHelper extends CustomerHelper { switch ($field) { case 'site': + $extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field'; $extras['onChange'] = "$('select[name=\'clientinfo_uid\']').select2('open')"; - $form = form_dropdown($field, $value, $viewDatas, $extras); + $form = form_dropdown($field, $viewDatas['formOptions'][$field]['options'], $value, $extras); break; case 'serverinfo_uid': $extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field'; - $form = form_dropdown($field, $value, $viewDatas, $extras); + $form = form_dropdown($field, $viewDatas['formOptions'][$field]['options'], $value, $extras); break; case 'amount': $form = form_input($field, 0, ["readonly" => "readonly", ...$extras]); diff --git a/app/Services/Auth/GoogleService.php b/app/Services/Auth/GoogleService.php index 788fb8c..7273a16 100644 --- a/app/Services/Auth/GoogleService.php +++ b/app/Services/Auth/GoogleService.php @@ -45,7 +45,7 @@ class GoogleService extends AuthService $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters); $this->getFormService()->setBatchjobFilters($filters); } protected function getEntity_process(mixed $entity): UserEntity diff --git a/app/Services/Auth/LocalService.php b/app/Services/Auth/LocalService.php index e99a84e..10c61cf 100644 --- a/app/Services/Auth/LocalService.php +++ b/app/Services/Auth/LocalService.php @@ -45,7 +45,7 @@ class LocalService extends AuthService $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters); $this->getFormService()->setBatchjobFilters($filters); } protected function getEntity_process(mixed $entity): UserEntity diff --git a/app/Services/BoardService.php b/app/Services/BoardService.php index 0da7954..5b412ba 100644 --- a/app/Services/BoardService.php +++ b/app/Services/BoardService.php @@ -53,7 +53,7 @@ class BoardService extends CommonService } return $this->_helper; } - public function action_init_process(string $action): void + public function action_init_process(string $action, ?object $entity = null): void { $fields = [ 'category', @@ -111,7 +111,7 @@ class BoardService extends CommonService $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters, $entity); $this->getFormService()->setIndexFilters($indexFilter); $this->getFormService()->setBatchjobFilters($batchjobFilters); } diff --git a/app/Services/CommonService.php b/app/Services/CommonService.php index 60137e1..90957a9 100644 --- a/app/Services/CommonService.php +++ b/app/Services/CommonService.php @@ -30,7 +30,7 @@ abstract class CommonService { return $isArray ? $this->_classPaths : implode($delimeter, $this->_classPaths); } - abstract public function action_init_process(string $action); + abstract public function action_init_process(string $action, ?object $entity = null): void; /** * 단일 μ—”ν‹°ν‹°λ₯Ό μ‘°νšŒν•©λ‹ˆλ‹€. * @return CommonEntity|null CommonEntity μΈμŠ€ν„΄μŠ€ λ˜λŠ” μ°Ύμ§€ λͺ»ν–ˆμ„ 경우 null diff --git a/app/Services/Customer/AccountService.php b/app/Services/Customer/AccountService.php index 1bae1af..ca9f1a2 100644 --- a/app/Services/Customer/AccountService.php +++ b/app/Services/Customer/AccountService.php @@ -54,7 +54,7 @@ class AccountService extends CustomerService } return $this->_helper; } - public function action_init_process(string $action): void + public function action_init_process(string $action, ?object $entity = null): void { $fields = [ "clientinfo_uid", @@ -92,7 +92,7 @@ class AccountService extends CustomerService $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters); $this->getFormService()->setIndexFilters($indexFilter); $this->getFormService()->setBatchjobFilters($batchjobFilters); } diff --git a/app/Services/Customer/ClientService.php b/app/Services/Customer/ClientService.php index 558292b..f8b7530 100644 --- a/app/Services/Customer/ClientService.php +++ b/app/Services/Customer/ClientService.php @@ -54,7 +54,7 @@ class ClientService extends CustomerService } return $this->_helper; } - public function action_init_process(string $action): void + public function action_init_process(string $action, ?object $entity = null): void { $fields = [ 'site', @@ -101,7 +101,7 @@ class ClientService extends CustomerService $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters, $entity); $this->getFormService()->setIndexFilters($indexFilter); $this->getFormService()->setBatchjobFilters($batchjobFilters); } diff --git a/app/Services/Customer/CouponService.php b/app/Services/Customer/CouponService.php index 14b6f84..42c578a 100644 --- a/app/Services/Customer/CouponService.php +++ b/app/Services/Customer/CouponService.php @@ -54,7 +54,7 @@ class CouponService extends CustomerService } return $this->_helper; } - public function action_init_process(string $action): void + public function action_init_process(string $action, ?object $entity = null): void { $fields = [ "clientinfo_uid", @@ -86,7 +86,7 @@ class CouponService extends CustomerService $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters, $entity); $this->getFormService()->setIndexFilters($indexFilter); $this->getFormService()->setBatchjobFilters($batchjobFilters); } diff --git a/app/Services/Customer/PointService.php b/app/Services/Customer/PointService.php index b0631ce..90e5133 100644 --- a/app/Services/Customer/PointService.php +++ b/app/Services/Customer/PointService.php @@ -54,7 +54,7 @@ class PointService extends CustomerService } return $this->_helper; } - public function action_init_process(string $action): void + public function action_init_process(string $action, ?object $entity = null): void { $fields = [ "clientinfo_uid", @@ -86,7 +86,7 @@ class PointService extends CustomerService $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters, $entity); $this->getFormService()->setIndexFilters($indexFilter); $this->getFormService()->setBatchjobFilters($batchjobFilters); } diff --git a/app/Services/Customer/ServiceService.php b/app/Services/Customer/ServiceService.php index 2bded9f..5f259d7 100644 --- a/app/Services/Customer/ServiceService.php +++ b/app/Services/Customer/ServiceService.php @@ -56,7 +56,7 @@ class ServiceService extends CustomerService } return $this->_helper; } - public function action_init_process(string $action): void + public function action_init_process(string $action, ?object $entity = null): void { $fields = [ "site", @@ -116,7 +116,7 @@ class ServiceService extends CustomerService $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters, $entity); $this->getFormService()->setIndexFilters($indexFilter); $this->getFormService()->setBatchjobFilters($batchjobFilters); } diff --git a/app/Services/Equipment/LineService.php b/app/Services/Equipment/LineService.php index 5e78fbd..cfec547 100644 --- a/app/Services/Equipment/LineService.php +++ b/app/Services/Equipment/LineService.php @@ -54,7 +54,7 @@ class LineService extends EquipmentService } return $this->_helper; } - public function action_init_process(string $action): void + public function action_init_process(string $action, ?object $entity = null): void { $fields = [ "type", @@ -87,7 +87,7 @@ class LineService extends EquipmentService $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters, $entity); $this->getFormService()->setIndexFilters($indexFilter); $this->getFormService()->setBatchjobFilters($batchjobFilters); } diff --git a/app/Services/Equipment/ServerPartService.php b/app/Services/Equipment/ServerPartService.php index 21c8d03..f6a7548 100644 --- a/app/Services/Equipment/ServerPartService.php +++ b/app/Services/Equipment/ServerPartService.php @@ -56,7 +56,7 @@ class ServerPartService extends EquipmentService } return $this->_helper; } - public function action_init_process(string $action): void + public function action_init_process(string $action, ?object $entity = null): void { $fields = [ "serverinfo_uid", @@ -96,7 +96,7 @@ class ServerPartService extends EquipmentService $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters, $entity); $this->getFormService()->setIndexFilters($indexFilter); $this->getFormService()->setBatchjobFilters($batchjobFilters); } diff --git a/app/Services/Equipment/ServerService.php b/app/Services/Equipment/ServerService.php index e2df2ba..a965b2f 100644 --- a/app/Services/Equipment/ServerService.php +++ b/app/Services/Equipment/ServerService.php @@ -54,7 +54,7 @@ class ServerService extends EquipmentService } return $this->_helper; } - public function action_init_process(string $action): void + public function action_init_process(string $action, ?object $entity = null): void { $fields = [ "code", @@ -94,7 +94,7 @@ class ServerService extends EquipmentService $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters, $entity); $this->getFormService()->setIndexFilters($indexFilter); $this->getFormService()->setBatchjobFilters($batchjobFilters); } diff --git a/app/Services/MylogService.php b/app/Services/MylogService.php index 205829d..22ba425 100644 --- a/app/Services/MylogService.php +++ b/app/Services/MylogService.php @@ -42,7 +42,7 @@ class MylogService extends CommonService implements PipelineStepInterface } return $this->_form; } - public function action_init_process(string $action): void + public function action_init_process(string $action, ?object $entity = null): void { $fields = ['title', 'content']; $filters = []; @@ -65,7 +65,7 @@ class MylogService extends CommonService implements PipelineStepInterface $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters, $entity); $this->getFormService()->setIndexFilters($indexFilter); $this->getFormService()->setBatchjobFilters($batchjobFilters); } diff --git a/app/Services/Part/CPUService.php b/app/Services/Part/CPUService.php index 1b0d415..e6181cd 100644 --- a/app/Services/Part/CPUService.php +++ b/app/Services/Part/CPUService.php @@ -54,7 +54,7 @@ class CPUService extends PartService } return $this->_helper; } - public function action_init_process(string $action): void + public function action_init_process(string $action, ?object $entity = null): void { $fields = [ "title", @@ -84,7 +84,7 @@ class CPUService extends PartService $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters, $entity); $this->getFormService()->setIndexFilters($indexFilter); $this->getFormService()->setBatchjobFilters($batchjobFilters); } diff --git a/app/Services/Part/CSService.php b/app/Services/Part/CSService.php index f2b5564..d6b76a1 100644 --- a/app/Services/Part/CSService.php +++ b/app/Services/Part/CSService.php @@ -54,7 +54,7 @@ class CSService extends PartService } return $this->_helper; } - public function action_init_process(string $action): void + public function action_init_process(string $action, ?object $entity = null): void { $fields = [ "type", @@ -111,7 +111,7 @@ class CSService extends PartService $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters, $entity); $this->getFormService()->setIndexFilters($indexFilter); $this->getFormService()->setBatchjobFilters($batchjobFilters); } diff --git a/app/Services/Part/DISKService.php b/app/Services/Part/DISKService.php index 634637e..628be91 100644 --- a/app/Services/Part/DISKService.php +++ b/app/Services/Part/DISKService.php @@ -54,7 +54,7 @@ class DISKService extends PartService } return $this->_helper; } - public function action_init_process(string $action): void + public function action_init_process(string $action, ?object $entity = null): void { $fields = [ "title", @@ -85,7 +85,7 @@ class DISKService extends PartService $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters, $entity); $this->getFormService()->setIndexFilters($indexFilter); $this->getFormService()->setBatchjobFilters($batchjobFilters); } diff --git a/app/Services/Part/IPService.php b/app/Services/Part/IPService.php index cd765f1..9a21c68 100644 --- a/app/Services/Part/IPService.php +++ b/app/Services/Part/IPService.php @@ -54,7 +54,7 @@ class IPService extends PartService } return $this->_helper; } - public function action_init_process(string $action): void + public function action_init_process(string $action, ?object $entity = null): void { $fields = [ "lineinfo_uid", @@ -102,7 +102,7 @@ class IPService extends PartService $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters, $entity); $this->getFormService()->setIndexFilters($indexFilter); $this->getFormService()->setBatchjobFilters($batchjobFilters); } diff --git a/app/Services/Part/RAMService.php b/app/Services/Part/RAMService.php index cd2c921..3a44a20 100644 --- a/app/Services/Part/RAMService.php +++ b/app/Services/Part/RAMService.php @@ -54,7 +54,7 @@ class RAMService extends PartService } return $this->_helper; } - public function action_init_process(string $action): void + public function action_init_process(string $action, ?object $entity = null): void { $fields = [ "title", @@ -84,7 +84,7 @@ class RAMService extends PartService $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters, $entity); $this->getFormService()->setIndexFilters($indexFilter); $this->getFormService()->setBatchjobFilters($batchjobFilters); } diff --git a/app/Services/Part/SOFTWAREService.php b/app/Services/Part/SOFTWAREService.php index 6777e6d..56b45f2 100644 --- a/app/Services/Part/SOFTWAREService.php +++ b/app/Services/Part/SOFTWAREService.php @@ -40,7 +40,7 @@ class SOFTWAREService extends PartService } return $this->_form; } - public function action_init_process(string $action): void + public function action_init_process(string $action, ?object $entity = null): void { $fields = [ "title", @@ -70,7 +70,7 @@ class SOFTWAREService extends PartService $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters, $entity); $this->getFormService()->setIndexFilters($indexFilter); $this->getFormService()->setBatchjobFilters($batchjobFilters); } diff --git a/app/Services/Part/SWITCHService.php b/app/Services/Part/SWITCHService.php index fe9c9dc..3117ecc 100644 --- a/app/Services/Part/SWITCHService.php +++ b/app/Services/Part/SWITCHService.php @@ -54,7 +54,7 @@ class SWITCHService extends PartService } return $this->_helper; } - public function action_init_process(string $action): void + public function action_init_process(string $action, ?object $entity = null): void { $fields = [ "code", @@ -103,7 +103,7 @@ class SWITCHService extends PartService $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters, $entity); $this->getFormService()->setIndexFilters($indexFilter); $this->getFormService()->setBatchjobFilters($batchjobFilters); } diff --git a/app/Services/PaymentService.php b/app/Services/PaymentService.php index 17caabe..3cda465 100644 --- a/app/Services/PaymentService.php +++ b/app/Services/PaymentService.php @@ -54,7 +54,7 @@ class PaymentService extends CommonService } return $this->_helper; } - public function action_init_process(string $action): void + public function action_init_process(string $action, ?object $entity = null): void { $fields = [ "serviceinfo_uid", @@ -122,7 +122,7 @@ class PaymentService extends CommonService $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters, $entity); $this->getFormService()->setIndexFilters($indexFilter); $this->getFormService()->setBatchjobFilters($batchjobFilters); } diff --git a/app/Services/UserService.php b/app/Services/UserService.php index 4071ca5..78ec9f0 100644 --- a/app/Services/UserService.php +++ b/app/Services/UserService.php @@ -54,7 +54,7 @@ class UserService extends CommonService } return $this->_helper; } - public function action_init_process(string $action): void + public function action_init_process(string $action, ?object $entity = null): void { $fields = [ 'id', @@ -87,7 +87,7 @@ class UserService extends CommonService $this->getFormService()->setFormFields($fields); $this->getFormService()->setFormRules($action, $fields); $this->getFormService()->setFormFilters($filters); - $this->getFormService()->setFormOptions($filters); + $this->getFormService()->setFormOptions($action, $filters, $entity); $this->getFormService()->setIndexFilters($indexFilter); $this->getFormService()->setBatchjobFilters($batchjobFilters); }