diff --git a/app/Backend/BaseBackend.php b/app/Backend/BaseBackend.php deleted file mode 100644 index 498c041..0000000 --- a/app/Backend/BaseBackend.php +++ /dev/null @@ -1,151 +0,0 @@ -_className = $className; - $this->_session = \Config\Services::session(); - } - - final public function getClassName() - { - return $this->_className; - } - - //User모델 - final public function getUserModel(): UserModel - { - return is_null($this->_userModel) ? new UserModel() : $this->_userModel; - } - //Entity값 가져오기 - final public function getEntity($uid) - { - return $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]); - } - - //transaction관련 - final public function transStart($isTest = false) - { - $this->_model->transStart($isTest); - } - final public function transComplete() - { - $this->_model->transComplete(); - } - final public function transRollback() - { - $this->_model->transRollback(); - } - - //초기화 - final public function getFields(string $action) - { - return $this->_model->getFields($action); - } - //TitleField - final public function getTitleField() - { - return $this->_model->getTitleField(); - } - //Field별 Form Rule용 - final public function getFieldRules(array $fields, string $action) - { - return $this->_model->getFieldRules($fields, $action); - } - //Field별 Form Filter용 - final public function getFieldFilters() - { - return $this->_model->getFieldFilters(); - } - //Field별 Form BatchFilter용 - final public function getFieldBatchFilters() - { - return $this->_model->getFieldBatchFilters(); - } - //Field별 Form Option용 - public function getFieldFormOption(string $field): array - { - switch ($field) { - case 'user_uid': - $options = $this->_user_uids = $this->_user_uids ?: $this->getUserModel()->getFieldFormOptions(['status' => 'use']); - break; - default: - $options = lang($this->_className . '.' . strtoupper($field)); - break; - } - if (!is_array($options)) { - throw new \Exception(__FUNCTION__ . "에서 {$this->_className}의 Field:{$field}의 FormOptionData가 array가 아닙니다.\n" . var_export($options, true)); - } - return $options; - } - //Field별 Form Option용 - final public function getFieldFormOptions(array $fields): array - { - $fieldFormOptions = array(); - foreach ($fields as $field) { - if (!is_string($field)) { - throw new \Exception(__FUNCTION__ . "에서 {$this->_className}의 Field:{$field}가 string 아닙니다.\n" . var_export($fields, true)); - } - $fieldFormOptions[$field] = $this->getFieldFormOption($field); - } - return $fieldFormOptions; - } - - //Insert관련 - public function insert(array $fieldDatas): BaseEntity - { - return $this->_model->create($fieldDatas); - } - //Update관련 - public function update($entity, array $fieldDatas) - { - return $this->_model->modify($entity, $fieldDatas); - } - //Delete 관련 - public function delete($entity) - { - if (!$this->_model->delete($entity->getPrimaryKey())) { - log_message("error", __FUNCTION__ . "에서 호출:" . $this->_model->getLastQuery()); - log_message("error", implode("\n", $this->_model->errors())); - throw new \Exception(__FUNCTION__ . " 오류 발생.\n" . var_export($this->_model->errors(), true)); - } - } - //View 관련 - public function view($entity) - { - return $entity; - } - - public function setCondition(array $filterFields, $word, $start, $end, $order_field, $order_value) - { - foreach ($filterFields as $field => $value) { - $this->_model->where($field, $value); - } - if (!is_null($word)) { - $this->_model->setIndexWordFilter($word); - } - if (!is_null($start) && !is_null($end)) { - $this->_model->setIndexDateFilter($start, $end); - } - $this->_model->setIndexOrderBy($order_field, $order_value); - } - final public function getTotalCount() - { - return $this->_model->countAllResults(); - } - final public function getFindEntitys(int $page = 0, int $per_page = 0) - { - return $per_page ? $this->_model->findAll($per_page, $page * $per_page - $per_page) : $this->_model->findAll(); - } -} diff --git a/app/Backend/BaseHierarchyBackend.php b/app/Backend/BaseHierarchyBackend.php deleted file mode 100644 index d10d640..0000000 --- a/app/Backend/BaseHierarchyBackend.php +++ /dev/null @@ -1,21 +0,0 @@ -_model->getContentField(); - } - //Reply관련 - public function reply($entity, array $fieldDatas) - { - return $this->_model->reply($entity, $fieldDatas); - } -} diff --git a/app/Backend/BoardBackend.php b/app/Backend/BoardBackend.php deleted file mode 100644 index 0cc30ba..0000000 --- a/app/Backend/BoardBackend.php +++ /dev/null @@ -1,47 +0,0 @@ -_model = new BoardModel(); - } - //BoardConfig모델 - final public function getBoardConfigModel(): BoardConfigModel - { - return is_null($this->_boardConfigModel) ? new BoardConfigModel() : $this->_boardConfigModel; - } - - //Field별 Form Option용 - public function getFieldFormOption(string $field): array - { - switch ($field) { - case 'board_config_uid': - $options = $this->_board_config_uids = $this->_board_config_uids ?: $this->getBoardConfigModel()->getFieldFormOptions(['status' => 'use']); - break; - default: - return parent::getFieldFormOption($field); - break; - } - if (!is_array($options)) { - throw new \Exception(__FUNCTION__ . "에서 {$this->getClassName()}의 Field:{$field}의 FormOptionData가 array가 아닙니다.\n" . var_export($options, true)); - } - return $options; - } - - //View관련 - public function view($entity) - { - //view_cnt에 추가하기위함 - $this->_model->increaseViewCount($entity->getPrimaryKey()); - return parent::view($entity); - } -} diff --git a/app/Backend/BoardConfigBackend.php b/app/Backend/BoardConfigBackend.php deleted file mode 100644 index 70428b6..0000000 --- a/app/Backend/BoardConfigBackend.php +++ /dev/null @@ -1,14 +0,0 @@ -_model = new BoardConfigModel(); - } -} diff --git a/app/Backend/HPILOBackend.php b/app/Backend/HPILOBackend.php deleted file mode 100644 index 1414518..0000000 --- a/app/Backend/HPILOBackend.php +++ /dev/null @@ -1,15 +0,0 @@ -_model = new HPILOModel(); - } -} diff --git a/app/Backend/UserBackend.php b/app/Backend/UserBackend.php deleted file mode 100644 index 3618566..0000000 --- a/app/Backend/UserBackend.php +++ /dev/null @@ -1,14 +0,0 @@ -_model = new UserModel(); - } -} diff --git a/app/Backend/UserSNSBackend.php b/app/Backend/UserSNSBackend.php deleted file mode 100644 index cb8da34..0000000 --- a/app/Backend/UserSNSBackend.php +++ /dev/null @@ -1,14 +0,0 @@ -_model = new UserSNSModel(); - } -} diff --git a/app/Views/admin/hpilo/index.php b/app/Views/admin/hpilo/index.php index d53647a..6c9a562 100644 --- a/app/Views/admin/hpilo/index.php +++ b/app/Views/admin/hpilo/index.php @@ -9,7 +9,7 @@ = form_close(); ?> - = form_open(current_url() . '/batchjob', $forms['attributes'], $forms['hiddens']) ?> + = form_open(current_url() . 'batchjob', $forms['attributes'], $forms['hiddens']) ?>
| 번호 | @@ -21,12 +21,12 @@|||
|---|---|---|---|
| = form_checkbox(["id" => "checkbox_uid_{$entity->getPrimaryKey()}", "name" => "batchjob_uids[]", "value" => $entity->getPrimaryKey(), "class" => "batchjobuids_checkboxs"]); ?> - = anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $total_count - (($page - 1) * $per_page + $i), ["target" => "_self"]) ?> + = anchor(current_url() . 'update/' . $entity->getPrimaryKey(), $total_count - (($page - 1) * $per_page + $i), ["target" => "_self"]) ?> | = getFieldIndex_Row_HPILOHelper($field, $entity, $fieldFilters, $fieldFormOptions) ?> | -= anchor(current_url() . '/delete/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?> | += anchor(current_url() . 'delete/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?> |