사용자 매뉴얼·번호알기·gov-portal 대시보드와 메뉴 동선·수불 리포트를 보강한다.
- 사용자 매뉴얼: league/commonmark 기반 bag/manual(로그인 전용), ManualRenderer + Config\Manual manifest, 콘텐츠 8종, E2E - 번호알기(봉투번호확인): bag/number-lookup, BagNumberLookup, E2E - gov-portal 대시보드 시안(기본/strip)·기본코드관리 화면 - 메뉴 관리: 등록·수정 후 메뉴 화면 유지, 수정 버튼 클릭 시 상단 스크롤 - 수불/분석 리포트(LOT 수불·반품/파기·수급계획·추이) 표시 보강 - .gitignore: docs/ → /docs/ 앵커링(최상위 개발문서만 제외, app/Docs는 추적) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,21 @@ class Menu extends BaseController
|
||||
$this->typeModel = model(MenuTypeModel::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 메뉴 등록·수정·삭제·순서변경 후 항상 같은 메뉴 관리 화면(mt_idx 유지)으로 돌아간다.
|
||||
* redirect()->back() 은 목록의 새 탭(target="_blank") 링크 클릭으로 세션 직전 URL(_ci_previous_url)이
|
||||
* 메뉴 대상 페이지로 덮어써지면 그 페이지로 이탈하므로, 명시적으로 메뉴 화면 URL 을 사용한다.
|
||||
*/
|
||||
private function menusRedirect(int $mtIdx): \CodeIgniter\HTTP\RedirectResponse
|
||||
{
|
||||
$url = base_url('admin/menus');
|
||||
if ($mtIdx > 0) {
|
||||
$url .= '?mt_idx=' . $mtIdx;
|
||||
}
|
||||
|
||||
return redirect()->to($url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 메뉴 관리 화면 (목록 + 등록/수정 폼). 지자체별 메뉴만 조회·관리.
|
||||
*/
|
||||
@@ -140,10 +155,10 @@ class Menu extends BaseController
|
||||
$mmDep = (int) $this->request->getPost('mm_dep');
|
||||
$mmName = trim((string) $this->request->getPost('mm_name'));
|
||||
if ($mtIdx <= 0) {
|
||||
return redirect()->back()->with('error', '메뉴 종류를 선택하세요.');
|
||||
return $this->menusRedirect($mtIdx)->with('error', '메뉴 종류를 선택하세요.');
|
||||
}
|
||||
if ($mmName === '') {
|
||||
return redirect()->back()->with('error', '메뉴명을 입력하세요.');
|
||||
return $this->menusRedirect($mtIdx)->with('error', '메뉴명을 입력하세요.');
|
||||
}
|
||||
$mmNum = $this->menuModel->getNextNum($mtIdx, $lgIdx, $mmPidx, $mmDep);
|
||||
$data = [
|
||||
@@ -164,7 +179,7 @@ class Menu extends BaseController
|
||||
}
|
||||
$this->menuModel->pruneInventoryManagementMenus($mtIdx, $lgIdx);
|
||||
$this->menuModel->syncTypeToAllLgs($mtIdx, $lgIdx);
|
||||
return redirect()->back()->with('success', '메뉴가 등록되었습니다.');
|
||||
return $this->menusRedirect($mtIdx)->with('success', '메뉴가 등록되었습니다.');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -182,10 +197,12 @@ class Menu extends BaseController
|
||||
}
|
||||
$row = $this->menuModel->find($id);
|
||||
if (! $row) {
|
||||
return redirect()->back()->with('error', '메뉴를 찾을 수 없습니다.');
|
||||
return $this->menusRedirect((int) $this->request->getPost('mt_idx'))
|
||||
->with('error', '메뉴를 찾을 수 없습니다.');
|
||||
}
|
||||
if ((int) $row->lg_idx !== $lgIdx) {
|
||||
return redirect()->back()->with('error', '해당 지자체의 메뉴만 수정할 수 있습니다.');
|
||||
return $this->menusRedirect((int) $row->mt_idx)
|
||||
->with('error', '해당 지자체의 메뉴만 수정할 수 있습니다.');
|
||||
}
|
||||
$data = [
|
||||
'mm_name' => (string) $this->request->getPost('mm_name'),
|
||||
@@ -196,7 +213,7 @@ class Menu extends BaseController
|
||||
$this->menuModel->update($id, $data);
|
||||
$this->menuModel->pruneInventoryManagementMenus((int) $row->mt_idx, $lgIdx);
|
||||
$this->menuModel->syncTypeToAllLgs((int) $row->mt_idx, $lgIdx);
|
||||
return redirect()->back()->with('success', '메뉴가 수정되었습니다.');
|
||||
return $this->menusRedirect((int) $row->mt_idx)->with('success', '메뉴가 수정되었습니다.');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -214,15 +231,16 @@ class Menu extends BaseController
|
||||
}
|
||||
$row = $this->menuModel->find($id);
|
||||
if (! $row || (int) $row->lg_idx !== $lgIdx) {
|
||||
return redirect()->back()->with('error', '해당 지자체의 메뉴만 삭제할 수 있습니다.');
|
||||
return $this->menusRedirect((int) $this->request->getPost('mt_idx'))
|
||||
->with('error', '해당 지자체의 메뉴만 삭제할 수 있습니다.');
|
||||
}
|
||||
$result = $this->menuModel->deleteSafe($id);
|
||||
if ($result['ok']) {
|
||||
$this->menuModel->pruneInventoryManagementMenus((int) $row->mt_idx, $lgIdx);
|
||||
$this->menuModel->syncTypeToAllLgs((int) $row->mt_idx, $lgIdx);
|
||||
return redirect()->back()->with('success', '메뉴가 삭제되었습니다.');
|
||||
return $this->menusRedirect((int) $row->mt_idx)->with('success', '메뉴가 삭제되었습니다.');
|
||||
}
|
||||
return redirect()->back()->with('error', $result['msg']);
|
||||
return $this->menusRedirect((int) $row->mt_idx)->with('error', $result['msg']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -239,8 +257,9 @@ class Menu extends BaseController
|
||||
->with('error', '지자체를 선택하세요.');
|
||||
}
|
||||
$ids = $this->request->getPost('mm_idx');
|
||||
$postMtIdx = (int) $this->request->getPost('mt_idx');
|
||||
if (! is_array($ids) || empty($ids)) {
|
||||
return redirect()->back()->with('error', '순서를 적용할 메뉴가 없습니다.');
|
||||
return $this->menusRedirect($postMtIdx)->with('error', '순서를 적용할 메뉴가 없습니다.');
|
||||
}
|
||||
$firstId = (int) ($ids[0] ?? 0);
|
||||
$firstRow = $firstId > 0 ? $this->menuModel->find($firstId) : null;
|
||||
@@ -249,7 +268,8 @@ class Menu extends BaseController
|
||||
$this->menuModel->pruneInventoryManagementMenus((int) $firstRow->mt_idx, $lgIdx);
|
||||
$this->menuModel->syncTypeToAllLgs((int) $firstRow->mt_idx, $lgIdx);
|
||||
}
|
||||
return redirect()->back()->with('success', '순서가 적용되었습니다.');
|
||||
$mtIdx = $firstRow ? (int) $firstRow->mt_idx : $postMtIdx;
|
||||
return $this->menusRedirect($mtIdx)->with('success', '순서가 적용되었습니다.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user