diff --git a/app/Config/Routes.php b/app/Config/Routes.php index ae6022f..c0e3e15 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -37,8 +37,8 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au $routes->post('batchjob', 'UserController::batchjob', ['filter' => 'authFilter:master']); $routes->post('batchjob_delete', 'UserController::batchjob_delete', ['filter' => 'authFilter:master']); $routes->get('download/(:alpha)', 'UserController::download/$1', ['filter' => 'authFilter:master']); - $routes->get('individual_modify/(:num)', 'UserController::individual_modify_form/$1', ['filter' => 'authFilter:manager']); - $routes->post('individual_modify/(:num)', 'UserController::individual_modify/$1', ['filter' => 'authFilter:manager']); + $routes->get('profile_modify/(:num)', 'UserController::profile_modify_form/$1', ['filter' => 'authFilter:manager']); + $routes->post('profile_modify/(:num)', 'UserController::profile_modify/$1', ['filter' => 'authFilter:manager']); }); $routes->group('mylog', ['namespace' => 'App\Controllers\Admin'], function ($routes) { $routes->get('/', 'MyLogController::index'); diff --git a/app/Controllers/Admin/Customer/ServiceItemController.php b/app/Controllers/Admin/Customer/ServiceItemController.php index 4651929..e5aadba 100644 --- a/app/Controllers/Admin/Customer/ServiceItemController.php +++ b/app/Controllers/Admin/Customer/ServiceItemController.php @@ -60,8 +60,6 @@ class ServiceItemController extends CustomerController protected function getResultSuccess(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string { switch ($this->getAction()) { - case 'create_form': - case 'modify_form': case 'index': $result = parent::getResultSuccess($message, $this->request->getVar('ActionTemplate') ?? $actionTemplate ?? 'popup'); break; diff --git a/app/Controllers/Admin/UserController.php b/app/Controllers/Admin/UserController.php index 0f5d817..6f7cf79 100644 --- a/app/Controllers/Admin/UserController.php +++ b/app/Controllers/Admin/UserController.php @@ -43,18 +43,18 @@ class UserController extends AdminController protected function getResultSuccess(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string { switch ($this->getAction()) { - case 'individual_modify': + case 'profile_modify': $this->getMyLogService()->save($this->getService()->getClassName(), __FUNCTION__, $message); $result = $this->view($this->entity->getPK()); break; - case 'individual_modify_form': + case 'profile_modify_form': $this->control = $this->getControlDatas(); $this->getHelper()->setViewDatas($this->getViewDatas()); $actionTemplate = $this->request->getVar('ActionTemplate') ?? $actionTemplate; if ($actionTemplate) { - $view_file = $this->view_path . $actionTemplate . DIRECTORY_SEPARATOR . $this->getAction(); + $view_file = $this->view_path . $actionTemplate . DIRECTORY_SEPARATOR . 'modify_form'; } else { - $view_file = $this->view_path . $this->getAction(); + $view_file = $this->view_path . 'modify_form'; } $result = view($view_file, ['viewDatas' => $this->getViewDatas()]); break; @@ -78,11 +78,11 @@ class UserController extends AdminController return $validation; } //Index,FieldForm관련. - protected function individual_modify_form_process(mixed $entity): mixed + protected function profile_modify_form_process(mixed $entity): mixed { return $entity; } - final public function individual_modify_form(mixed $uid): RedirectResponse|string + final public function profile_modify_form(mixed $uid): RedirectResponse|string { try { //각 Field 초기화 @@ -108,20 +108,20 @@ class UserController extends AdminController if (!$entity) { throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다."); } - $this->entity = $this->individual_modify_form_process($entity); + $this->entity = $this->profile_modify_form_process($entity); $this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []]; return $this->getResultSuccess(); } catch (\Exception $e) { return $this->getResultFail($e->getMessage()); } } - protected function individual_modify_process(mixed $entity, array $formDatas): mixed + protected function profile_modify_process(mixed $entity, array $formDatas): mixed { //데이터 검증 $formDatas = $this->doValidate($this->getFieldRules(), $formDatas); return $this->getService()->modify($entity, $formDatas); } - final public function individual_modify(int $uid): RedirectResponse|string + final public function profile_modify(int $uid): RedirectResponse|string { //Transaction Start $this->getService()->getModel()->transStart(); @@ -145,7 +145,7 @@ class UserController extends AdminController if (!$entity) { throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다."); } - $this->entity = $this->individual_modify_process($entity, $formDatas); + $this->entity = $this->profile_modify_process($entity, $formDatas); $this->getService()->getModel()->transCommit(); return $this->getResultSuccess(); } catch (\Exception $e) { diff --git a/app/Views/admin/create_form.php b/app/Views/admin/create_form.php index d089ec2..c12faa0 100644 --- a/app/Views/admin/create_form.php +++ b/app/Views/admin/create_form.php @@ -2,17 +2,9 @@ section('content') ?> alert($error) ?>
- - - - - - - - - +
include("templates/{$viewDatas['layout']}/form_content_top"); ?>
-
+
@@ -27,6 +19,6 @@
"btn btn-outline btn-primary")); ?>
+
include("templates/{$viewDatas['layout']}/form_content_bottom"); ?>
-
include("templates/common/modal_create_iframe"); ?>
endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/individual_modify_form.php b/app/Views/admin/individual_modify_form.php deleted file mode 100644 index ed4550c..0000000 --- a/app/Views/admin/individual_modify_form.php +++ /dev/null @@ -1,31 +0,0 @@ -extend(LAYOUTS[$viewDatas['layout']]['path']) ?> -section('content') ?> -alert($error) ?> -
- - - - - - - - - - 'action_form', ...$viewDatas['forms']['attributes']], $viewDatas['forms']['hiddens']) ?> -
-
- - - - - - -
getFieldLabel($field, $viewDatas) ?> - getFieldForm($field, old($field) ?? $viewDatas['entity']->$field ?? null, $viewDatas) ?> -
-
-
"btn btn-outline btn-primary"]) ?>
- -
-
-endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/modify_form.php b/app/Views/admin/modify_form.php index ed4550c..b91659f 100644 --- a/app/Views/admin/modify_form.php +++ b/app/Views/admin/modify_form.php @@ -2,15 +2,7 @@ section('content') ?> alert($error) ?>
- - - - - - - - - +
include("templates/{$viewDatas['layout']}/form_content_top"); ?>
'action_form', ...$viewDatas['forms']['attributes']], $viewDatas['forms']['hiddens']) ?>
@@ -27,5 +19,6 @@
"btn btn-outline btn-primary"]) ?>
+
include("templates/{$viewDatas['layout']}/form_content_bottom"); ?>
endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/popup/create_form.php b/app/Views/admin/popup/create_form.php deleted file mode 100644 index d089ec2..0000000 --- a/app/Views/admin/popup/create_form.php +++ /dev/null @@ -1,32 +0,0 @@ -extend(LAYOUTS[$viewDatas['layout']]['path']) ?> -section('content') ?> -alert($error) ?> -
- - - - - - - - - - -
-
- - - - - - -
getFieldLabel($field, $viewDatas) ?> - getFieldForm($field, old($field) ?? ($viewDatas[$field] ?? null), $viewDatas) ?> - -
-
"btn btn-outline btn-primary")); ?>
- -
-
-
include("templates/common/modal_create_iframe"); ?>
-endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/popup/modify_form.php b/app/Views/admin/popup/modify_form.php deleted file mode 100644 index ed4550c..0000000 --- a/app/Views/admin/popup/modify_form.php +++ /dev/null @@ -1,31 +0,0 @@ -extend(LAYOUTS[$viewDatas['layout']]['path']) ?> -section('content') ?> -alert($error) ?> -
- - - - - - - - - - 'action_form', ...$viewDatas['forms']['attributes']], $viewDatas['forms']['hiddens']) ?> -
- - - - - - - -
getFieldLabel($field, $viewDatas) ?> - getFieldForm($field, old($field) ?? $viewDatas['entity']->$field ?? null, $viewDatas) ?> -
-
-
"btn btn-outline btn-primary"]) ?>
- -
-
-endSection() ?> \ No newline at end of file diff --git a/app/Views/layouts/admin/top.php b/app/Views/layouts/admin/top.php index f950681..24b2279 100644 --- a/app/Views/layouts/admin/top.php +++ b/app/Views/layouts/admin/top.php @@ -29,7 +29,7 @@ "modify", [ "class" => "dropdown-item", - "data-src" => "/admin/user/individual_modify/" . $viewDatas['myAuthUID'], + "data-src" => "/admin/user/profile_modify/" . $viewDatas['myAuthUID'], "data-bs-toggle" => "modal", "data-bs-target" => "#index_action_form" ] diff --git a/app/Views/templates/admin/form_content_bottom.php b/app/Views/templates/admin/form_content_bottom.php new file mode 100644 index 0000000..0d89182 --- /dev/null +++ b/app/Views/templates/admin/form_content_bottom.php @@ -0,0 +1 @@ +include("templates/common/modal_iframe"); ?> \ No newline at end of file diff --git a/app/Views/templates/admin/form_content_top.php b/app/Views/templates/admin/form_content_top.php new file mode 100644 index 0000000..c99bff5 --- /dev/null +++ b/app/Views/templates/admin/form_content_top.php @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/Views/templates/common/modal_create_iframe.php b/app/Views/templates/common/modal_create_iframe.php deleted file mode 100644 index f3784c0..0000000 --- a/app/Views/templates/common/modal_create_iframe.php +++ /dev/null @@ -1,79 +0,0 @@ - - - - - \ No newline at end of file