diff --git a/app/Config/Routes.php b/app/Config/Routes.php index ced5a6a..206dec7 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -119,6 +119,19 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au $routes->post('batchjob_delete', 'ServiceItemController::batchjob_delete'); $routes->get('download/(:alpha)', 'ServiceItemController::download/$1'); }); + $routes->group('servicehistory', ['namespace' => 'App\Controllers\Admin\Customer'], function ($routes) { + $routes->get('/', 'ServiceHistoryController::index', []); + $routes->get('create', 'ServiceHistoryController::create_form'); + $routes->post('create', 'ServiceHistoryController::create'); + $routes->get('modify/(:num)', 'ServiceHistoryController::modify_form/$1'); + $routes->post('modify/(:num)', 'ServiceHistoryController::modify/$1'); + $routes->get('view/(:num)', 'ServiceHistoryController::view/$1'); + $routes->get('delete/(:num)', 'ServiceHistoryController::delete/$1'); + $routes->get('toggle/(:num)/(:any)', 'ServiceHistoryController::toggle/$1/$2'); + $routes->post('batchjob', 'ServiceHistoryController::batchjob'); + $routes->post('batchjob_delete', 'ServiceHistoryController::batchjob_delete'); + $routes->get('download/(:alpha)', 'ServiceHistoryController::download/$1'); + }); }); $routes->group('equipment', ['namespace' => 'App\Controllers\Admin\Equipment'], function ($routes) { $routes->group('server', ['namespace' => 'App\Controllers\Admin\Equipment'], function ($routes) { diff --git a/app/Controllers/Admin/Customer/CustomerController.php b/app/Controllers/Admin/Customer/CustomerController.php index 3e5d294..6de07ff 100644 --- a/app/Controllers/Admin/Customer/CustomerController.php +++ b/app/Controllers/Admin/Customer/CustomerController.php @@ -8,10 +8,20 @@ use CodeIgniter\HTTP\ResponseInterface; use Psr\Log\LoggerInterface; use App\Services\Customer\ClientService; +use App\Services\Equipment\Part\CpuService; +use App\Services\Equipment\Part\DefenceService; +use App\Services\Equipment\Part\StorageService; +use App\Services\Equipment\Part\IpService; +use App\Services\Equipment\Part\LineService; +use App\Services\Equipment\Part\RamService; +use App\Services\Equipment\Part\SoftwareService; +use App\Services\Equipment\ServerService; +use App\Services\Equipment\DomainService; abstract class CustomerController extends AdminController { private ?ClientService $_clientService = null; + private $_equipmentService = []; public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) { parent::initController($request, $response, $logger); @@ -39,4 +49,42 @@ abstract class CustomerController extends AdminController return $options; } //Index,FieldForm관련 + //ServiceItemController,ServiceController에서 사용 + final public function getEquipmentService(string $key): mixed + { + if (!array_key_exists($key, $this->_equipmentService)) { + switch ($key) { + case 'SERVER': + $this->_equipmentService[$key] = new ServerService(); + break; + case 'CPU': + $this->_equipmentService[$key] = new CpuService(); + break; + case 'RAM': + $this->_equipmentService[$key] = new RamService(); + break; + case 'STORAGE': + $this->_equipmentService[$key] = new StorageService(); + break; + case 'LINE': + $this->_equipmentService[$key] = new LineService(); + break; + case 'IP': + $this->_equipmentService[$key] = new IpService(); + break; + case 'DEFENCE': + $this->_equipmentService[$key] = new DefenceService(); + break; + case 'SOFTWARE': + $this->_equipmentService[$key] = new SoftwareService(); + break; + case 'DOMAIN': + $this->_equipmentService[$key] = new DomainService(); + break; + default: + throw new \Exception(__FUNCTION__ . "에서 사용하지않는 Service를 요청하였습니다.: {$key}"); + } + } + return $this->_equipmentService[$key]; + } } diff --git a/app/Controllers/Admin/Customer/ServiceController.php b/app/Controllers/Admin/Customer/ServiceController.php index 3ecbbcb..54a941b 100644 --- a/app/Controllers/Admin/Customer/ServiceController.php +++ b/app/Controllers/Admin/Customer/ServiceController.php @@ -11,20 +11,10 @@ use CodeIgniter\HTTP\RedirectResponse; use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\ResponseInterface; use Psr\Log\LoggerInterface; -use App\Services\Equipment\Part\CpuService; -use App\Services\Equipment\Part\DefenceService; -use App\Services\Equipment\Part\StorageService; -use App\Services\Equipment\Part\IpService; -use App\Services\Equipment\Part\LineService; -use App\Services\Equipment\Part\RamService; -use App\Services\Equipment\Part\SoftwareService; -use App\Services\Equipment\ServerService; -use App\Services\Equipment\DomainService; class ServiceController extends CustomerController { private ?ServiceItemService $_serviceItemService = null; - private $_equipmentService = []; public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) { parent::initController($request, $response, $logger); @@ -55,43 +45,6 @@ class ServiceController extends CustomerController } return $this->_serviceItemService; } - final public function getEquipmentService(string $key): mixed - { - if (!array_key_exists($key, $this->_equipmentService)) { - switch ($key) { - case 'SERVER': - $this->_equipmentService[$key] = new ServerService(); - break; - case 'CPU': - $this->_equipmentService[$key] = new CpuService(); - break; - case 'RAM': - $this->_equipmentService[$key] = new RamService(); - break; - case 'STORAGE': - $this->_equipmentService[$key] = new StorageService(); - break; - case 'LINE': - $this->_equipmentService[$key] = new LineService(); - break; - case 'IP': - $this->_equipmentService[$key] = new IpService(); - break; - case 'DEFENCE': - $this->_equipmentService[$key] = new DefenceService(); - break; - case 'SOFTWARE': - $this->_equipmentService[$key] = new SoftwareService(); - break; - case 'DOMAIN': - $this->_equipmentService[$key] = new DomainService(); - break; - default: - throw new \Exception(__FUNCTION__ . "에서 사용하지않는 Service를 요청하였습니다.: {$key}"); - } - } - return $this->_equipmentService[$key]; - } protected function getFormFieldOption(string $field, array $options = []): array { switch ($field) { diff --git a/app/Controllers/Admin/Customer/ServiceHistoryController.php b/app/Controllers/Admin/Customer/ServiceHistoryController.php new file mode 100644 index 0000000..490305c --- /dev/null +++ b/app/Controllers/Admin/Customer/ServiceHistoryController.php @@ -0,0 +1,79 @@ +title = lang("{$this->getService()->getClassName()}.title"); + $this->class_path .= $this->getService()->getClassName(); + $this->uri_path .= strtolower($this->getService()->getClassName('/')) . '/'; + // $this->view_path .= strtolower($this->getService()->getClassName()) . DIRECTORY_SEPARATOR; + + } + + public function getService(): ServiceHistoryService + { + if (!$this->_service) { + $this->_service = new ServiceHistoryService($this->request); + } + return $this->_service; + } + public function getHelper(): ServiceHistoryHelper + { + if (!$this->_helper) { + $this->_helper = new ServiceHistoryHelper($this->request); + } + return $this->_helper; + } + public function getServiceService(): ServiceService + { + if (!$this->_serviceService) { + $this->_serviceService = new ServiceService($this->request); + } + return $this->_serviceService; + } + + protected function getFormFieldOption(string $field, array $options = []): array + { + switch ($field) { + case 'serviceinfo_uid': + foreach ($this->getServiceService()->getEntities() as $entity) { + $options[$entity->getPK()] = $entity->getTitle(); + } + break; + default: + $options = parent::getFormFieldOption($field, $options); + break; + } + return $options; + } + protected function getResultSuccess(string $message = MESSAGES["SUCCESS"]): RedirectResponse|string + { + switch ($this->getAction()) { + case 'index': + $this->control = $this->getControlDatas(); + $this->getHelper()->setViewDatas($this->getViewDatas()); + $result = view($this->view_path . 'popup' . DIRECTORY_SEPARATOR . $this->getAction(), ['viewDatas' => $this->getViewDatas()]); + break; + default: + $result = parent::getResultSuccess($message); + break; + } + return $result; + } + //Index,FieldForm관련 +} diff --git a/app/Controllers/Admin/Customer/ServiceItemController.php b/app/Controllers/Admin/Customer/ServiceItemController.php index 3799d69..3480550 100644 --- a/app/Controllers/Admin/Customer/ServiceItemController.php +++ b/app/Controllers/Admin/Customer/ServiceItemController.php @@ -93,7 +93,7 @@ class ServiceItemController extends CustomerController throw new \Exception("{$formDatas['serviceinfo_uid']}에 대한 서비스정보를 찾을수 없습니다."); } $equipmentEntity = $this->getEquipmentService($formDatas['item_type'])->create([ - 'clientinfo_uid' => $serviceEntity->getClientInfoUID(), + 'clientinfo_uid' => $serviceEntity->getClientUID(), 'domain' => $formDatas['item_uid'] ]); //도메인용 항목의 item_uid로 전달함 diff --git a/app/Controllers/CommonController.php b/app/Controllers/CommonController.php index a98b36f..4b25d11 100644 --- a/app/Controllers/CommonController.php +++ b/app/Controllers/CommonController.php @@ -411,6 +411,7 @@ abstract class CommonController extends BaseController $this->setFieldRule($field, $this->getFormFieldRule($this->getAction(), $field)); //입력값정의 $formDatas = [$field => $this->request->getVar($field)]; + // dd($formDatas); $this->entity = $this->toggle_process($entity, $formDatas); $this->getService()->getModel()->transCommit(); return $this->getResultSuccess(); @@ -574,7 +575,7 @@ abstract class CommonController extends BaseController if ($value) { $this->$field = $value; } - } + } $this->entity = $this->view_process($entity); $this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []]; return $this->getResultSuccess(); diff --git a/app/Database/erp2_2.vuerd.json b/app/Database/erp2_2.vuerd.json index e0e1703..2f8a0e8 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": -903.0309, - "scrollLeft": -660.6028, + "scrollTop": -1395.0309, + "scrollLeft": -515.7816, "zoomLevel": 0.76, "show": 511, "database": 4, "databaseName": "", - "canvasType": "ERD", + "canvasType": "@dineug/erd-editor/builtin-schema-sql", "language": 1, "tableNameCase": 4, "columnNameCase": 2, @@ -50,7 +50,8 @@ "8GMPyGUFlx2Mw7BwzizfD", "B8haiEbPc1lRBWTv1g25G", "isiA_oaJNIm3F4nYJuLJ1", - "0WXrjcyXXGeoAVM2VB8s2" + "0WXrjcyXXGeoAVM2VB8s2", + "eLGlqJ4z_woGP6CLZEuUr" ], "relationshipIds": [ "gAVYXWnBSnCw-0ieO4Mil", @@ -65,7 +66,8 @@ "anhMCXytE7rcE_drKBPWz", "Wma86GpS3BhikEaHSamgX", "I80TuGxKm3tXIO_EO2PSm", - "o8yw46vm30cC7wl9cRMdo" + "o8yw46vm30cC7wl9cRMdo", + "ocWjncqwtYkP02mw4A0-8" ], "indexIds": [], "memoIds": [] @@ -373,15 +375,15 @@ "R-UjmO-S2UeQdddVNwH5M" ], "ui": { - "x": 157.5582, - "y": 1812.2726, + "x": 160.1898, + "y": 2080.6937, "zIndex": 2, "widthName": 60, "widthComment": 60, "color": "" }, "meta": { - "updateAt": 1749008087739, + "updateAt": 1749520757443, "createAt": 1745819764138 } }, @@ -931,6 +933,42 @@ "updateAt": 1749435563253, "createAt": 1748507247933 } + }, + "eLGlqJ4z_woGP6CLZEuUr": { + "id": "eLGlqJ4z_woGP6CLZEuUr", + "name": "serviceinfo_history", + "comment": "서비스정보_history", + "columnIds": [ + "GSdcECWONRu3DzkVAl77W", + "jyD_WqbebGSYxIa72ig3p", + "LmgKX38-LCXZSgqcIgHJj", + "4-Pao4CcHMrZtTY6e6qCK", + "oCf04YALk6M6oHU8bZHOy", + "DyDt_9ZdXzTgjVTIBUnYE", + "48WpZBVteR66aLEAb_iOh" + ], + "seqColumnIds": [ + "GSdcECWONRu3DzkVAl77W", + "Bj32Fyri_pY_6cWVF3Qn0", + "jyD_WqbebGSYxIa72ig3p", + "LmgKX38-LCXZSgqcIgHJj", + "4-Pao4CcHMrZtTY6e6qCK", + "oCf04YALk6M6oHU8bZHOy", + "DyDt_9ZdXzTgjVTIBUnYE", + "48WpZBVteR66aLEAb_iOh" + ], + "ui": { + "x": 35.2385, + "y": 1775.0406, + "zIndex": 2505, + "widthName": 99, + "widthComment": 103, + "color": "" + }, + "meta": { + "updateAt": 1749520763447, + "createAt": 1749520593335 + } } }, "tableColumnEntities": { @@ -6573,6 +6611,166 @@ "updateAt": 1749517861624, "createAt": 1749517809732 } + }, + "GSdcECWONRu3DzkVAl77W": { + "id": "GSdcECWONRu3DzkVAl77W", + "tableId": "eLGlqJ4z_woGP6CLZEuUr", + "name": "uid", + "comment": "", + "dataType": "INT", + "default": "", + "options": 11, + "ui": { + "keys": 1, + "widthName": 60, + "widthComment": 60, + "widthDataType": 60, + "widthDefault": 60 + }, + "meta": { + "updateAt": 1749520665994, + "createAt": 1749520659473 + } + }, + "Bj32Fyri_pY_6cWVF3Qn0": { + "id": "Bj32Fyri_pY_6cWVF3Qn0", + "tableId": "eLGlqJ4z_woGP6CLZEuUr", + "name": "serviceinfo_uid", + "comment": "", + "dataType": "INT", + "default": "", + "options": 8, + "ui": { + "keys": 0, + "widthName": 80, + "widthComment": 60, + "widthDataType": 60, + "widthDefault": 60 + }, + "meta": { + "updateAt": 1749520659473, + "createAt": 1749520659473 + } + }, + "oCf04YALk6M6oHU8bZHOy": { + "id": "oCf04YALk6M6oHU8bZHOy", + "tableId": "eLGlqJ4z_woGP6CLZEuUr", + "name": "status", + "comment": "상태", + "dataType": "VARCHAR(20)", + "default": "'default'", + "options": 8, + "ui": { + "keys": 0, + "widthName": 60, + "widthComment": 60, + "widthDataType": 75, + "widthDefault": 60 + }, + "meta": { + "updateAt": 1749520659473, + "createAt": 1749520659473 + } + }, + "DyDt_9ZdXzTgjVTIBUnYE": { + "id": "DyDt_9ZdXzTgjVTIBUnYE", + "tableId": "eLGlqJ4z_woGP6CLZEuUr", + "name": "updated_at", + "comment": "", + "dataType": "TIMESTAMP", + "default": "", + "options": 0, + "ui": { + "keys": 0, + "widthName": 62, + "widthComment": 60, + "widthDataType": 65, + "widthDefault": 60 + }, + "meta": { + "updateAt": 1749520659473, + "createAt": 1749520659473 + } + }, + "48WpZBVteR66aLEAb_iOh": { + "id": "48WpZBVteR66aLEAb_iOh", + "tableId": "eLGlqJ4z_woGP6CLZEuUr", + "name": "created_at", + "comment": "", + "dataType": "TIMESTAMP", + "default": "CURRENT_TIMESTAMP", + "options": 8, + "ui": { + "keys": 0, + "widthName": 60, + "widthComment": 60, + "widthDataType": 65, + "widthDefault": 122 + }, + "meta": { + "updateAt": 1749520659473, + "createAt": 1749520659473 + } + }, + "LmgKX38-LCXZSgqcIgHJj": { + "id": "LmgKX38-LCXZSgqcIgHJj", + "tableId": "eLGlqJ4z_woGP6CLZEuUr", + "name": "title", + "comment": "", + "dataType": "VARCHAR(255)", + "default": "", + "options": 8, + "ui": { + "keys": 0, + "widthName": 60, + "widthComment": 60, + "widthDataType": 81, + "widthDefault": 60 + }, + "meta": { + "updateAt": 1749520700141, + "createAt": 1749520682358 + } + }, + "4-Pao4CcHMrZtTY6e6qCK": { + "id": "4-Pao4CcHMrZtTY6e6qCK", + "tableId": "eLGlqJ4z_woGP6CLZEuUr", + "name": "description", + "comment": "", + "dataType": "TEXT", + "default": "", + "options": 0, + "ui": { + "keys": 0, + "widthName": 61, + "widthComment": 60, + "widthDataType": 60, + "widthDefault": 60 + }, + "meta": { + "updateAt": 1749520710971, + "createAt": 1749520710971 + } + }, + "jyD_WqbebGSYxIa72ig3p": { + "id": "jyD_WqbebGSYxIa72ig3p", + "tableId": "eLGlqJ4z_woGP6CLZEuUr", + "name": "serviceinfo_uid", + "comment": "", + "dataType": "INT", + "default": "", + "options": 8, + "ui": { + "keys": 2, + "widthName": 80, + "widthComment": 60, + "widthDataType": 60, + "widthDefault": 60 + }, + "meta": { + "updateAt": 1749520739979, + "createAt": 1749520727362 + } } }, "relationshipEntities": { @@ -6707,8 +6905,8 @@ "columnIds": [ "f7_MGvRjkwL1xkCWrAgDR" ], - "x": 655.5581999999999, - "y": 1912.2726, + "x": 658.1898, + "y": 2180.6937, "direction": 2 }, "meta": { @@ -6867,7 +7065,7 @@ "N_yJVoCN4oUEDhYqdzApb" ], "x": 934.3741, - "y": 1236.673, + "y": 1132.673, "direction": 1 }, "end": { @@ -6939,6 +7137,34 @@ "updateAt": 1749517809733, "createAt": 1749517809733 } + }, + "ocWjncqwtYkP02mw4A0-8": { + "id": "ocWjncqwtYkP02mw4A0-8", + "identification": false, + "relationshipType": 16, + "startRelationshipType": 2, + "start": { + "tableId": "B8haiEbPc1lRBWTv1g25G", + "columnIds": [ + "N_yJVoCN4oUEDhYqdzApb" + ], + "x": 934.3741, + "y": 1340.673, + "direction": 1 + }, + "end": { + "tableId": "eLGlqJ4z_woGP6CLZEuUr", + "columnIds": [ + "jyD_WqbebGSYxIa72ig3p" + ], + "x": 556.2385, + "y": 1887.0406, + "direction": 2 + }, + "meta": { + "updateAt": 1749520727362, + "createAt": 1749520727362 + } } }, "indexEntities": {}, diff --git a/app/Entities/Customer/CustomerEntity.php b/app/Entities/Customer/CustomerEntity.php index 01519cf..36e4370 100644 --- a/app/Entities/Customer/CustomerEntity.php +++ b/app/Entities/Customer/CustomerEntity.php @@ -11,7 +11,7 @@ abstract class CustomerEntity extends CommonEntity parent::__construct($data); } - final public function getClientInfoUID(): int + final public function getClientUID(): int { return intval($this->attributes['clientinfo_uid']); } diff --git a/app/Entities/Customer/ServiceEntity.php b/app/Entities/Customer/ServiceEntity.php index 75b01d6..abb814f 100644 --- a/app/Entities/Customer/ServiceEntity.php +++ b/app/Entities/Customer/ServiceEntity.php @@ -8,6 +8,10 @@ class ServiceEntity extends CustomerEntity { const PK = ServiceModel::PK; const TITLE = ServiceModel::TITLE; + final public function getOwnertUID(): int + { + return intval($this->attributes['ownerinfo_uid']); + } public function getItemEntities(string $type): array { return $this->attributes[$type] ?? []; diff --git a/app/Entities/Customer/ServiceHistoryEntity.php b/app/Entities/Customer/ServiceHistoryEntity.php new file mode 100644 index 0000000..9d91537 --- /dev/null +++ b/app/Entities/Customer/ServiceHistoryEntity.php @@ -0,0 +1,15 @@ +attributes['serviceinfo_uid']); + } +} diff --git a/app/Entities/Customer/ServiceItemEntity.php b/app/Entities/Customer/ServiceItemEntity.php index d0f97f0..a025e83 100644 --- a/app/Entities/Customer/ServiceItemEntity.php +++ b/app/Entities/Customer/ServiceItemEntity.php @@ -8,7 +8,10 @@ class ServiceItemEntity extends CustomerEntity { const PK = ServiceItemModel::PK; const TITLE = ServiceItemModel::TITLE; - + public function getServiceUid(): int + { + return intval($this->attributes['serviceinfo_uid']); + } public function getItemUid(): int { return intval($this->attributes['item_uid']); diff --git a/app/Helpers/Customer/ServiceHelper.php b/app/Helpers/Customer/ServiceHelper.php index cbe12cb..69078a9 100644 --- a/app/Helpers/Customer/ServiceHelper.php +++ b/app/Helpers/Customer/ServiceHelper.php @@ -31,7 +31,7 @@ class ServiceHelper extends CustomerHelper ICONS['SETUP'], $field, [ - "data-src" => "/admin/customer/serviceitem?item_type={$field}&serviceinfo_uid={$viewDatas['entity']->getPK()}", + "data-src" => "/admin/customer/serviceitem?serviceinfo_uid={$viewDatas['entity']->getPK()}&item_type={$field}", "data-bs-toggle" => "modal", "data-bs-target" => "#index_action_form", ...$extras @@ -80,4 +80,27 @@ class ServiceHelper extends CustomerHelper } return $value; } + + public function getListButton(string $action, array $viewDatas, array $extras = []): string + { + switch ($action) { + case 'history': + $extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras]; + $action = form_label( + ICONS['PLAY'], + $action, + [ + "data-src" => "/admin/customer/servicehistory?serviceinfo_uid={$viewDatas['entity']->getPK()}", + "data-bs-toggle" => "modal", + "data-bs-target" => "#index_action_form", + ...$extras + ] + ); + break; + default: + $action = parent::getListButton($action, $viewDatas, $extras); + break; + } + return $action; + } } diff --git a/app/Helpers/Customer/ServiceHistoryHelper.php b/app/Helpers/Customer/ServiceHistoryHelper.php new file mode 100644 index 0000000..0024984 --- /dev/null +++ b/app/Helpers/Customer/ServiceHistoryHelper.php @@ -0,0 +1,16 @@ +setTitleField(field: ServiceHistoryModel::TITLE); + } +} diff --git a/app/Language/en/Customer/ServiceHistory.php b/app/Language/en/Customer/ServiceHistory.php new file mode 100644 index 0000000..43a391a --- /dev/null +++ b/app/Language/en/Customer/ServiceHistory.php @@ -0,0 +1,20 @@ + "서비스History정보", + 'label' => [ + 'serviceinfo_uid' => "서비스명", + 'title' => "제목", + 'description' => "상세정보", + 'status' => "상태", + 'updated_at' => "수정일", + 'created_at' => "신청일", + 'deleted_at' => "삭제일", + ], + 'DEFAULTS' => [ + 'status' => 'default' + ], + "STATUS" => [ + 'default' => "사용중", + 'delete' => "삭제", + ], +]; diff --git a/app/Models/Customer/ServiceHistoryModel.php b/app/Models/Customer/ServiceHistoryModel.php new file mode 100644 index 0000000..3e0ee4f --- /dev/null +++ b/app/Models/Customer/ServiceHistoryModel.php @@ -0,0 +1,44 @@ + field가 array 입니다.\n" . var_export($field, true)); + } + switch ($field) { + case "serviceinfo_uid": + $rule = "required|numeric"; + break; + case "title": + $rule = "required|trim|string"; + break; + default: + $rule = parent::getFormFieldRule($action, $field); + break; + } + return $rule; + } +} diff --git a/app/Models/Customer/ServiceModel.php b/app/Models/Customer/ServiceModel.php index faaef11..abab79b 100644 --- a/app/Models/Customer/ServiceModel.php +++ b/app/Models/Customer/ServiceModel.php @@ -14,6 +14,7 @@ class ServiceModel extends CustomerModel protected $returnType = ServiceEntity::class; protected $allowedFields = [ "clientinfo_uid", + "ownerinfo_uid", "title", "type", "location", @@ -37,6 +38,7 @@ class ServiceModel extends CustomerModel } switch ($field) { case "clientinfo_uid": + case "ownerinfo_uid": $rule = "required|numeric"; break; case "title": diff --git a/app/Services/Customer/ServiceHistoryService.php b/app/Services/Customer/ServiceHistoryService.php new file mode 100644 index 0000000..21f8227 --- /dev/null +++ b/app/Services/Customer/ServiceHistoryService.php @@ -0,0 +1,46 @@ +addClassName('ServiceHistory'); + } + public function getModelClass(): ServiceHistoryModel + { + return new ServiceHistoryModel(); + } + public function getEntityClass(): ServiceHistoryEntity + { + return new ServiceHistoryEntity(); + } + public function getFormFields(): array + { + return [ + "serviceinfo_uid", + "title", + "description", + "status", + ]; + } + public function getFilterFields(): array + { + return ["serviceinfo_uid", 'status']; + } + public function getBatchJobFields(): array + { + return ['status']; + } + public function getIndexFields(): array + { + return ['serviceinfo_uid', 'title', 'status', 'created_at']; + } +} diff --git a/app/Views/admin/popup/index.php b/app/Views/admin/popup/index.php index 492d65f..8c0ea9f 100644 --- a/app/Views/admin/popup/index.php +++ b/app/Views/admin/popup/index.php @@ -27,7 +27,10 @@ getFieldView($field, $viewDatas) ?> - getListButton('delete', $viewDatas) ?> + + getListButton('view', $viewDatas) ?>  + getListButton('delete', $viewDatas) ?> + diff --git a/app/Views/admin/service/index.php b/app/Views/admin/service/index.php index 8a597ea..0a544e3 100644 --- a/app/Views/admin/service/index.php +++ b/app/Views/admin/service/index.php @@ -40,6 +40,7 @@ getListButton('view', $viewDatas) ?>  + getListButton('history', $viewDatas) ?>  getListButton('delete', $viewDatas) ?>