diff --git a/app/Controllers/Admin/Customer/ServiceController.php b/app/Controllers/Admin/Customer/ServiceController.php index 5ac347e..8038085 100644 --- a/app/Controllers/Admin/Customer/ServiceController.php +++ b/app/Controllers/Admin/Customer/ServiceController.php @@ -58,6 +58,13 @@ class ServiceController extends CustomerController return $result; } //Index,FieldForm관련 + //수정관련 + protected function modify_process(mixed $entity, array $formDatas): mixed + { + //수정자 정보 자동추가용 + $formDatas['user_uid'] = $this->getMyAuth()->getUIDByAuthInfo(); + return parent::modify_process($entity, $formDatas); + } //View 관련 protected function view_process(mixed $entity): mixed { diff --git a/app/Controllers/Admin/Customer/ServicePaymentController.php b/app/Controllers/Admin/Customer/ServicePaymentController.php index 5b33967..410dac3 100644 --- a/app/Controllers/Admin/Customer/ServicePaymentController.php +++ b/app/Controllers/Admin/Customer/ServicePaymentController.php @@ -81,6 +81,13 @@ class ServicePaymentController extends CustomerController return $result; } //Index,FieldForm관련 + //수정관련 + protected function modify_process(mixed $entity, array $formDatas): mixed + { + //수정자 정보 자동추가용 + $formDatas['user_uid'] = $this->getMyAuth()->getUIDByAuthInfo(); + return parent::modify_process($entity, $formDatas); + } //View 관련 protected function view_process(mixed $entity): mixed { diff --git a/app/Database/erp2_2.vuerd.json b/app/Database/erp2_2.vuerd.json index 86a1bcd..96482bb 100644 --- a/app/Database/erp2_2.vuerd.json +++ b/app/Database/erp2_2.vuerd.json @@ -4,13 +4,13 @@ "settings": { "width": 3000, "height": 3000, - "scrollTop": -847.6656, - "scrollLeft": -448.1008, + "scrollTop": -958.6656, + "scrollLeft": -800, "zoomLevel": 0.73, "show": 511, "database": 4, "databaseName": "", - "canvasType": "@dineug/erd-editor/builtin-schema-sql", + "canvasType": "ERD", "language": 1, "tableNameCase": 4, "columnNameCase": 2, diff --git a/app/Helpers/CommonHelper.php b/app/Helpers/CommonHelper.php index 78b5cd2..86f9d87 100644 --- a/app/Helpers/CommonHelper.php +++ b/app/Helpers/CommonHelper.php @@ -6,6 +6,7 @@ use CodeIgniter\HTTP\IncomingRequest; class CommonHelper { + private $_myAuth = null; private $_viewDatas = []; private $_titleField = ""; private ?IncomingRequest $_request = null; @@ -13,6 +14,13 @@ class CommonHelper { $this->_request = $request; } + final protected function getMyAuth(): mixed + { + if (!$this->_myAuth) { + $this->_myAuth = service('myauth'); + } + return $this->_myAuth; + } final public function getRequest(): IncomingRequest|null { return $this->_request; diff --git a/app/Helpers/Customer/ClientHelper.php b/app/Helpers/Customer/ClientHelper.php index 7759191..d6f0fb0 100644 --- a/app/Helpers/Customer/ClientHelper.php +++ b/app/Helpers/Customer/ClientHelper.php @@ -16,6 +16,10 @@ class ClientHelper extends CustomerHelper public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null { switch ($field) { + case "email": + case "phone": + $value = !$this->getMyAuth()->isAccessRole(['security']) ? "***********" : parent::getFieldView($field, $value, $viewDatas, $extras); + break; case 'account_balance': $extras = ["class" => "btn btn-link", "target" => "_self", ...$extras]; $value = form_label( @@ -65,4 +69,21 @@ class ClientHelper extends CustomerHelper } return $value; } // + public function getListButton(string $action, array $viewDatas, array $extras = []): string + { + switch ($action) { + case 'modify': + $action = !$this->getMyAuth()->isAccessRole(['security']) ? $viewDatas['cnt'] : parent::getListButton($action, $viewDatas, $extras); + break; + case 'delete': + case 'batchjob': + case 'batchjob_delete': + $action = !$this->getMyAuth()->isAccessRole(['security']) ? "" : parent::getListButton($action, $viewDatas, $extras); + break; + default: + $action = parent::getListButton($action, $viewDatas, $extras); + break; + } + return $action; + } } diff --git a/app/Language/en/User.php b/app/Language/en/User.php index cce7b87..d663b73 100644 --- a/app/Language/en/User.php +++ b/app/Language/en/User.php @@ -23,6 +23,7 @@ return [ "manager" => "관리자", "cloudflare" => "Cloudflare관리자", "firewall" => "firewall관리자", + "security" => "보안관리자", "director" => "감독자", "master" => "마스터", ], diff --git a/app/Services/Customer/ServicePaymentService.php b/app/Services/Customer/ServicePaymentService.php index 262d474..269c5ef 100644 --- a/app/Services/Customer/ServicePaymentService.php +++ b/app/Services/Customer/ServicePaymentService.php @@ -31,7 +31,6 @@ class ServicePaymentService extends CustomerService return [ "serviceinfo_uid", "ownerinfo_uid", - "user_uid", "item_type", "item_uid", "billing_cycle", diff --git a/app/Services/Customer/ServiceService.php b/app/Services/Customer/ServiceService.php index 7a475c7..e03677d 100644 --- a/app/Services/Customer/ServiceService.php +++ b/app/Services/Customer/ServiceService.php @@ -35,7 +35,6 @@ class ServiceService extends CustomerService return [ "clientinfo_uid", "ownerinfo_uid", - "user_uid", "type", "location", "switch",