diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 7dd29ec..77bb67d 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -78,20 +78,20 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au $routes->get('toggle/(:num)/(:hash)', 'CategoryController::toggle/$1/$2'); $routes->post('batchjob', 'CategoryController::batchjob'); }); - $routes->group('hpilo', static function ($routes) { - $routes->get('', 'HPILOController::index'); - $routes->get('excel', 'HPILOController::excel'); - $routes->get('insert', 'HPILOController::insert_form'); - $routes->post('insert', 'HPILOController::insert'); - $routes->get('update/(:num)', 'HPILOController::update_form/$1'); - $routes->post('update/(:num)', 'HPILOController::update/$1'); - $routes->get('view/(:num)', 'HPILOController::view/$1'); - $routes->get('delete/(:num)', 'HPILOController::delete/$1', ['filter' => 'authFilter:master']); - $routes->get('toggle/(:num)/(:hash)', 'HPILOController::toggle/$1/$2'); - $routes->post('batchjob', 'HPILOController::batchjob'); - $routes->get('console/(:num)', 'HPILOController::console/$1'); - $routes->get('reset/(:num)/(:alpha)', 'HPILOController::reset/$1/$2'); - $routes->get('reload/(:num)', 'HPILOController::reload/$1'); + $routes->group('board', static function ($routes) { + $routes->get('', 'BoardController::index'); + $routes->get('excel', 'BoardController::excel/$1'); + $routes->get('insert', 'BoardController::insert_form'); + $routes->post('insert', 'BoardController::insert'); + $routes->get('update/(:num)', 'BoardController::update_form/$1'); + $routes->post('update/(:num)', 'BoardController::update/$1'); + $routes->get('view/(:num)', 'BoardController::view/$1'); + $routes->get('reply/(:num)', 'BoardController::reply_form/$1'); + $routes->post('reply/(:num)', 'BoardController::reply/$1'); + $routes->get('delete/(:num)', 'BoardController::delete/$1', ['filter' => 'authFilter:master']); + $routes->get('toggle/(:num)/(:hash)', 'BoardController::toggle/$1/$2'); + $routes->post('batchjob', 'BoardController::batchjob'); + $routes->get('download/(:any)/(:num)', 'BoardController::download/$1/$2'); }); }); $routes->group('front', ['namespace' => 'App\Controllers\Front'], function ($routes) { diff --git a/app/Controllers/Admin/BoardController.php b/app/Controllers/Admin/BoardController.php index 42e0d98..e4c6257 100644 --- a/app/Controllers/Admin/BoardController.php +++ b/app/Controllers/Admin/BoardController.php @@ -2,7 +2,6 @@ namespace App\Controllers\Admin; -use App\Models\BoardConfigModel; use App\Models\BoardModel; use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\ResponseInterface; diff --git a/app/Controllers/Admin/CategoryController.php b/app/Controllers/Admin/CategoryController.php index 6fe941e..858083d 100644 --- a/app/Controllers/Admin/CategoryController.php +++ b/app/Controllers/Admin/CategoryController.php @@ -21,14 +21,14 @@ class CategoryController extends AdminController public function getFields(string $action = ""): array { $fields = [ - 'name', "linkurl", "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload", + 'name', "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload", "status", "head", "tail", ]; switch ($action) { case "index": case "excel": return [ - 'name', "linkurl", "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload", + 'name', "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload", "status", "created_at" ]; break; diff --git a/app/Controllers/Front/BoardController.php b/app/Controllers/Front/BoardController.php index dccdd02..8898442 100644 --- a/app/Controllers/Front/BoardController.php +++ b/app/Controllers/Front/BoardController.php @@ -20,14 +20,14 @@ class BoardController extends FrontController public function getFields(string $action = ""): array { - $fields = ["category_uid", 'title', "board_file", "passwd", "content"]; + $fields = ['title', "board_file", "passwd", "content"]; switch ($action) { case "index": case "excel": - return ["category_uid", "user_uid", 'title', "board_file", "view_cnt", "created_at"]; + return ['title', "board_file", "view_cnt", "created_at"]; break; case "view": - return ["category_uid", "user_uid", 'title', "board_file", "view_cnt", "created_at", "content"]; + return ['title', "board_file", "view_cnt", "created_at", "content"]; break; default: return $fields; @@ -36,7 +36,7 @@ class BoardController extends FrontController } public function getFieldFilters(): array { - return ["category_uid", "user_uid"]; + return []; } public function getFieldBatchFilters(): array { diff --git a/app/Database/base.sql b/app/Database/base.sql index 0a27822..a7ae08d 100644 --- a/app/Database/base.sql +++ b/app/Database/base.sql @@ -51,7 +51,6 @@ CREATE TABLE servermgr.tw_category ( grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작', grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요', name varchar(255) NOT NULL COMMENT '범주명', - linkurl varchar(255) NULL COMMENT '연결URL', isaccess varchar(30) NOT NULL DEFAULT 'guest' COMMENT '접근권한', isread varchar(30) NOT NULL DEFAULT 'guest' COMMENT '읽기권한', iswrite varchar(30) NOT NULL DEFAULT 'guest' COMMENT '쓰기권한', @@ -79,7 +78,7 @@ CREATE TABLE servermgr.tw_board ( grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함', grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작', grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요', - cartory_uid int(10) UNSIGNED NOT NULL COMMENT '범주 UID', + category_uid int(10) UNSIGNED NOT NULL COMMENT '범주 UID', user_uid varchar(36) NULL COMMENT '작성자 정보', title varchar(255) NOT NULL COMMENT '제목', content text NOT NULL COMMENT '내용', diff --git a/app/Entities/BoardEntity.php b/app/Entities/BoardEntity.php index 3580fb3..4dd4f26 100644 --- a/app/Entities/BoardEntity.php +++ b/app/Entities/BoardEntity.php @@ -23,6 +23,14 @@ class BoardEntity extends BaseHierarchyEntity } //추가기능 + public function getCategory_Uid() + { + return $this->attributes['category_uid']; + } + public function getUser_Uid() + { + return $this->attributes['user_uid']; + } public function getPassword() { return $this->attributes['passwd']; @@ -31,8 +39,4 @@ class BoardEntity extends BaseHierarchyEntity { return $this->attributes['view_cnt']; } - public function getUser_Uid() - { - return $this->attributes['user_uid']; - } } diff --git a/app/Entities/CategoryEntity.php b/app/Entities/CategoryEntity.php index 9dfcf16..4e90eb5 100644 --- a/app/Entities/CategoryEntity.php +++ b/app/Entities/CategoryEntity.php @@ -23,10 +23,6 @@ class CategoryEntity extends BaseHierarchyEntity } //추가기능 - public function getLinkURL() - { - return $this->attributes['linkurl']; - } public function getHead() { return $this->attributes['head']; diff --git a/app/Helpers/Board_helper.php b/app/Helpers/Board_helper.php index aa8e1ae..a740168 100644 --- a/app/Helpers/Board_helper.php +++ b/app/Helpers/Board_helper.php @@ -15,7 +15,7 @@ function getFieldLabel_BoardHelper($field, array $fieldRules, array $attributes function getFieldForm_BoardHelper($field, $value, array $fieldFormOptions, array $attributes = array()) { switch ($field) { - case "board_config_uid": + case "category_uid": case "user_uid": $fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("Board.label.{$field}") . " 선택", ...$fieldFormOptions[$field]]; return form_dropdown($field, $fieldFormOptions[$field], $value, [...$attributes, 'class' => "select-field"]); @@ -59,6 +59,15 @@ function getFieldView_BoardHelper($field, $entity, array $fieldFilters, array $f { $value = $entity->$field ?: DEFAULTS['EMPTY']; switch ($field) { + case 'category_uid': + $categorys = array(); + foreach (array_values($fieldFormOptions[$field]) as $category_2depth) { + foreach ($category_2depth as $key => $label) { + $categorys[$key] = $label; + } + } + return $categorys[$value]; + break; case 'title': return sprintf( "
%s %s
", diff --git a/app/Helpers/Category_helper.php b/app/Helpers/Category_helper.php index ca7b8b4..ddbc04b 100644 --- a/app/Helpers/Category_helper.php +++ b/app/Helpers/Category_helper.php @@ -56,9 +56,6 @@ function getFieldForm_CategoryHelper($field, $value, array $fieldFormOptions, ar case 'name': return form_input($field, $value, [...$attributes, "placeholder" => "예)", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]); break; - case 'linkurl': - return form_input($field, $value, [...$attributes, "placeholder" => "예)/front/board", "style" => "width:100%; ::placeholder{ color:silver; opacity: 1; }"]); - break; default: return form_input($field, $value, [...$attributes]); break; diff --git a/app/Language/ko/Category.php b/app/Language/ko/Category.php index 7839300..548bc6e 100644 --- a/app/Language/ko/Category.php +++ b/app/Language/ko/Category.php @@ -9,7 +9,6 @@ return [ 'label' => [ 'uid' => "번호", 'name' => "범주제목", - 'linkurl' => "연결URL", 'isaccess' => "접속권한", 'isread' => "읽기권한", 'iswrite' => "쓰기권한", diff --git a/app/Models/CategoryModel.php b/app/Models/CategoryModel.php index 6ea18d0..ad37038 100644 --- a/app/Models/CategoryModel.php +++ b/app/Models/CategoryModel.php @@ -13,7 +13,7 @@ class CategoryModel extends BaseHierarchyModel parent::__construct('Category'); $this->allowedFields = [ ...$this->allowedFields, - 'name', "linkurl", "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload", + 'name', "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload", "head", "tail", "status" ]; $this->validationRules = [...$this->validationRules, ...$this->getFieldRules($this->allowedFields),]; @@ -33,10 +33,6 @@ class CategoryModel extends BaseHierarchyModel $rules[$field] = "required|trim|string"; $rules[$field] .= $action == "insert" ? "|is_unique[{$this->table}.{$field}]" : ""; break; - case "linkurl": - $rules[$field] = "if_exist|trim|string"; - $rules[$field] .= $action == "insert" ? "|is_unique[{$this->table}.{$field}]" : ""; - break; case "isaccess": case "isread": case "iswrite": @@ -119,7 +115,7 @@ class CategoryModel extends BaseHierarchyModel { parent::setIndexWordFilter($word); $this->orLike($this->getTitle(), $word, "both"); //befor , after , both - $this->orLike("linkurl", $word, "both"); //befor , after , both + $this->orLike($word, "both"); //befor , after , both $this->orLike("head", $word, "both"); //befor , after , both $this->orLike("tail", $word, "both"); //befor , after , both $this->orLike("isaccess", $word, "both"); //befor , after , both