refactor(project): 화면 용어를 아사나 한국어판에 맞춰 통일

화면·버튼·말풍선·알림창·메일·수신함 알림 문구와 문서의 용어를 바꾼다.
코드 식별자·DB 컬럼·API 주소·코드 주석은 그대로(동작 변화 없음).

- 업무 → 작업 (하위/상위 작업, 내 작업 포함, 뒤 조사도 맞춤)
- 세션 → 섹션, 팔로워 → 협업자, 리스트 → 목록, 달력 → 캘린더
- 알림센터 → 수신함, 첨부 → 첨부 파일, 링크 복사 → 작업 링크 복사
- 연결된 프로젝트 → 프로젝트 칸 + "다른 프로젝트에 추가"
- 담당자 선택 (미지정) → 담당자 없음
- "@태그"는 그대로
- docs/PROJECT_MODULE.md 맨 위에 용어 표, 정적 파일 버전 20260925f

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-25 18:47:08 +09:00
parent 91347f8aef
commit ea15c90a61
12 changed files with 298 additions and 292 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ Claude Code는 이 저장소에서 작업을 시작하기 전에 **반드시 아
- 말레이시아 창고 재고관리 (`app/modules/malaysia/`, `malaysia_stock_db`) — 낱개(MT/MX/MZ) 입출고·조정, 세트(MY) BOM, 일일 재고조사(세트→낱개 자동 분해), 현재고 현황. 뚜껑(MD-)은 재고 집계 제외 — 단, 창고 랙에는 위치 확인용으로 배치 가능(`store.LID_ITEMS`). 상품은 `itemcode_db` 읽기 전용. 권한키 `malaysia` - 말레이시아 창고 재고관리 (`app/modules/malaysia/`, `malaysia_stock_db`) — 낱개(MT/MX/MZ) 입출고·조정, 세트(MY) BOM, 일일 재고조사(세트→낱개 자동 분해), 현재고 현황. 뚜껑(MD-)은 재고 집계 제외 — 단, 창고 랙에는 위치 확인용으로 배치 가능(`store.LID_ITEMS`). 상품은 `itemcode_db` 읽기 전용. 권한키 `malaysia`
- 말레이시아 배송 (`app/modules/dispatch/`, `dispatch_db`) — TikTok·Shopee 출고관리. 플랫폼별 데이터 엑셀 업로드(TikTok=03_TikTok_Order_Export.xlsx, Shopee=Packing List.Doorstep Delivery.xlsx) → 1상자=1카드 출고 작업 리스트·SKU 피킹 요약·Kagayaku 전달표 자동 생성. 1상자 묶음 기준 Package ID > Tracking ID > Order ID, 같은 상자 같은 SKU 합산. 작업 상태 토글(`dispatch_logs` 기록). 받는 사람 이름/전화/주소는 상자 단위로 저장(작업 카드 표시 + 출고 엑셀 생성용 — 개인정보). 배치 다운로드 zip 에 업로드 원본 + 취합 출고 엑셀(`YYYY.MM.DD(Ddd)_tictoc|shopee.xlsx`) 포함. 엑셀은 openpyxl 파싱/생성. 권한키 `dispatch`. 상세는 `docs/DISPATCH_MODULE.md` - 말레이시아 배송 (`app/modules/dispatch/`, `dispatch_db`) — TikTok·Shopee 출고관리. 플랫폼별 데이터 엑셀 업로드(TikTok=03_TikTok_Order_Export.xlsx, Shopee=Packing List.Doorstep Delivery.xlsx) → 1상자=1카드 출고 작업 리스트·SKU 피킹 요약·Kagayaku 전달표 자동 생성. 1상자 묶음 기준 Package ID > Tracking ID > Order ID, 같은 상자 같은 SKU 합산. 작업 상태 토글(`dispatch_logs` 기록). 받는 사람 이름/전화/주소는 상자 단위로 저장(작업 카드 표시 + 출고 엑셀 생성용 — 개인정보). 배치 다운로드 zip 에 업로드 원본 + 취합 출고 엑셀(`YYYY.MM.DD(Ddd)_tictoc|shopee.xlsx`) 포함. 엑셀은 openpyxl 파싱/생성. 권한키 `dispatch`. 상세는 `docs/DISPATCH_MODULE.md`
- 카페24 상품관리 (`app/modules/cafe24/`, `cafe24_db`) — 카페24 관리자에 들어가지 않고 상품 상세페이지(description HTML) 조회·편집·즉시적용·예약적용·버전 이력. 3분할 화면(목록 | HTML 편집기 | 상품 정보 패널). 정보 패널(`routes_product_info.py`, `_side.html`)에서 상품명·판매가·공급가·소비자가, 대표이미지(업로드 → `POST /admin/products/images` → PUT `detail_image`+`image_upload_type=A`), 옵션(생성/이름·썸네일·표시방식 수정/삭제)·품목(자체코드·추가금액·진열·판매)을 수정. 카페24 OAuth/API 클라이언트는 향후 주문관리와 공유하기 위해 **공통 계층 `app/integrations/cafe24/`** 에 둔다 — 라우터에서 `httpx`/`requests` 직접 호출 금지. 토큰은 Fernet 암호화 저장(`CAFE24_TOKEN_SECRET`), 로그/화면에 토큰·시크릿 절대 미출력. 쓰기 직전 항상 카페24 현재 HTML 을 다시 읽어 `BACKUP` revision 생성(로컬 값을 현재값으로 가정 금지). **카페24 관리자 API 는 PUT 뒤 한동안 GET 에서 예전 값을 돌려준다(읽기 지연)** — 우리 캐시 문제가 아니다. 그래서 "마지막 쓰기가 권위": 상세설명은 카페24 값이 최근 revision 중 하나와 같으면 지연으로 보고 마지막 MANUAL/SCHEDULED 를 표시·지문 기준으로 쓰고(`store.resolve_description`), 스칼라(상품명·가격·이미지·진열/판매)는 PUT 응답 스냅샷(`cafe24_products.last_write_snapshot`, 마이그레이션 004)과 GET 의 `updated_date` 를 비교해 덮어씌운다(`store.overlay_recent_write`). 유예시간 `CAFE24_READ_LAG_GRACE_MIN`(기본 360분). 쓰기 후 화면은 PUT 응답으로 그리고 다시 GET 하지 않는다. 예약은 DB 저장 + 별도 worker(`app/modules/cafe24/worker.py`, compose 서비스 `dbx-cafe24-worker`)가 처리 — 웹 프로세스에서 대기하지 않는다. 권한키 `cafe24`(연결/해제는 admin 전용). 상세는 `docs/CAFE24_MODULE.md` - 카페24 상품관리 (`app/modules/cafe24/`, `cafe24_db`) — 카페24 관리자에 들어가지 않고 상품 상세페이지(description HTML) 조회·편집·즉시적용·예약적용·버전 이력. 3분할 화면(목록 | HTML 편집기 | 상품 정보 패널). 정보 패널(`routes_product_info.py`, `_side.html`)에서 상품명·판매가·공급가·소비자가, 대표이미지(업로드 → `POST /admin/products/images` → PUT `detail_image`+`image_upload_type=A`), 옵션(생성/이름·썸네일·표시방식 수정/삭제)·품목(자체코드·추가금액·진열·판매)을 수정. 카페24 OAuth/API 클라이언트는 향후 주문관리와 공유하기 위해 **공통 계층 `app/integrations/cafe24/`** 에 둔다 — 라우터에서 `httpx`/`requests` 직접 호출 금지. 토큰은 Fernet 암호화 저장(`CAFE24_TOKEN_SECRET`), 로그/화면에 토큰·시크릿 절대 미출력. 쓰기 직전 항상 카페24 현재 HTML 을 다시 읽어 `BACKUP` revision 생성(로컬 값을 현재값으로 가정 금지). **카페24 관리자 API 는 PUT 뒤 한동안 GET 에서 예전 값을 돌려준다(읽기 지연)** — 우리 캐시 문제가 아니다. 그래서 "마지막 쓰기가 권위": 상세설명은 카페24 값이 최근 revision 중 하나와 같으면 지연으로 보고 마지막 MANUAL/SCHEDULED 를 표시·지문 기준으로 쓰고(`store.resolve_description`), 스칼라(상품명·가격·이미지·진열/판매)는 PUT 응답 스냅샷(`cafe24_products.last_write_snapshot`, 마이그레이션 004)과 GET 의 `updated_date` 를 비교해 덮어씌운다(`store.overlay_recent_write`). 유예시간 `CAFE24_READ_LAG_GRACE_MIN`(기본 360분). 쓰기 후 화면은 PUT 응답으로 그리고 다시 GET 하지 않는다. 예약은 DB 저장 + 별도 worker(`app/modules/cafe24/worker.py`, compose 서비스 `dbx-cafe24-worker`)가 처리 — 웹 프로세스에서 대기하지 않는다. 권한키 `cafe24`(연결/해제는 admin 전용). 상세는 `docs/CAFE24_MODULE.md`
- 프로젝트 관리 (`app/modules/project/`, `project_db`) — 아사나식. 프로젝트/서브프로젝트(self-FK `parent_id`, CASCADE)·업무(`tasks`: 담당자·우선순위·시작/마감)·진행단계(`project_stages` 칸반, 생성시 기본 4단계 seed, 세션 기본 담당자 `default_assignee_email` — 담당자 빈 업무를 그 세션에 만들거나 옮기면 자동 배정, 마이그레이션 009)·멤버 배정(`project_members`)·활동이력(`project_activity`). 첫 화면(`/project/`)은 **내 업무 목록**(프로젝트 홈 카드 화면은 폐지). 프로젝트 화면은 달력(FullCalendar)/타임라인(vis-timeline)/보드/리스트/대시보드 뷰 토글. 좌측 사이드바는 수신함·내 업무·휴지통·프로젝트 화면 공용(`templates/project/_side.html` + 프로젝트 목록 동작 `initSideTree`, 새 프로젝트/수정 모달 `_side_modals.html`) — 프로젝트 목록(순서 변경·✎·×)은 어느 화면에서나 같다. 보드는 아사나처럼 세션이 가로로 계속 늘어나고(넘치면 가로 스크롤) 카드의 담당자·마감일을 클릭해 그 자리에서 바꾼다. 좌측 사이드바에 수신함·내 업무(접이식) 메뉴. 설명란은 주소 붙여넣기 시 자동 링크, 설명란·댓글에서 @로 멤버를 태그하면 (`task_mentions`, 마이그레이션 006) 수신함에 그 업무가 쌓인다. 진입 권한키 `project`(관리자 페이지 토글로 직원별 부여, admin 자동). 프로젝트 생성은 `project` 권한자 누구나(만든 사람이 owner), 삭제는 만든 사람만(슈퍼관리자 예외), 사용자 배정은 `is_admin` 만. 배정 멤버(또는 owner/admin)만 그 프로젝트를 조회(화면·API 모두, 비멤버 403)하고 서브프로젝트/업무/단계 CRUD — URL 의 세션·부모 업무가 그 프로젝트 것인지 서버가 검증. 실시간 반영은 `project_live_version` 카운터(마이그레이션 007, 미적용 시 MAX 폴백). 사이드바 전체 검색(`/api/search`, 제목·설명·댓글, pg_trgm) + 프로젝트/내 업무 필터 바(찾기·상태·담당자·마감·우선순위·정렬, 클라이언트 필터). 팔로워(`task_followers`, 자동 팔로우: 만든 사람·담당자·댓글·@태그) — 완료·댓글 알림은 담당자+팔로워에게만. 업무 삭제는 휴지통(`project_trash`, 마이그레이션 010) — 삭제 직전 스냅샷 3개월 보관, 관리자만 보기·복구(`/project/trash`). 마감 알림(`reminders.py` 데몬 스레드, 영업일 09시, D-1/당일/지연, `task_reminders` 로 중복 방지, `PROJECT_REMINDER_*` env) — 마이그레이션 008. 라우터 핸들러는 동기 DB 라 `def` 로 둔다(`async def` 금지). 말풍선은 전부 아사나식 공용 말풍선(`.pj-hovertip`) — 새 기능도 `title=`/`data-tip=` 만 달고 별도 툴팁 구현 금지. 멤버 배정 후보는 `project` 권한 보유 등록 사용자에서 자동 목록(`GET /project/api/assignable-users`). 업무 배정·완료 시 관리자에게 메일(`app/mail.py` stdlib smtplib, `SMTP_*`+`PROJECT_NOTIFY_EMAIL` env, 미설정 시 조용히 skip, `BackgroundTasks` 비동기). 상세는 `docs/PROJECT_MODULE.md` - 프로젝트 관리 (`app/modules/project/`, `project_db`) — 아사나식. 프로젝트/서브프로젝트(self-FK `parent_id`, CASCADE)·작업(`tasks`: 담당자·우선순위·시작/마감)·진행단계(`project_stages` 칸반, 생성시 기본 4단계 seed, 섹션 기본 담당자 `default_assignee_email` — 담당자 빈 작업을 그 섹션에 만들거나 옮기면 자동 배정, 마이그레이션 009)·멤버 배정(`project_members`)·활동이력(`project_activity`). 첫 화면(`/project/`)은 **내 작업 목록**(프로젝트 홈 카드 화면은 폐지). 프로젝트 화면은 캘린더(FullCalendar)/타임라인(vis-timeline)/보드/목록/대시보드 뷰 토글. 좌측 사이드바는 수신함·내 작업·휴지통·프로젝트 화면 공용(`templates/project/_side.html` + 프로젝트 목록 동작 `initSideTree`, 새 프로젝트/수정 모달 `_side_modals.html`) — 프로젝트 목록(순서 변경·✎·×)은 어느 화면에서나 같다. 보드는 아사나처럼 섹션이 가로로 계속 늘어나고(넘치면 가로 스크롤) 카드의 담당자·마감일을 클릭해 그 자리에서 바꾼다. 좌측 사이드바에 수신함·내 작업(접이식) 메뉴. 설명란은 주소 붙여넣기 시 자동 링크, 설명란·댓글에서 @로 멤버를 태그하면 (`task_mentions`, 마이그레이션 006) 수신함에 그 작업이 쌓인다. 진입 권한키 `project`(관리자 페이지 토글로 직원별 부여, admin 자동). 프로젝트 생성은 `project` 권한자 누구나(만든 사람이 owner), 삭제는 만든 사람만(슈퍼관리자 예외), 사용자 배정은 `is_admin` 만. 배정 멤버(또는 owner/admin)만 그 프로젝트를 조회(화면·API 모두, 비멤버 403)하고 서브프로젝트/작업/단계 CRUD — URL 의 섹션·부모 작업이 그 프로젝트 것인지 서버가 검증. 실시간 반영은 `project_live_version` 카운터(마이그레이션 007, 미적용 시 MAX 폴백). 사이드바 전체 검색(`/api/search`, 제목·설명·댓글, pg_trgm) + 프로젝트/내 작업 필터 바(찾기·상태·담당자·마감·우선순위·정렬, 클라이언트 필터). 협업자(`task_followers`, 자동 팔로우: 만든 사람·담당자·댓글·@태그) — 완료·댓글 알림은 담당자+협업자에게만. 작업 삭제는 휴지통(`project_trash`, 마이그레이션 010) — 삭제 직전 스냅샷 3개월 보관, 관리자만 보기·복구(`/project/trash`). 마감 알림(`reminders.py` 데몬 스레드, 영업일 09시, D-1/당일/지연, `task_reminders` 로 중복 방지, `PROJECT_REMINDER_*` env) — 마이그레이션 008. 라우터 핸들러는 동기 DB 라 `def` 로 둔다(`async def` 금지). 말풍선은 전부 아사나식 공용 말풍선(`.pj-hovertip`) — 새 기능도 `title=`/`data-tip=` 만 달고 별도 툴팁 구현 금지. 멤버 배정 후보는 `project` 권한 보유 등록 사용자에서 자동 목록(`GET /project/api/assignable-users`). 작업 배정·완료 시 관리자에게 메일(`app/mail.py` stdlib smtplib, `SMTP_*`+`PROJECT_NOTIFY_EMAIL` env, 미설정 시 조용히 skip, `BackgroundTasks` 비동기). 상세는 `docs/PROJECT_MODULE.md`
상세는 `docs/PROJECT_OVERVIEW.md`. 상세는 `docs/PROJECT_OVERVIEW.md`.
+14 -14
View File
@@ -280,7 +280,7 @@ class ProjectStore:
) -> dict[str, Any]: ) -> dict[str, Any]:
nm = store.norm_str(name) nm = store.norm_str(name)
if not nm: if not nm:
raise ValueError("세션 이름은 필수입니다.") raise ValueError("섹션 이름은 필수입니다.")
col = store.validate_stage_color(color) col = store.validate_stage_color(color)
dae = store.norm_str(default_assignee_email or "", lower=True) dae = store.norm_str(default_assignee_email or "", lower=True)
with self._pool.connection() as conn: with self._pool.connection() as conn:
@@ -352,13 +352,13 @@ class ProjectStore:
try: try:
sid = int(stage_id) sid = int(stage_id)
except (TypeError, ValueError): except (TypeError, ValueError):
raise ValueError("세션 값이 올바르지 않습니다.") raise ValueError("섹션 값이 올바르지 않습니다.")
row = conn.execute( row = conn.execute(
"SELECT 1 FROM project_stages WHERE id = %s AND project_id = %s", "SELECT 1 FROM project_stages WHERE id = %s AND project_id = %s",
(sid, project_id), (sid, project_id),
).fetchone() ).fetchone()
if not row: if not row:
raise ValueError("이 프로젝트의 세션이 아닙니다.") raise ValueError("이 프로젝트의 섹션이 아닙니다.")
return sid return sid
def stage_in_project(self, *, stage_id: Any, project_id: int) -> int | None: def stage_in_project(self, *, stage_id: Any, project_id: int) -> int | None:
@@ -609,12 +609,12 @@ class ProjectStore:
"SELECT project_id FROM tasks WHERE id = %s", (parent_task_id,) "SELECT project_id FROM tasks WHERE id = %s", (parent_task_id,)
).fetchone() ).fetchone()
if not parent: if not parent:
raise KeyError(f"상위 업무를 찾을 수 없습니다: {parent_task_id}") raise KeyError(f"상위 작업을 찾을 수 없습니다: {parent_task_id}")
# 권한은 URL 의 project_id 로 검사했으므로, 부모가 다른 프로젝트 # 권한은 URL 의 project_id 로 검사했으므로, 부모가 다른 프로젝트
# 업무면 거부한다(예전엔 부모 프로젝트로 조용히 바꿔 권한 없는 # 업무면 거부한다(예전엔 부모 프로젝트로 조용히 바꿔 권한 없는
# 프로젝트에 하위 업무를 만들 수 있었다). # 프로젝트에 하위 업무를 만들 수 있었다).
if int(parent["project_id"]) != int(project_id): if int(parent["project_id"]) != int(project_id):
raise ValueError("상위 업무가 이 프로젝트에 속하지 않습니다.") raise ValueError("상위 작업이 이 프로젝트에 속하지 않습니다.")
stage_id = None stage_id = None
elif stage_id not in (None, ""): elif stage_id not in (None, ""):
stage_id = self._check_stage_in_project(conn, stage_id, project_id) stage_id = self._check_stage_in_project(conn, stage_id, project_id)
@@ -674,19 +674,19 @@ class ProjectStore:
(task_id,), (task_id,),
).fetchone() ).fetchone()
if not sub: if not sub:
raise KeyError(f"업무를 찾을 수 없습니다: {task_id}") raise KeyError(f"작업을 찾을 수 없습니다: {task_id}")
if sub["parent_task_id"] is None: if sub["parent_task_id"] is None:
raise ValueError("하위 업무만 다른 업무로 옮길 수 있습니다.") raise ValueError("하위 작업만 다른 작업으로 옮길 수 있습니다.")
parent = conn.execute( parent = conn.execute(
"SELECT id, project_id, parent_task_id, title FROM tasks WHERE id = %s", "SELECT id, project_id, parent_task_id, title FROM tasks WHERE id = %s",
(parent_task_id,), (parent_task_id,),
).fetchone() ).fetchone()
if not parent: if not parent:
raise KeyError(f"상위 업무를 찾을 수 없습니다: {parent_task_id}") raise KeyError(f"상위 작업을 찾을 수 없습니다: {parent_task_id}")
if parent["parent_task_id"] is not None: if parent["parent_task_id"] is not None:
raise ValueError("하위 업무 안으로는 옮길 수 없습니다.") raise ValueError("하위 작업 안으로는 옮길 수 없습니다.")
if int(parent["project_id"]) != int(sub["project_id"]): if int(parent["project_id"]) != int(sub["project_id"]):
raise ValueError("다른 프로젝트의 업무로는 옮길 수 없습니다.") raise ValueError("다른 프로젝트의 작업으로는 옮길 수 없습니다.")
if int(parent["id"]) != int(sub["parent_task_id"]): if int(parent["id"]) != int(sub["parent_task_id"]):
nxt = conn.execute( nxt = conn.execute(
"SELECT COALESCE(MAX(sort_order), -1) + 1 AS n FROM tasks " "SELECT COALESCE(MAX(sort_order), -1) + 1 AS n FROM tasks "
@@ -959,23 +959,23 @@ class ProjectStore:
payload = tr["payload"] or {} payload = tr["payload"] or {}
tasks = list(payload.get("tasks") or []) tasks = list(payload.get("tasks") or [])
if not tasks: if not tasks:
raise ValueError("복구할 업무 데이터가 없습니다.") raise ValueError("복구할 작업 데이터가 없습니다.")
ids = [int(t["id"]) for t in tasks] ids = [int(t["id"]) for t in tasks]
clash = conn.execute( clash = conn.execute(
"SELECT id FROM tasks WHERE id = ANY(%s) LIMIT 1", (ids,) "SELECT id FROM tasks WHERE id = ANY(%s) LIMIT 1", (ids,)
).fetchone() ).fetchone()
if clash: if clash:
raise ValueError(f"이미 같은 업무(id {clash['id']})가 있어 복구할 수 없습니다.") raise ValueError(f"이미 같은 작업(id {clash['id']})이 있어 복구할 수 없습니다.")
project_ids = {int(r["id"]) for r in conn.execute("SELECT id FROM projects").fetchall()} project_ids = {int(r["id"]) for r in conn.execute("SELECT id FROM projects").fetchall()}
stage_ids = {int(r["id"]) for r in conn.execute("SELECT id FROM project_stages").fetchall()} stage_ids = {int(r["id"]) for r in conn.execute("SELECT id FROM project_stages").fetchall()}
root = next((t for t in tasks if int(t["id"]) == int(tr["task_id"])), tasks[0]) root = next((t for t in tasks if int(t["id"]) == int(tr["task_id"])), tasks[0])
if int(root["project_id"]) not in project_ids: if int(root["project_id"]) not in project_ids:
raise ValueError("업무가 속했던 프로젝트가 삭제되어 복구할 수 없습니다.") raise ValueError("작업이 속했던 프로젝트가 삭제되어 복구할 수 없습니다.")
parent = root.get("parent_task_id") parent = root.get("parent_task_id")
if parent and int(parent) not in ids: if parent and int(parent) not in ids:
ok = conn.execute("SELECT 1 FROM tasks WHERE id = %s", (int(parent),)).fetchone() ok = conn.execute("SELECT 1 FROM tasks WHERE id = %s", (int(parent),)).fetchone()
if not ok: if not ok:
raise ValueError("상위 업무가 없어 복구할 수 없습니다 — 상위 업무를 먼저 복구하세요.") raise ValueError("상위 작업이 없어 복구할 수 없습니다 — 상위 작업을 먼저 복구하세요.")
for t in tasks: for t in tasks:
if t.get("stage_id") is not None and int(t["stage_id"]) not in stage_ids: if t.get("stage_id") is not None and int(t["stage_id"]) not in stage_ids:
t["stage_id"] = None t["stage_id"] = None
+38 -38
View File
@@ -576,8 +576,8 @@ def my_tasks_page(request: Request) -> HTMLResponse:
"user": user, "user": user,
"is_admin": admin, "is_admin": admin,
"nav_items": build_erp_nav(user, active="project"), "nav_items": build_erp_nav(user, active="project"),
"page_title": "내 업무", "page_title": "내 작업",
"page_subtitle": "내가 담당자인 업무를 한 곳에서 봅니다.", "page_subtitle": "내가 담당자인 작업을 한 곳에서 봅니다.",
"force_sidebar_collapsed": True, "force_sidebar_collapsed": True,
"nav_projects": nav_projects, "nav_projects": nav_projects,
"my_tasks": my_tasks, "my_tasks": my_tasks,
@@ -634,10 +634,10 @@ def task_permalink(request: Request, task_id: int):
task = st.get_task(task_id=task_id) task = st.get_task(task_id=task_id)
if task is None: if task is None:
return _denied("업무를 찾을 수 없습니다. 삭제되었을 수 있습니다.", 404) return _denied("작업을 찾을 수 없습니다. 삭제되었을 수 있습니다.", 404)
if not _can_manage(request, st, user, task["project_id"]): if not _can_manage(request, st, user, task["project_id"]):
return _denied( return _denied(
"이 업무가 속한 프로젝트의 멤버만 볼 수 있습니다. " "이 작업이 속한 프로젝트의 멤버만 볼 수 있습니다. "
"프로젝트 관리자에게 멤버 배정을 요청하세요.", "프로젝트 관리자에게 멤버 배정을 요청하세요.",
403, 403,
) )
@@ -1080,7 +1080,7 @@ def api_add_stage(
_STAGE_ASSIGNEE_MIGRATION_MSG = ( _STAGE_ASSIGNEE_MIGRATION_MSG = (
"세션 기본 담당자 기능이 아직 준비되지 않았습니다(DB 마이그레이션 009 필요)." "섹션 기본 담당자 기능이 아직 준비되지 않았습니다(DB 마이그레이션 009 필요)."
) )
@@ -1105,7 +1105,7 @@ def _stage_of_project(st: Any, stage_id: int, project_id: int) -> dict[str, Any]
하므로, 이걸 안 보면 아무 프로젝트 멤버나 남의 세션을 고칠 수 있다.""" 하므로, 이걸 안 보면 아무 프로젝트 멤버나 남의 세션을 고칠 수 있다."""
stage = st.get_stage(stage_id=stage_id) stage = st.get_stage(stage_id=stage_id)
if stage is None or stage["project_id"] != project_id: if stage is None or stage["project_id"] != project_id:
raise HTTPException(status_code=404, detail="세션을 찾을 수 없습니다.") raise HTTPException(status_code=404, detail="섹션을 찾을 수 없습니다.")
return stage return stage
@@ -1124,7 +1124,7 @@ def api_delete_stage(
try: try:
st.delete_stage(stage_id=stage_id) st.delete_stage(stage_id=stage_id)
except KeyError: except KeyError:
raise HTTPException(status_code=404, detail="세션을 찾을 수 없습니다.") raise HTTPException(status_code=404, detail="섹션을 찾을 수 없습니다.")
return JSONResponse({"ok": True}) return JSONResponse({"ok": True})
@@ -1219,7 +1219,7 @@ def api_create_task(
), ),
body=( body=(
f"프로젝트: {project['name']}\n" f"프로젝트: {project['name']}\n"
f"업무: {task['title']}\n" f"작업: {task['title']}\n"
f"담당자: {task.get('assignee_name') or task['assignee_email']} " f"담당자: {task.get('assignee_name') or task['assignee_email']} "
f"({task['assignee_email']})\n" f"({task['assignee_email']})\n"
f"마감일: {task.get('due_date') or '-'}\n" f"마감일: {task.get('due_date') or '-'}\n"
@@ -1229,7 +1229,7 @@ def api_create_task(
_inbox( _inbox(
st, recipients=[task["assignee_email"]], actor=user["email"], st, recipients=[task["assignee_email"]], actor=user["email"],
project_id=project_id, task_id=task["id"], ntype="assigned", project_id=project_id, task_id=task["id"], ntype="assigned",
title=f"업무 배정: {task['title']}", title=f"작업 배정: {task['title']}",
body=f"{project['name']} · 마감 {task.get('due_date') or '-'}", body=f"{project['name']} · 마감 {task.get('due_date') or '-'}",
) )
_record_mentions( _record_mentions(
@@ -1251,7 +1251,7 @@ def api_update_task(
st = _db_or_503(request) st = _db_or_503(request)
existing = st.get_task(task_id=task_id) existing = st.get_task(task_id=task_id)
if existing is None: if existing is None:
raise HTTPException(status_code=404, detail="업무를 찾을 수 없습니다.") raise HTTPException(status_code=404, detail="작업을 찾을 수 없습니다.")
_require_manage(request, st, user, existing["project_id"]) _require_manage(request, st, user, existing["project_id"])
if "description" in payload: if "description" in payload:
payload["description"] = store.sanitize_description_html(payload["description"]) payload["description"] = store.sanitize_description_html(payload["description"])
@@ -1260,7 +1260,7 @@ def api_update_task(
except ValueError as exc: except ValueError as exc:
raise HTTPException(status_code=400, detail=str(exc)) raise HTTPException(status_code=400, detail=str(exc))
except KeyError: except KeyError:
raise HTTPException(status_code=404, detail="업무를 찾을 수 없습니다.") raise HTTPException(status_code=404, detail="작업을 찾을 수 없습니다.")
project_name = task.get("project_name") or "" project_name = task.get("project_name") or ""
project = st.get_project(project_id=existing["project_id"]) or {"id": existing["project_id"], "name": project_name} project = st.get_project(project_id=existing["project_id"]) or {"id": existing["project_id"], "name": project_name}
@@ -1275,7 +1275,7 @@ def api_update_task(
), ),
body=( body=(
f"프로젝트: {project_name}\n" f"프로젝트: {project_name}\n"
f"업무: {task['title']}\n" f"작업: {task['title']}\n"
f"담당자: {task.get('assignee_name') or task['_newly_assigned']} " f"담당자: {task.get('assignee_name') or task['_newly_assigned']} "
f"({task['_newly_assigned']})\n" f"({task['_newly_assigned']})\n"
f"마감일: {task.get('due_date') or '-'}\n" f"마감일: {task.get('due_date') or '-'}\n"
@@ -1285,7 +1285,7 @@ def api_update_task(
_inbox( _inbox(
st, recipients=[task["_newly_assigned"]], actor=user["email"], st, recipients=[task["_newly_assigned"]], actor=user["email"],
project_id=existing["project_id"], task_id=task_id, ntype="assigned", project_id=existing["project_id"], task_id=task_id, ntype="assigned",
title=f"업무 배정: {task['title']}", title=f"작업 배정: {task['title']}",
body=f"{project_name} · 마감 {task.get('due_date') or '-'}", body=f"{project_name} · 마감 {task.get('due_date') or '-'}",
) )
if task.get("_newly_completed"): if task.get("_newly_completed"):
@@ -1296,7 +1296,7 @@ def api_update_task(
), ),
body=( body=(
f"프로젝트: {project_name}\n" f"프로젝트: {project_name}\n"
f"완료된 업무: {task['title']}\n" f"완료된 작업: {task['title']}\n"
f"담당자: {task.get('assignee_name') or task.get('assignee_email') or '-'}\n" f"담당자: {task.get('assignee_name') or task.get('assignee_email') or '-'}\n"
f"완료 처리: {user['email']}\n" f"완료 처리: {user['email']}\n"
), ),
@@ -1304,7 +1304,7 @@ def api_update_task(
_inbox( _inbox(
st, recipients=_task_recipients(st, project, task, exclude=user["email"]), st, recipients=_task_recipients(st, project, task, exclude=user["email"]),
actor=user["email"], project_id=existing["project_id"], task_id=task_id, actor=user["email"], project_id=existing["project_id"], task_id=task_id,
ntype="completed", title=f"업무 완료: {task['title']}", body=project_name, ntype="completed", title=f"작업 완료: {task['title']}", body=project_name,
) )
if "description" in payload: if "description" in payload:
_record_mentions( _record_mentions(
@@ -1321,13 +1321,13 @@ def api_delete_task(request: Request, task_id: int) -> JSONResponse:
st = _db_or_503(request) st = _db_or_503(request)
existing = st.get_task(task_id=task_id) existing = st.get_task(task_id=task_id)
if existing is None: if existing is None:
raise HTTPException(status_code=404, detail="업무를 찾을 수 없습니다.") raise HTTPException(status_code=404, detail="작업을 찾을 수 없습니다.")
if not _can_delete(user, existing.get("created_by")): if not _can_delete(user, existing.get("created_by")):
raise HTTPException(status_code=403, detail=_DELETE_DENIED) raise HTTPException(status_code=403, detail=_DELETE_DENIED)
try: try:
removed_task_ids, trash_id = st.delete_task(task_id=task_id, deleted_by=user["email"]) removed_task_ids, trash_id = st.delete_task(task_id=task_id, deleted_by=user["email"])
except KeyError: except KeyError:
raise HTTPException(status_code=404, detail="업무를 찾을 수 없습니다.") raise HTTPException(status_code=404, detail="작업을 찾을 수 없습니다.")
# 휴지통(010)이 있으면 첨부 폴더도 휴지통으로(복구 대비), 없으면 예전처럼 삭제. # 휴지통(010)이 있으면 첨부 폴더도 휴지통으로(복구 대비), 없으면 예전처럼 삭제.
if trash_id is not None: if trash_id is not None:
_move_task_dirs_to_trash(request, removed_task_ids, trash_id) _move_task_dirs_to_trash(request, removed_task_ids, trash_id)
@@ -1344,7 +1344,7 @@ def api_get_task(request: Request, task_id: int) -> JSONResponse:
st = _db_or_503(request) st = _db_or_503(request)
task = st.get_task(task_id=task_id) task = st.get_task(task_id=task_id)
if task is None: if task is None:
raise HTTPException(status_code=404, detail="업무를 찾을 수 없습니다.") raise HTTPException(status_code=404, detail="작업을 찾을 수 없습니다.")
_require_manage(request, st, user, task["project_id"]) _require_manage(request, st, user, task["project_id"])
# 하위 업무를 팝업으로 열면 제목 위에 상위 업무 경로를 보여준다(아사나식). # 하위 업무를 팝업으로 열면 제목 위에 상위 업무 경로를 보여준다(아사나식).
if task.get("parent_task_id"): if task.get("parent_task_id"):
@@ -1373,7 +1373,7 @@ def api_move_subtask(
st = _db_or_503(request) st = _db_or_503(request)
existing = st.get_task(task_id=task_id) existing = st.get_task(task_id=task_id)
if existing is None: if existing is None:
raise HTTPException(status_code=404, detail="업무를 찾을 수 없습니다.") raise HTTPException(status_code=404, detail="작업을 찾을 수 없습니다.")
_require_manage(request, st, user, existing["project_id"]) _require_manage(request, st, user, existing["project_id"])
try: try:
parent_id = int(payload.get("parent_task_id")) parent_id = int(payload.get("parent_task_id"))
@@ -1394,7 +1394,7 @@ def api_move_subtask(
def _task_for_followers(request: Request, st: Any, user: dict[str, Any], task_id: int) -> dict[str, Any]: def _task_for_followers(request: Request, st: Any, user: dict[str, Any], task_id: int) -> dict[str, Any]:
task = st.get_task(task_id=task_id) task = st.get_task(task_id=task_id)
if task is None: if task is None:
raise HTTPException(status_code=404, detail="업무를 찾을 수 없습니다.") raise HTTPException(status_code=404, detail="작업을 찾을 수 없습니다.")
_require_manage(request, st, user, task["project_id"]) _require_manage(request, st, user, task["project_id"])
return task return task
@@ -1403,7 +1403,7 @@ def _followers_response(st: Any, task_id: int) -> JSONResponse:
try: try:
return JSONResponse({"followers": st.list_followers(task_id=task_id)}) return JSONResponse({"followers": st.list_followers(task_id=task_id)})
except Exception: # noqa: BLE001 except Exception: # noqa: BLE001
raise HTTPException(status_code=503, detail="팔로워 기능은 project_db_008 마이그레이션 후 사용할 수 있습니다.") raise HTTPException(status_code=503, detail="협업자 기능은 project_db_008 마이그레이션 후 사용할 수 있습니다.")
@router.get("/api/tasks/{task_id}/followers") @router.get("/api/tasks/{task_id}/followers")
@@ -1434,11 +1434,11 @@ def api_add_follower(
project_id=task["project_id"], user_email=email project_id=task["project_id"], user_email=email
) )
if not allowed: if not allowed:
raise HTTPException(status_code=400, detail="이 프로젝트 멤버만 팔로워로 추가할 수 있습니다.") raise HTTPException(status_code=400, detail="이 프로젝트 멤버만 협업자로 추가할 수 있습니다.")
try: try:
st.add_followers(task_id=task_id, emails=[email]) st.add_followers(task_id=task_id, emails=[email])
except Exception: # noqa: BLE001 except Exception: # noqa: BLE001
raise HTTPException(status_code=503, detail="팔로워 기능은 project_db_008 마이그레이션 후 사용할 수 있습니다.") raise HTTPException(status_code=503, detail="협업자 기능은 project_db_008 마이그레이션 후 사용할 수 있습니다.")
return _followers_response(st, task_id) return _followers_response(st, task_id)
@@ -1450,7 +1450,7 @@ def api_remove_follower(request: Request, task_id: int, email: str) -> JSONRespo
try: try:
st.remove_follower(task_id=task_id, user_email=email) st.remove_follower(task_id=task_id, user_email=email)
except Exception: # noqa: BLE001 except Exception: # noqa: BLE001
raise HTTPException(status_code=503, detail="팔로워 기능은 project_db_008 마이그레이션 후 사용할 수 있습니다.") raise HTTPException(status_code=503, detail="협업자 기능은 project_db_008 마이그레이션 후 사용할 수 있습니다.")
return _followers_response(st, task_id) return _followers_response(st, task_id)
@@ -1524,13 +1524,13 @@ def api_add_task_link(
st = _db_or_503(request) st = _db_or_503(request)
task = st.get_task(task_id=task_id) task = st.get_task(task_id=task_id)
if task is None: if task is None:
raise HTTPException(status_code=404, detail="업무를 찾을 수 없습니다.") raise HTTPException(status_code=404, detail="작업을 찾을 수 없습니다.")
try: try:
target_project_id = int(payload.get("project_id")) target_project_id = int(payload.get("project_id"))
except (TypeError, ValueError): except (TypeError, ValueError):
raise HTTPException(status_code=400, detail="project_id 가 필요합니다.") raise HTTPException(status_code=400, detail="project_id 가 필요합니다.")
if target_project_id == task["project_id"]: if target_project_id == task["project_id"]:
raise HTTPException(status_code=400, detail="이미 이 업무의 기본 프로젝트입니다.") raise HTTPException(status_code=400, detail="이미 이 작업의 기본 프로젝트입니다.")
_require_manage(request, st, user, target_project_id) _require_manage(request, st, user, target_project_id)
already_linked = any( already_linked = any(
link["project_id"] == target_project_id for link in st.list_task_links(task_id=task_id) link["project_id"] == target_project_id for link in st.list_task_links(task_id=task_id)
@@ -1556,7 +1556,7 @@ def api_remove_task_link(request: Request, task_id: int, project_id: int) -> JSO
st = _db_or_503(request) st = _db_or_503(request)
task = st.get_task(task_id=task_id) task = st.get_task(task_id=task_id)
if task is None: if task is None:
raise HTTPException(status_code=404, detail="업무를 찾을 수 없습니다.") raise HTTPException(status_code=404, detail="작업을 찾을 수 없습니다.")
_require_manage(request, st, user, task["project_id"]) _require_manage(request, st, user, task["project_id"])
_require_manage(request, st, user, project_id) _require_manage(request, st, user, project_id)
st.remove_task_link(task_id=task_id, project_id=project_id) st.remove_task_link(task_id=task_id, project_id=project_id)
@@ -1580,7 +1580,7 @@ def api_list_comments(request: Request, task_id: int) -> JSONResponse:
st = _db_or_503(request) st = _db_or_503(request)
task = st.get_task(task_id=task_id) task = st.get_task(task_id=task_id)
if task is None: if task is None:
raise HTTPException(status_code=404, detail="업무를 찾을 수 없습니다.") raise HTTPException(status_code=404, detail="작업을 찾을 수 없습니다.")
_require_manage(request, st, user, task["project_id"]) _require_manage(request, st, user, task["project_id"])
return JSONResponse({"comments": st.list_comments(task_id=task_id)}) return JSONResponse({"comments": st.list_comments(task_id=task_id)})
@@ -1593,7 +1593,7 @@ def api_add_comment(
st = _db_or_503(request) st = _db_or_503(request)
task = st.get_task(task_id=task_id) task = st.get_task(task_id=task_id)
if task is None: if task is None:
raise HTTPException(status_code=404, detail="업무를 찾을 수 없습니다.") raise HTTPException(status_code=404, detail="작업을 찾을 수 없습니다.")
_require_manage(request, st, user, task["project_id"]) _require_manage(request, st, user, task["project_id"])
try: try:
comment = st.add_comment( comment = st.add_comment(
@@ -1684,7 +1684,7 @@ def api_list_attachments(request: Request, task_id: int) -> JSONResponse:
st = _db_or_503(request) st = _db_or_503(request)
task = st.get_task(task_id=task_id) task = st.get_task(task_id=task_id)
if task is None: if task is None:
raise HTTPException(status_code=404, detail="업무를 찾을 수 없습니다.") raise HTTPException(status_code=404, detail="작업을 찾을 수 없습니다.")
_require_manage(request, st, user, task["project_id"]) _require_manage(request, st, user, task["project_id"])
return JSONResponse({"attachments": st.list_attachments(task_id=task_id)}) return JSONResponse({"attachments": st.list_attachments(task_id=task_id)})
@@ -1700,7 +1700,7 @@ def api_upload_attachment(
st = _db_or_503(request) st = _db_or_503(request)
task = st.get_task(task_id=task_id) task = st.get_task(task_id=task_id)
if task is None: if task is None:
raise HTTPException(status_code=404, detail="업무를 찾을 수 없습니다.") raise HTTPException(status_code=404, detail="작업을 찾을 수 없습니다.")
_require_manage(request, st, user, task["project_id"]) _require_manage(request, st, user, task["project_id"])
if comment_id is not None: if comment_id is not None:
comment = st.get_comment(comment_id=comment_id) comment = st.get_comment(comment_id=comment_id)
@@ -1735,10 +1735,10 @@ def api_download_attachment(request: Request, attachment_id: int):
st = _db_or_503(request) st = _db_or_503(request)
att = st.get_attachment(attachment_id=attachment_id) att = st.get_attachment(attachment_id=attachment_id)
if att is None: if att is None:
raise HTTPException(status_code=404, detail="첨부를 찾을 수 없습니다.") raise HTTPException(status_code=404, detail="첨부 파일을 찾을 수 없습니다.")
task = st.get_task(task_id=att["task_id"]) task = st.get_task(task_id=att["task_id"])
if task is None: if task is None:
raise HTTPException(status_code=404, detail="업무를 찾을 수 없습니다.") raise HTTPException(status_code=404, detail="작업을 찾을 수 없습니다.")
_require_manage(request, st, user, task["project_id"]) _require_manage(request, st, user, task["project_id"])
path = _attach_dir(request, att["task_id"]) / att["stored_name"] path = _attach_dir(request, att["task_id"]) / att["stored_name"]
if not path.exists(): if not path.exists():
@@ -1760,10 +1760,10 @@ def api_inline_attachment(request: Request, attachment_id: int):
st = _db_or_503(request) st = _db_or_503(request)
att = st.get_attachment(attachment_id=attachment_id) att = st.get_attachment(attachment_id=attachment_id)
if att is None: if att is None:
raise HTTPException(status_code=404, detail="첨부를 찾을 수 없습니다.") raise HTTPException(status_code=404, detail="첨부 파일을 찾을 수 없습니다.")
task = st.get_task(task_id=att["task_id"]) task = st.get_task(task_id=att["task_id"])
if task is None: if task is None:
raise HTTPException(status_code=404, detail="업무를 찾을 수 없습니다.") raise HTTPException(status_code=404, detail="작업을 찾을 수 없습니다.")
_require_manage(request, st, user, task["project_id"]) _require_manage(request, st, user, task["project_id"])
path = _attach_dir(request, att["task_id"]) / att["stored_name"] path = _attach_dir(request, att["task_id"]) / att["stored_name"]
if not path.exists(): if not path.exists():
@@ -1786,7 +1786,7 @@ def api_delete_attachment(request: Request, attachment_id: int) -> JSONResponse:
st = _db_or_503(request) st = _db_or_503(request)
att = st.get_attachment(attachment_id=attachment_id) att = st.get_attachment(attachment_id=attachment_id)
if att is None: if att is None:
raise HTTPException(status_code=404, detail="첨부를 찾을 수 없습니다.") raise HTTPException(status_code=404, detail="첨부 파일을 찾을 수 없습니다.")
task = st.get_task(task_id=att["task_id"]) task = st.get_task(task_id=att["task_id"])
if task is not None: if task is not None:
_require_manage(request, st, user, task["project_id"]) _require_manage(request, st, user, task["project_id"])
@@ -1975,7 +1975,7 @@ def trash_page(request: Request) -> HTMLResponse:
"my_open_total": st.count_my_open(assignee_email=user["email"]), "my_open_total": st.count_my_open(assignee_email=user["email"]),
"mention_unread": _safe_mention_unread(st, user["email"]), "mention_unread": _safe_mention_unread(st, user["email"]),
"page_title": "휴지통", "page_title": "휴지통",
"page_subtitle": "삭제한 업무 — 3개월 보관, 관리자만 복구", "page_subtitle": "삭제한 작업 — 3개월 보관, 관리자만 복구",
"force_sidebar_collapsed": True, "force_sidebar_collapsed": True,
"color_palette": list(store.COLOR_PALETTE), "color_palette": list(store.COLOR_PALETTE),
"trash_enabled": enabled, "trash_enabled": enabled,
@@ -2046,7 +2046,7 @@ def inbox_page(request: Request) -> HTMLResponse:
"nav_projects": nav_projects, "nav_projects": nav_projects,
"my_open_total": my_open_total, "my_open_total": my_open_total,
"page_title": "수신함", "page_title": "수신함",
"page_subtitle": "나를 태그한 업무와 프로젝트 알림", "page_subtitle": "나를 태그한 작업과 프로젝트 알림",
"force_sidebar_collapsed": True, "force_sidebar_collapsed": True,
"color_palette": list(store.COLOR_PALETTE), "color_palette": list(store.COLOR_PALETTE),
"notifications": items, "notifications": items,
+4 -4
View File
@@ -178,9 +178,9 @@ def validate_project_name(name: Any) -> str:
def validate_task_title(title: Any) -> str: def validate_task_title(title: Any) -> str:
v = norm_str(title) v = norm_str(title)
if not v: if not v:
raise ValueError("업무 제목은 필수입니다.") raise ValueError("작업 제목은 필수입니다.")
if len(v) > 300: if len(v) > 300:
raise ValueError("업무 제목이 너무 깁니다(300자 이내).") raise ValueError("작업 제목이 너무 깁니다(300자 이내).")
return v return v
@@ -235,11 +235,11 @@ def validate_time(t: Any) -> str | None:
def build_subject_assigned(*, project_name: str, task_title: str, assignee: str) -> str: def build_subject_assigned(*, project_name: str, task_title: str, assignee: str) -> str:
return f"[DBX 프로젝트] 업무 배정: {project_name} · {task_title} → {assignee}" return f"[DBX 프로젝트] 작업 배정: {project_name} · {task_title} → {assignee}"
def build_subject_completed(*, project_name: str, task_title: str) -> str: def build_subject_completed(*, project_name: str, task_title: str) -> str:
return f"[DBX 프로젝트] 업무 완료: {project_name} · {task_title}" return f"[DBX 프로젝트] 작업 완료: {project_name} · {task_title}"
def build_subject_project_done(*, project_name: str) -> str: def build_subject_project_done(*, project_name: str) -> str:
@@ -2,12 +2,12 @@
project.js initMemberTasks() 가 배선. project/mytasks/inbox 공용. #} project.js initMemberTasks() 가 배선. project/mytasks/inbox 공용. #}
<div class="pj-modal" id="pj-modal-member-tasks" hidden> <div class="pj-modal" id="pj-modal-member-tasks" hidden>
<div class="pj-modal-card pj-mt-card"> <div class="pj-modal-card pj-mt-card">
<h3 id="pj-mt-title">업무</h3> <h3 id="pj-mt-title">작업</h3>
<p class="pj-modal-hint">더블클릭하면 업무 편집 창이 열립니다.</p> <p class="pj-modal-hint">더블클릭하면 작업 편집 창이 열립니다.</p>
<div class="pj-mt-head" id="pj-mt-head"> <div class="pj-mt-head" id="pj-mt-head">
<span class="pj-mt-h" data-sort="project">프로젝트<span class="pj-mt-sort-icon"></span></span> <span class="pj-mt-h" data-sort="project">프로젝트<span class="pj-mt-sort-icon"></span></span>
<span class="pj-mt-h" data-sort="stage">세션<span class="pj-mt-sort-icon"></span></span> <span class="pj-mt-h" data-sort="stage">섹션<span class="pj-mt-sort-icon"></span></span>
<span class="pj-mt-h" data-sort="title">업무<span class="pj-mt-sort-icon"></span></span> <span class="pj-mt-h" data-sort="title">작업<span class="pj-mt-sort-icon"></span></span>
<span class="pj-mt-h" data-sort="due">마감일<span class="pj-mt-sort-icon"></span></span> <span class="pj-mt-h" data-sort="due">마감일<span class="pj-mt-sort-icon"></span></span>
</div> </div>
<ul class="pj-mt-list" id="pj-mt-list"></ul> <ul class="pj-mt-list" id="pj-mt-list"></ul>
@@ -18,7 +18,7 @@
결과를 누르면 그 업무 팝업(/project/t/{id})으로. 어디서든 "/" 키로 포커스. --> 결과를 누르면 그 업무 팝업(/project/t/{id})으로. 어디서든 "/" 키로 포커스. -->
<div class="pj-side-search"> <div class="pj-side-search">
<span class="material-symbols-outlined pj-side-search-ic">search</span> <span class="material-symbols-outlined pj-side-search-ic">search</span>
<input type="search" id="pj-global-search" placeholder="전체 검색 ( / )" autocomplete="off" aria-label="업무 전체 검색" /> <input type="search" id="pj-global-search" placeholder="전체 검색 ( / )" autocomplete="off" aria-label="작업 전체 검색" />
<div class="pj-search-results" id="pj-search-results" hidden></div> <div class="pj-search-results" id="pj-search-results" hidden></div>
</div> </div>
<!-- 아사나처럼 맨 위에 개인 메뉴(수신함 / 내 업무). 내 업무는 접었다 펴는 <!-- 아사나처럼 맨 위에 개인 메뉴(수신함 / 내 업무). 내 업무는 접었다 펴는
@@ -32,7 +32,7 @@
</a> </a>
<a class="pj-side-navlink {% if side_active == 'mytasks' %}is-active{% endif %}" href="/project/"> <a class="pj-side-navlink {% if side_active == 'mytasks' %}is-active{% endif %}" href="/project/">
<span class="material-symbols-outlined pj-side-navic">checklist</span> <span class="material-symbols-outlined pj-side-navic">checklist</span>
<span class="pj-side-navtext">내 업무</span> <span class="pj-side-navtext">내 작업</span>
<span class="pj-side-navbadge pj-side-navbadge-open" id="pj-myopen-badge" <span class="pj-side-navbadge pj-side-navbadge-open" id="pj-myopen-badge"
{% if not my_open_total %}hidden{% endif %}>{{ my_open_total }}</span> {% if not my_open_total %}hidden{% endif %}>{{ my_open_total }}</span>
</a> </a>
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %} {% extends "erp_base.html" %}
{% block head_extra %} {% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260925e" /> <link rel="stylesheet" href="/static/project.css?v=20260925f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" /> <link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %} {% endblock %}
@@ -27,12 +27,12 @@
(?task= 파라미터 — project.js 가 처리). --> (?task= 파라미터 — project.js 가 처리). -->
<div class="pj-inbox-section"> <div class="pj-inbox-section">
<h3 class="pj-inbox-h3"> <h3 class="pj-inbox-h3">
나를 태그한 업무 나를 태그한 작업
<span class="pj-inbox-count" id="pj-mention-unread" <span class="pj-inbox-count" id="pj-mention-unread"
{% if not mention_unread %}hidden{% endif %}>{{ mention_unread }}</span> {% if not mention_unread %}hidden{% endif %}>{{ mention_unread }}</span>
</h3> </h3>
{% if not mentioned_tasks %} {% if not mentioned_tasks %}
<div class="pj-empty">태그된 업무가 없습니다.</div> <div class="pj-empty">태그된 작업이 없습니다.</div>
{% else %} {% else %}
<ul class="pj-inbox pj-mention-list" id="pj-mention-tasks"> <ul class="pj-inbox pj-mention-list" id="pj-mention-tasks">
{% for t in mentioned_tasks %} {% for t in mentioned_tasks %}
@@ -99,5 +99,5 @@
{% include "project/_side_modals.html" %} {% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %} {% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20260925e" defer></script> <script src="/static/project.js?v=20260925f" defer></script>
{% endblock %} {% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %} {% extends "erp_base.html" %}
{% block head_extra %} {% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260925e" /> <link rel="stylesheet" href="/static/project.css?v=20260925f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" /> <link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %} {% endblock %}
@@ -29,7 +29,7 @@
</div> </div>
<div class="pj-title-wrap"> <div class="pj-title-wrap">
<h1 class="pj-project-title"> <h1 class="pj-project-title">
<span class="pj-project-title-pill" style="--pj-color: #7b68ee">내 업무</span> <span class="pj-project-title-pill" style="--pj-color: #7b68ee">내 작업</span>
</h1> </h1>
</div> </div>
<div class="pj-mytasks-summary" id="pj-mytasks-summary"></div> <div class="pj-mytasks-summary" id="pj-mytasks-summary"></div>
@@ -38,7 +38,7 @@
<div class="pj-filterbar" id="pj-mt-filterbar"> <div class="pj-filterbar" id="pj-mt-filterbar">
<label class="pj-fb-search"> <label class="pj-fb-search">
<span class="material-symbols-outlined">filter_list</span> <span class="material-symbols-outlined">filter_list</span>
<input type="search" id="pj-mt-q" placeholder="내 업무에서 찾기 (제목·설명·프로젝트)" autocomplete="off" /> <input type="search" id="pj-mt-q" placeholder="내 작업에서 찾기 (제목·설명·프로젝트)" autocomplete="off" />
</label> </label>
<select id="pj-mt-due" class="pj-fb-select" title="마감일"> <select id="pj-mt-due" class="pj-fb-select" title="마감일">
<option value="all">마감: 전체</option> <option value="all">마감: 전체</option>
@@ -60,7 +60,7 @@
<thead></thead> <thead></thead>
<tbody></tbody> <tbody></tbody>
</table> </table>
<div class="pj-empty" id="pj-mytasks-empty" hidden>표시할 업무가 없습니다.</div> <div class="pj-empty" id="pj-mytasks-empty" hidden>표시할 작업이 없습니다.</div>
</div> </div>
</section> </section>
</div> </div>
@@ -98,5 +98,5 @@
"today": {{ today | tojson }} "today": {{ today | tojson }}
} }
</script> </script>
<script src="/static/project.js?v=20260925e" defer></script> <script src="/static/project.js?v=20260925f" defer></script>
{% endblock %} {% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %} {% extends "erp_base.html" %}
{% block head_extra %} {% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260925e" /> <link rel="stylesheet" href="/static/project.css?v=20260925f" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host --> <!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" /> <link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<!-- 타임라인 vis-timeline — self-host --> <!-- 타임라인 vis-timeline — self-host -->
@@ -9,12 +9,12 @@
{% endblock %} {% endblock %}
{% block topbar_actions %} {% block topbar_actions %}
<a class="pj-bell" href="/project/inbox" title="알림센터"> <a class="pj-bell" href="/project/inbox" title="수신함">
<span class="material-symbols-outlined">notifications</span> <span class="material-symbols-outlined">notifications</span>
<span class="pj-bell-badge" id="pj-bell-badge" hidden>0</span> <span class="pj-bell-badge" id="pj-bell-badge" hidden>0</span>
</a> </a>
{% if can_manage %} {% if can_manage %}
<button type="button" class="pj-btn pj-btn-primary" id="pj-new-task">+ 업무 추가</button> <button type="button" class="pj-btn pj-btn-primary" id="pj-new-task">+ 작업 추가</button>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
@@ -35,8 +35,8 @@
<div class="pj-toolbar"> <div class="pj-toolbar">
<div class="pj-view-tabs" id="pj-view-tabs"> <div class="pj-view-tabs" id="pj-view-tabs">
<button type="button" class="pj-tab is-active" data-view="board">보드</button> <button type="button" class="pj-tab is-active" data-view="board">보드</button>
<button type="button" class="pj-tab" data-view="list">리스트</button> <button type="button" class="pj-tab" data-view="list">목록</button>
<button type="button" class="pj-tab" data-view="calendar">달력</button> <button type="button" class="pj-tab" data-view="calendar">캘린더</button>
<button type="button" class="pj-tab" data-view="timeline">타임라인</button> <button type="button" class="pj-tab" data-view="timeline">타임라인</button>
<button type="button" class="pj-tab" data-view="dashboard">대시보드</button> <button type="button" class="pj-tab" data-view="dashboard">대시보드</button>
</div> </div>
@@ -166,7 +166,7 @@
위치)에 있어 항상 보인다. --> 위치)에 있어 항상 보인다. -->
<div class="pj-view" data-view="board"> <div class="pj-view" data-view="board">
<div class="pj-board-toolbar"> <div class="pj-board-toolbar">
<button type="button" class="pj-add-stage" id="pj-board-addstage" hidden>+ 세션 추가</button> <button type="button" class="pj-add-stage" id="pj-board-addstage" hidden>+ 섹션 추가</button>
</div> </div>
<div class="pj-board" id="pj-board"> <div class="pj-board" id="pj-board">
<div class="pj-board-canvas" id="pj-board-canvas"></div> <div class="pj-board-canvas" id="pj-board-canvas"></div>
@@ -180,7 +180,7 @@
<div class="pj-view" data-view="list" hidden> <div class="pj-view" data-view="list" hidden>
<table class="pj-table" id="pj-list"> <table class="pj-table" id="pj-list">
<thead> <thead>
<tr><th>업무</th><th>담당자</th><th>세션</th><th>우선순위</th><th>시작</th><th>마감</th></tr> <tr><th>작업</th><th>담당자</th><th>섹션</th><th>우선순위</th><th>시작</th><th>마감</th></tr>
</thead> </thead>
<tbody></tbody> <tbody></tbody>
</table> </table>
@@ -200,15 +200,15 @@
<!-- 세션 추가/편집 모달 — 보드의 "+ 세션 추가" 버튼과 세션 헤더의 ✎(세션 편집) 공용 --> <!-- 세션 추가/편집 모달 — 보드의 "+ 세션 추가" 버튼과 세션 헤더의 ✎(세션 편집) 공용 -->
<div class="pj-modal" id="pj-modal-stage" hidden> <div class="pj-modal" id="pj-modal-stage" hidden>
<div class="pj-modal-card"> <div class="pj-modal-card">
<h3 id="pj-stage-modal-title">새 세션</h3> <h3 id="pj-stage-modal-title">새 섹션</h3>
<input type="hidden" id="pj-stg-id" /> <input type="hidden" id="pj-stg-id" />
<label>이름<input type="text" id="pj-stg-name" placeholder="세션 이름" /></label> <label>이름<input type="text" id="pj-stg-name" placeholder="섹션 이름" /></label>
<label>색상 <label>색상
<span class="pj-color-palette" id="pj-stg-colors"></span> <span class="pj-color-palette" id="pj-stg-colors"></span>
</label> </label>
<div class="pj-field-label">기본 담당자 <div class="pj-field-label">기본 담당자
<div class="pj-member-picker" id="pj-stg-assignee"></div> <div class="pj-member-picker" id="pj-stg-assignee"></div>
<span class="pj-modal-hint pj-stg-assignee-hint">이 세션에 업무를 새로 만들거나 카드를 옮겨오면, 담당자가 비어 있는 업무만 이 사람에게 자동 배정됩니다.</span> <span class="pj-modal-hint pj-stg-assignee-hint">이 섹션에 작업을 새로 만들거나 카드를 옮겨오면, 담당자가 비어 있는 작업만 이 사람에게 자동 배정됩니다.</span>
</div> </div>
<div class="pj-modal-actions"> <div class="pj-modal-actions">
<span style="flex:1"></span> <span style="flex:1"></span>
@@ -229,7 +229,7 @@
<div class="pj-modal-actions pj-modal-actions-top"> <div class="pj-modal-actions pj-modal-actions-top">
<!-- 공유 — 이 업무의 퍼머링크(/project/t/{id})를 클립보드에 복사. <!-- 공유 — 이 업무의 퍼머링크(/project/t/{id})를 클립보드에 복사.
받은 사람이 열면 로그인 후 이 업무 팝업이 바로 뜬다(멤버만). --> 받은 사람이 열면 로그인 후 이 업무 팝업이 바로 뜬다(멤버만). -->
<button type="button" class="pj-btn pj-btn-share" id="pj-share-task" hidden title="이 업무 링크 복사"> <button type="button" class="pj-btn pj-btn-share" id="pj-share-task" hidden title="이 작업 링크 복사">
<span class="material-symbols-outlined">link</span> 공유 <span class="material-symbols-outlined">link</span> 공유
</button> </button>
<button type="button" class="pj-btn pj-btn-complete" id="pj-toggle-complete" hidden>✓ 완료로 표시</button> <button type="button" class="pj-btn pj-btn-complete" id="pj-toggle-complete" hidden>✓ 완료로 표시</button>
@@ -246,11 +246,11 @@
없앴다 — 버튼 줄 바로 아래 공간을 아낀다). --> 없앴다 — 버튼 줄 바로 아래 공간을 아낀다). -->
<input type="hidden" id="pj-t-id" /> <input type="hidden" id="pj-t-id" />
<!-- 하위 업무를 열었을 때만 — 아사나처럼 제목 위에 상위 업무 경로. 누르면 상위 업무로. --> <!-- 하위 업무를 열었을 때만 — 아사나처럼 제목 위에 상위 업무 경로. 누르면 상위 업무로. -->
<button type="button" class="pj-t-parent" id="pj-t-parent" hidden title="상위 업무 열기"> <button type="button" class="pj-t-parent" id="pj-t-parent" hidden title="상위 작업 열기">
<span class="material-symbols-outlined">subdirectory_arrow_left</span> <span class="material-symbols-outlined">subdirectory_arrow_left</span>
<span class="pj-t-parent-title" id="pj-t-parent-title"></span> <span class="pj-t-parent-title" id="pj-t-parent-title"></span>
</button> </button>
<input type="text" id="pj-t-title" class="pj-t-title-input" placeholder="업무 제목" /> <input type="text" id="pj-t-title" class="pj-t-title-input" placeholder="작업 제목" />
<div class="pj-modal-body"> <div class="pj-modal-body">
<div class="pj-modal-col-main"> <div class="pj-modal-col-main">
@@ -274,7 +274,7 @@
</select> </select>
</div> </div>
<div class="pj-meta-cell pj-meta-cell-stage"> <div class="pj-meta-cell pj-meta-cell-stage">
<span class="pj-meta-cell-label">세션</span> <span class="pj-meta-cell-label">섹션</span>
<select id="pj-t-stage"> <select id="pj-t-stage">
{% for s in stages %} {% for s in stages %}
<option value="{{ s.id }}">{{ s.name }}</option> <option value="{{ s.id }}">{{ s.name }}</option>
@@ -302,11 +302,11 @@
댓글 단 사람·@태그된 사람은 자동으로 들어온다. 저장 버튼과 무관하게 즉시 반영. 댓글 단 사람·@태그된 사람은 자동으로 들어온다. 저장 버튼과 무관하게 즉시 반영.
기존 업무에서만, 008 마이그레이션이 있어야 보인다. --> 기존 업무에서만, 008 마이그레이션이 있어야 보인다. -->
<div class="pj-meta-row2" id="pj-followers-row" hidden> <div class="pj-meta-row2" id="pj-followers-row" hidden>
<span class="pj-meta-label2">팔로워</span> <span class="pj-meta-label2">협업자</span>
<span class="pj-meta-value2 pj-followers"> <span class="pj-meta-value2 pj-followers">
<span class="material-symbols-outlined pj-meta-ic">group</span> <span class="material-symbols-outlined pj-meta-ic">group</span>
<span class="pj-follower-chips" id="pj-follower-chips"></span> <span class="pj-follower-chips" id="pj-follower-chips"></span>
<button type="button" class="pj-follower-add" id="pj-follower-add" title="팔로워 추가">+</button> <button type="button" class="pj-follower-add" id="pj-follower-add" title="협업자 추가">+</button>
<button type="button" class="pj-follow-toggle" id="pj-follow-toggle">팔로우</button> <button type="button" class="pj-follow-toggle" id="pj-follow-toggle">팔로우</button>
</span> </span>
</div> </div>
@@ -342,12 +342,12 @@
기존 업무 편집 시에만. --> 기존 업무 편집 시에만. -->
<div class="pj-task-extra pj-subtask-full" id="pj-subtask-block" hidden> <div class="pj-task-extra pj-subtask-full" id="pj-subtask-block" hidden>
<div class="pj-extra-head"> <div class="pj-extra-head">
<span class="material-symbols-outlined pj-gicon pj-gicon-sm">checklist</span> 하위 업무 <span class="material-symbols-outlined pj-gicon pj-gicon-sm">checklist</span> 하위 작업
</div> </div>
<ul class="pj-subtask-list" id="pj-subtask-list"></ul> <ul class="pj-subtask-list" id="pj-subtask-list"></ul>
<div class="pj-subtask-form"> <div class="pj-subtask-form">
<input type="text" id="pj-subtask-input" placeholder="하위 업무 제목…" /> <input type="text" id="pj-subtask-input" placeholder="하위 작업 제목…" />
<select id="pj-subtask-add-assignee"><option value="">(미지정)</option></select> <select id="pj-subtask-add-assignee"><option value="">담당자 없음</option></select>
<input type="date" id="pj-subtask-add-due" /> <input type="date" id="pj-subtask-add-due" />
<button type="button" class="pj-btn pj-btn-primary" id="pj-subtask-add">추가</button> <button type="button" class="pj-btn pj-btn-primary" id="pj-subtask-add">추가</button>
</div> </div>
@@ -358,7 +358,7 @@
<div class="pj-side-2col"> <div class="pj-side-2col">
<div class="pj-task-extra" id="pj-attach-block" hidden> <div class="pj-task-extra" id="pj-attach-block" hidden>
<div class="pj-extra-head"> <div class="pj-extra-head">
<span class="material-symbols-outlined pj-gicon pj-gicon-sm">attach_file</span> 첨부파일 <span class="material-symbols-outlined pj-gicon pj-gicon-sm">attach_file</span> 첨부 파일
<label class="pj-upload-btn"> <label class="pj-upload-btn">
파일 추가<input type="file" id="pj-attach-input" hidden /> 파일 추가<input type="file" id="pj-attach-input" hidden />
</label> </label>
@@ -369,13 +369,13 @@
<!-- 연결된 프로젝트 — 멀티호밍(아사나식). --> <!-- 연결된 프로젝트 — 멀티호밍(아사나식). -->
<div class="pj-task-extra" id="pj-links-block" hidden> <div class="pj-task-extra" id="pj-links-block" hidden>
<div class="pj-extra-head"> <div class="pj-extra-head">
<span class="material-symbols-outlined pj-gicon pj-gicon-sm">link</span> 연결된 프로젝트 <span class="material-symbols-outlined pj-gicon pj-gicon-sm">link</span> 프로젝트
</div> </div>
<div class="pj-link-chips" id="pj-link-chips"></div> <div class="pj-link-chips" id="pj-link-chips"></div>
<div class="pj-link-form" id="pj-link-form"> <div class="pj-link-form" id="pj-link-form">
<select id="pj-link-project"><option value="">프로젝트 선택…</option></select> <select id="pj-link-project"><option value="">프로젝트 선택…</option></select>
<select id="pj-link-stage"><option value="">세션 선택…</option></select> <select id="pj-link-stage"><option value="">섹션 선택…</option></select>
<button type="button" class="pj-btn pj-btn-primary" id="pj-link-save">추가</button> <button type="button" class="pj-btn pj-btn-primary" id="pj-link-save">다른 프로젝트에 추가</button>
</div> </div>
</div> </div>
</div> </div>
@@ -410,7 +410,7 @@
<label>역할 <label>역할
<select id="pj-m-role"> <select id="pj-m-role">
<option value="member" selected>멤버</option> <option value="member" selected>멤버</option>
<option value="manager">관리(서브·업무 관리)</option> <option value="manager">관리(서브·작업 관리)</option>
</select> </select>
</label> </label>
<div class="pj-modal-actions"> <div class="pj-modal-actions">
@@ -465,5 +465,5 @@
</script> </script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script> <script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20260925e" defer></script> <script src="/static/project.js?v=20260925f" defer></script>
{% endblock %} {% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %} {% extends "erp_base.html" %}
{% block head_extra %} {% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260925e" /> <link rel="stylesheet" href="/static/project.css?v=20260925f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" /> <link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %} {% endblock %}
@@ -15,7 +15,7 @@
<section class="pj-main"> <section class="pj-main">
<div class="pj-section-head"> <div class="pj-section-head">
<h2>휴지통</h2> <h2>휴지통</h2>
<span class="pj-trash-note">삭제한 업무는 3개월 동안 보관된 뒤 영구 삭제됩니다. 복구는 관리자만 할 수 있습니다.</span> <span class="pj-trash-note">삭제한 작업은 3개월 동안 보관된 뒤 영구 삭제됩니다. 복구는 관리자만 할 수 있습니다.</span>
</div> </div>
<div class="pj-view pj-inbox-pane"> <div class="pj-view pj-inbox-pane">
{% if not trash_enabled %} {% if not trash_enabled %}
@@ -28,7 +28,7 @@
<table class="pj-table pj-trash-table" id="pj-trash-table"> <table class="pj-table pj-trash-table" id="pj-trash-table">
<thead> <thead>
<tr> <tr>
<th>업무</th> <th>작업</th>
<th>프로젝트</th> <th>프로젝트</th>
<th>포함</th> <th>포함</th>
<th>삭제한 사람</th> <th>삭제한 사람</th>
@@ -43,7 +43,7 @@
<td class="pj-trash-title">{{ it.title }}</td> <td class="pj-trash-title">{{ it.title }}</td>
<td>{{ it.project_name or '-' }}</td> <td>{{ it.project_name or '-' }}</td>
<td class="pj-trash-meta"> <td class="pj-trash-meta">
{% if it.task_count > 1 %}하위 업무 {{ it.task_count - 1 }}{% endif %} {% if it.task_count > 1 %}하위 작업 {{ it.task_count - 1 }}{% endif %}
{% if it.comment_count %}{% if it.task_count > 1 %} · {% endif %}댓글 {{ it.comment_count }}{% endif %} {% if it.comment_count %}{% if it.task_count > 1 %} · {% endif %}댓글 {{ it.comment_count }}{% endif %}
{% if it.attachment_count %} · 첨부 {{ it.attachment_count }}{% endif %} {% if it.attachment_count %} · 첨부 {{ it.attachment_count }}{% endif %}
{% if it.task_count <= 1 and not it.comment_count and not it.attachment_count %}-{% endif %} {% if it.task_count <= 1 and not it.comment_count and not it.attachment_count %}-{% endif %}
@@ -68,5 +68,5 @@
{% include "project/_side_modals.html" %} {% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %} {% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20260925e" defer></script> <script src="/static/project.js?v=20260925f" defer></script>
{% endblock %} {% endblock %}
+57 -57
View File
@@ -165,7 +165,7 @@
// 업무 퍼머링크(/project/t/{id})를 클립보드로. 우클릭 메뉴/공유 버튼 공용. // 업무 퍼머링크(/project/t/{id})를 클립보드로. 우클릭 메뉴/공유 버튼 공용.
async function shareTaskLink(taskId) { async function shareTaskLink(taskId) {
const url = location.origin + "/project/t/" + taskId; const url = location.origin + "/project/t/" + taskId;
if (await copyToClipboard(url)) showToast("업무 링크를 복사했습니다."); if (await copyToClipboard(url)) showToast("작업 링크를 복사했습니다.");
else window.prompt("아래 주소를 복사하세요.", url); else window.prompt("아래 주소를 복사하세요.", url);
} }
@@ -488,11 +488,11 @@
} catch (_) { n = 0; } } catch (_) { n = 0; }
} }
const name = title ? "'" + title + "' " : "이 "; const name = title ? "'" + title + "' " : "이 ";
const tail = "\n\n삭제한 업무는 휴지통에 3개월 보관되며, 관리자가 복구할 수 있습니다."; const tail = "\n\n삭제한 작업은 휴지통에 3개월 보관되며, 관리자가 복구할 수 있습니다.";
const msg = n > 0 const msg = n > 0
? name + "업무에 하위 업무가 " + n + "개 있습니다.\n하위 업무까지 모두 삭제할까요?" + tail ? name + "작업에 하위 작업이 " + n + "개 있습니다.\n하위 작업까지 모두 삭제할까요?" + tail
: name + "업무를 삭제할까요?" + tail; : name + "작업을 삭제할까요?" + tail;
const opts = { okText: n > 0 ? "하위 업무까지 삭제" : "삭제", cancelText: "취소" }; const opts = { okText: n > 0 ? "하위 작업까지 삭제" : "삭제", cancelText: "취소" };
if (window.erpConfirm) return await window.erpConfirm(msg, opts); if (window.erpConfirm) return await window.erpConfirm(msg, opts);
return confirm(msg); return confirm(msg);
} }
@@ -520,7 +520,7 @@
// emails 후보 중 하나를 고르는 메뉴 항목들(맨 앞 "(미지정)"). cur = 현재 담당자. // emails 후보 중 하나를 고르는 메뉴 항목들(맨 앞 "(미지정)"). cur = 현재 담당자.
function assigneeMenuItems(emails, cur, onPick) { function assigneeMenuItems(emails, cur, onPick) {
const c = String(cur || "").toLowerCase(); const c = String(cur || "").toLowerCase();
const items = [{ label: "(미지정)", icon: personIconHtml(""), checked: !c, onClick: function () { onPick(""); } }]; const items = [{ label: "담당자 없음", icon: personIconHtml(""), checked: !c, onClick: function () { onPick(""); } }];
emails.forEach(function (e) { emails.forEach(function (e) {
items.push({ items.push({
label: idOf(e), icon: personIconHtml(e), checked: String(e).toLowerCase() === c, label: idOf(e), icon: personIconHtml(e), checked: String(e).toLowerCase() === c,
@@ -547,7 +547,7 @@
const v = sel.value; const v = sel.value;
const opt = sel.selectedOptions && sel.selectedOptions[0]; const opt = sel.selectedOptions && sel.selectedOptions[0];
btn.innerHTML = personIconHtml(v) + '<span class="pj-assignee-btn-name"></span>'; btn.innerHTML = personIconHtml(v) + '<span class="pj-assignee-btn-name"></span>';
btn.querySelector(".pj-assignee-btn-name").textContent = v ? (opt ? opt.textContent : idOf(v)) : "(미지정)"; btn.querySelector(".pj-assignee-btn-name").textContent = v ? (opt ? opt.textContent : idOf(v)) : "담당자 없음";
btn.classList.toggle("is-empty", !v); btn.classList.toggle("is-empty", !v);
btn.disabled = sel.disabled; btn.disabled = sel.disabled;
btn.dataset.tip = v ? "담당자 변경" : "이 작업 배정"; btn.dataset.tip = v ? "담당자 변경" : "이 작업 배정";
@@ -631,7 +631,7 @@
} }
function renderMtList() { function renderMtList() {
const list = el("pj-mt-list"); const list = el("pj-mt-list");
if (!mtItems.length) { list.innerHTML = "<li class='pj-empty-sm'>배정된 업무가 없습니다.</li>"; return; } if (!mtItems.length) { list.innerHTML = "<li class='pj-empty-sm'>배정된 작업이 없습니다.</li>"; return; }
const sorted = mtItems.slice(); const sorted = mtItems.slice();
if (mtSort.key) { if (mtSort.key) {
sorted.sort(function (a, b) { sorted.sort(function (a, b) {
@@ -674,7 +674,7 @@
opts = opts || {}; opts = opts || {};
mtCurrentCtx = { email: email, name: name, opts: opts }; mtCurrentCtx = { email: email, name: name, opts: opts };
const prefix = opts.projectName ? escapeHtml(opts.projectName) + "의 " : ""; const prefix = opts.projectName ? escapeHtml(opts.projectName) + "의 " : "";
el("pj-mt-title").innerHTML = prefix + mtTitleAvatarHtml(email) + escapeHtml(name || email) + "님의 업무"; el("pj-mt-title").innerHTML = prefix + mtTitleAvatarHtml(email) + escapeHtml(name || email) + "님의 작업";
mtItems = []; mtItems = [];
mtSort = { key: null, dir: 1 }; mtSort = { key: null, dir: 1 };
updateMtSortIcons(); updateMtSortIcons();
@@ -883,7 +883,7 @@
async function deleteTreeProject(id, name, createdBy) { async function deleteTreeProject(id, name, createdBy) {
if (!canDelete(createdBy)) { alert(DELETE_DENIED); return; } if (!canDelete(createdBy)) { alert(DELETE_DENIED); return; }
const ok = await window.erpConfirm( const ok = await window.erpConfirm(
"'" + (name || "") + "' 프로젝트를 삭제할까요? 안의 업무도 모두 삭제됩니다.", "'" + (name || "") + "' 프로젝트를 삭제할까요? 안의 작업도 모두 삭제됩니다.",
{ okText: "삭제", cancelText: "취소" } { okText: "삭제", cancelText: "취소" }
); );
if (!ok) return; if (!ok) return;
@@ -1667,7 +1667,7 @@
// 표 컬럼 — text() 는 셀 내용(HTML), sort() 는 정렬 기준값. // 표 컬럼 — text() 는 셀 내용(HTML), sort() 는 정렬 기준값.
const COLS = [ const COLS = [
{ {
key: "title", label: "업무", cls: "pj-mtk-title", key: "title", label: "작업", cls: "pj-mtk-title",
html: function (t) { html: function (t) {
return '<span class="pj-mtk-name">' + escapeHtml(t.title || "") + "</span>" + return '<span class="pj-mtk-name">' + escapeHtml(t.title || "") + "</span>" +
(t.comment_count (t.comment_count
@@ -1687,7 +1687,7 @@
sort: function (t) { return (t.project_name || "").toLowerCase(); }, sort: function (t) { return (t.project_name || "").toLowerCase(); },
}, },
{ {
key: "stage", label: "세션", cls: "pj-mtk-stage", key: "stage", label: "섹션", cls: "pj-mtk-stage",
html: function (t) { return escapeHtml(t.stage_name || "미지정"); }, html: function (t) { return escapeHtml(t.stage_name || "미지정"); },
sort: function (t) { return (t.stage_name || "").toLowerCase(); }, sort: function (t) { return (t.stage_name || "").toLowerCase(); },
}, },
@@ -1784,7 +1784,7 @@
function rowContextItems(t) { function rowContextItems(t) {
return [ return [
{ label: "열기", onClick: function () { location.href = "/project/p/" + t.project_id + "?task=" + t.id; } }, { label: "열기", onClick: function () { location.href = "/project/p/" + t.project_id + "?task=" + t.id; } },
{ label: "링크 복사", onClick: function () { shareTaskLink(t.id); } }, { label: "작업 링크 복사", onClick: function () { shareTaskLink(t.id); } },
{ {
label: t.completed_at ? "완료 취소" : "완료로 표시", label: t.completed_at ? "완료 취소" : "완료로 표시",
onClick: function () { toggleDone(t, !t.completed_at); }, onClick: function () { toggleDone(t, !t.completed_at); },
@@ -1848,8 +1848,8 @@
'<td class="pj-mtk-check"></td>' + '<td class="pj-mtk-check"></td>' +
'<td class="pj-mtk-title" colspan="' + COLS.length + '">' + '<td class="pj-mtk-title" colspan="' + COLS.length + '">' +
'<span class="material-symbols-outlined pj-mtk-parent-ic">folder</span> ' + '<span class="material-symbols-outlined pj-mtk-parent-ic">folder</span> ' +
'<span class="pj-mtk-parent-name">' + escapeHtml(subtask.parent_title || "(상위 업무)") + "</span>" + '<span class="pj-mtk-parent-name">' + escapeHtml(subtask.parent_title || "(상위 작업)") + "</span>" +
'<span class="pj-mtk-parent-hint">' + (parentIsMine ? "상위 업무" : "다른 담당자의 상위 업무") + "</span>" + '<span class="pj-mtk-parent-hint">' + (parentIsMine ? "상위 작업" : "다른 담당자의 상위 작업") + "</span>" +
"</td>"; "</td>";
tr.addEventListener("click", function () { tr.addEventListener("click", function () {
location.href = "/project/p/" + subtask.project_id + "?task=" + subtask.parent_task_id; location.href = "/project/p/" + subtask.project_id + "?task=" + subtask.parent_task_id;
@@ -2364,7 +2364,7 @@
const t = tasks.find(function (x) { return String(x.id) === String(taskId); }); const t = tasks.find(function (x) { return String(x.id) === String(taskId); });
if (!t) return; if (!t) return;
const anchor = t.start_date || t.due_date; const anchor = t.start_date || t.due_date;
if (!anchor) { alert("날짜가 없는 업무는 달력에서 이동할 수 없습니다."); return; } if (!anchor) { alert("날짜가 없는 작업은 캘린더에서 이동할 수 없습니다."); return; }
const delta = dayDiff(anchor, dropDate); const delta = dayDiff(anchor, dropDate);
if (delta === 0) return; if (delta === 0) return;
const old = { s: t.start_date, d: t.due_date }; const old = { s: t.start_date, d: t.due_date };
@@ -2429,7 +2429,7 @@
const node = el("pj-timeline"); const node = el("pj-timeline");
if (timeline) { timeline.destroy(); timeline = null; } if (timeline) { timeline.destroy(); timeline = null; }
const dated = visibleTasks().filter(function (t) { return t.start_date || t.due_date; }); const dated = visibleTasks().filter(function (t) { return t.start_date || t.due_date; });
if (!dated.length) { node.innerHTML = '<div class="pj-empty">기간이 설정된 업무가 없습니다.</div>'; return; } if (!dated.length) { node.innerHTML = '<div class="pj-empty">기간이 설정된 작업이 없습니다.</div>'; return; }
// 프로젝트 메타(시작/마감/색) 조회용 // 프로젝트 메타(시작/마감/색) 조회용
const projById = {}; const projById = {};
@@ -2461,7 +2461,7 @@
const meta = groupBySession ? {} : (projById[gid] || {}); const meta = groupBySession ? {} : (projById[gid] || {});
const groupColor = list[0].project_color || meta.color || "#4573d2"; const groupColor = list[0].project_color || meta.color || "#4573d2";
const groupName = groupBySession const groupName = groupBySession
? (gid === "none" ? "미지정" : (list[0].stage_name || "세션")) ? (gid === "none" ? "미지정" : (list[0].stage_name || "섹션"))
: (list[0].project_name || meta.name || "프로젝트"); : (list[0].project_name || meta.name || "프로젝트");
groupRows.push({ id: grp, content: escapeHtml(groupName) }); groupRows.push({ id: grp, content: escapeHtml(groupName) });
let minMs = Infinity, maxMs = -Infinity; let minMs = Infinity, maxMs = -Infinity;
@@ -2653,7 +2653,7 @@
if (stageModal) wireModalClose(stageModal); if (stageModal) wireModalClose(stageModal);
function openStageModal(stage) { function openStageModal(stage) {
if (!stageModal) return; if (!stageModal) return;
el("pj-stage-modal-title").textContent = stage ? "\"" + stage.name + "\" 세션 편집" : "새 세션"; el("pj-stage-modal-title").textContent = stage ? "\"" + stage.name + "\" 섹션 편집" : "새 섹션";
el("pj-stg-id").value = stage ? stage.id : ""; el("pj-stg-id").value = stage ? stage.id : "";
el("pj-stg-name").value = stage ? stage.name : ""; el("pj-stg-name").value = stage ? stage.name : "";
getStageColor = renderColorPalette( getStageColor = renderColorPalette(
@@ -2688,7 +2688,7 @@
if (saveStageBtn) saveStageBtn.addEventListener("click", async function () { if (saveStageBtn) saveStageBtn.addEventListener("click", async function () {
const id = el("pj-stg-id").value; const id = el("pj-stg-id").value;
const name = el("pj-stg-name").value.trim(); const name = el("pj-stg-name").value.trim();
if (!name) { alert("세션 이름을 입력하세요."); return; } if (!name) { alert("섹션 이름을 입력하세요."); return; }
const color = getStageColor ? getStageColor() : null; const color = getStageColor ? getStageColor() : null;
const body = { name: name, color: color }; const body = { name: name, color: color };
// 기본 담당자는 바뀐 경우에만 보낸다 — DB 마이그레이션 009 전이라도 // 기본 담당자는 바뀐 경우에만 보낸다 — DB 마이그레이션 009 전이라도
@@ -2787,7 +2787,7 @@
if (!t || (t.stage_name || "") === name) return; if (!t || (t.stage_name || "") === name) return;
const plist = stagesByProject[t.project_id] || []; const plist = stagesByProject[t.project_id] || [];
const target = plist.find(function (s) { return s.name === name; }); const target = plist.find(function (s) { return s.name === name; });
if (!target) { alert("'" + (t.project_name || "이 프로젝트") + "' 에는 '" + name + "' 세션이 없습니다."); return; } if (!target) { alert("'" + (t.project_name || "이 프로젝트") + "' 에는 '" + name + "' 섹션이 없습니다."); return; }
try { try {
const res = await api("PUT", "/project/api/tasks/" + taskId, { stage_id: target.id }); const res = await api("PUT", "/project/api/tasks/" + taskId, { stage_id: target.id });
mergeTask(res.task); mergeTask(res.task);
@@ -2812,7 +2812,7 @@
if (!list.length && !vis.length) { if (!list.length && !vis.length) {
const empty = document.createElement("div"); const empty = document.createElement("div");
empty.className = "pj-empty"; empty.className = "pj-empty";
empty.textContent = "세션이 없습니다. 위 \"+ 세션 추가\"로 만들어 보세요."; empty.textContent = "섹션이 없습니다. 위 \"+ 섹션 추가\"로 만들어 보세요.";
board.appendChild(empty); board.appendChild(empty);
} }
list.forEach(function (s) { list.forEach(function (s) {
@@ -2834,9 +2834,9 @@
(s.is_done_stage ? '<span class="pj-chip pj-chip-sm">완료</span>' : "") + (s.is_done_stage ? '<span class="pj-chip pj-chip-sm">완료</span>' : "") +
(canManage (canManage
? '<span class="pj-col-actions">' + ? '<span class="pj-col-actions">' +
'<button type="button" class="pj-icon-btn pj-col-add" title="업무 추가">' + '<button type="button" class="pj-icon-btn pj-col-add" title="작업 추가">' +
'<span class="material-symbols-outlined">add</span></button>' + '<span class="material-symbols-outlined">add</span></button>' +
'<button type="button" class="pj-icon-btn pj-col-more" title="세션 메뉴">' + '<button type="button" class="pj-icon-btn pj-col-more" title="섹션 메뉴">' +
'<span class="material-symbols-outlined">more_horiz</span></button>' + '<span class="material-symbols-outlined">more_horiz</span></button>' +
"</span>" "</span>"
: "") + : "") +
@@ -2844,7 +2844,7 @@
// 세션 맨 아래 "+ 업무 추가" — 카드 목록이 길어져도 컬럼 바닥에 // 세션 맨 아래 "+ 업무 추가" — 카드 목록이 길어져도 컬럼 바닥에
// 고정으로 남는다(.pj-col-body 만 스크롤). // 고정으로 남는다(.pj-col-body 만 스크롤).
(canManage (canManage
? '<button type="button" class="pj-col-addtask">+ 업무 추가</button>' ? '<button type="button" class="pj-col-addtask">+ 작업 추가</button>'
: ""); : "");
const body = col.querySelector(".pj-col-body"); const body = col.querySelector(".pj-col-body");
const colTasks = vis.filter(function (t) { return t.stage_id === s.id; }); const colTasks = vis.filter(function (t) { return t.stage_id === s.id; });
@@ -2898,7 +2898,7 @@
async function deleteStage() { async function deleteStage() {
if (!canDelete(s.created_by)) { alert(DELETE_DENIED); return; } if (!canDelete(s.created_by)) { alert(DELETE_DENIED); return; }
const ok = await window.erpConfirm( const ok = await window.erpConfirm(
"'" + s.name + "' 세션을 삭제할까요? 이 세션의 업무는 '미지정'이 됩니다.", "'" + s.name + "' 섹션을 삭제할까요? 이 섹션의 작업은 '미지정'이 됩니다.",
{ okText: "삭제", cancelText: "취소" } { okText: "삭제", cancelText: "취소" }
); );
if (!ok) return; if (!ok) return;
@@ -2913,9 +2913,9 @@
const open = tasks.filter(function (t) { const open = tasks.filter(function (t) {
return t.stage_id === s.id && !t.parent_task_id && !t.completed_at; return t.stage_id === s.id && !t.parent_task_id && !t.completed_at;
}); });
if (!open.length) { showToast("완료할 업무가 없습니다."); return; } if (!open.length) { showToast("완료할 작업이 없습니다."); return; }
const ok = await window.erpConfirm( const ok = await window.erpConfirm(
"'" + s.name + "' 세션의 미완료 업무 " + open.length + "개를 모두 완료로 표시할까요?", "'" + s.name + "' 섹션의 미완료 작업 " + open.length + "개를 모두 완료로 표시할까요?",
{ okText: "모두 완료", cancelText: "취소" } { okText: "모두 완료", cancelText: "취소" }
); );
if (!ok) return; if (!ok) return;
@@ -2932,12 +2932,12 @@
// 세션 … 메뉴(버튼 클릭)와 머리 우클릭이 같은 항목을 쓴다. // 세션 … 메뉴(버튼 클릭)와 머리 우클릭이 같은 항목을 쓴다.
function stageMenuItems() { function stageMenuItems() {
return [ return [
{ label: "업무 추가", onClick: function () { openTaskModal(null, s.id); } }, { label: "작업 추가", onClick: function () { openTaskModal(null, s.id); } },
{ label: "이름 변경", onClick: startRename }, { label: "이름 변경", onClick: startRename },
{ label: "세션 편집 (색상·기본 담당자)", onClick: editStage }, { label: "섹션 편집 (색상·기본 담당자)", onClick: editStage },
null, null,
{ label: "세션 업무 모두 완료", onClick: completeAllInStage }, { label: "섹션 작업 모두 완료", onClick: completeAllInStage },
{ label: s.is_done_stage ? "완료 세션 해제" : "완료 세션으로 지정", onClick: toggleDoneStage }, { label: s.is_done_stage ? "완료 섹션 해제" : "완료 섹션으로 지정", onClick: toggleDoneStage },
null, null,
{ label: "삭제", danger: true, onClick: deleteStage }, { label: "삭제", danger: true, onClick: deleteStage },
]; ];
@@ -3015,7 +3015,7 @@
if (e.target.closest(".pj-card")) return; if (e.target.closest(".pj-card")) return;
e.preventDefault(); e.preventDefault();
showContextMenu(e.clientX, e.clientY, [ showContextMenu(e.clientX, e.clientY, [
{ label: "업무 추가", onClick: function () { openTaskModal(null, s.id); } }, { label: "작업 추가", onClick: function () { openTaskModal(null, s.id); } },
]); ]);
}); });
} }
@@ -3265,7 +3265,7 @@
} }
box.innerHTML = subs.length box.innerHTML = subs.length
? subs.map(cardSubRowHtml).join("") ? subs.map(cardSubRowHtml).join("")
: '<div class="pj-card-sub-empty">하위 업무 없음</div>'; : '<div class="pj-card-sub-empty">하위 작업 없음</div>';
box.querySelectorAll(".pj-card-sub").forEach(function (row) { box.querySelectorAll(".pj-card-sub").forEach(function (row) {
const sub = subs.find(function (x) { return String(x.id) === row.dataset.subId; }); const sub = subs.find(function (x) { return String(x.id) === row.dataset.subId; });
if (!sub) return; if (!sub) return;
@@ -3293,14 +3293,14 @@
e.stopPropagation(); e.stopPropagation();
showContextMenu(e.clientX, e.clientY, [ showContextMenu(e.clientX, e.clientY, [
{ label: "열기", onClick: function () { openTaskById(sub.id); } }, { label: "열기", onClick: function () { openTaskById(sub.id); } },
{ label: "상위 업무 열기", onClick: function () { openTaskModal(t); } }, { label: "상위 작업 열기", onClick: function () { openTaskModal(t); } },
{ {
label: sub.completed_at ? "완료 취소" : "완료로 표시", label: sub.completed_at ? "완료 취소" : "완료로 표시",
onClick: function () { row.querySelector(".pj-card-sub-check").click(); }, onClick: function () { row.querySelector(".pj-card-sub-check").click(); },
}, },
null, null,
{ {
label: "하위 업무 삭제", danger: true, label: "하위 작업 삭제", danger: true,
onClick: async function () { onClick: async function () {
if (!canDelete(sub.created_by)) { alert(DELETE_DENIED); return; } if (!canDelete(sub.created_by)) { alert(DELETE_DENIED); return; }
if (!(await confirmTaskDelete(sub.id, sub.title, null))) return; if (!(await confirmTaskDelete(sub.id, sub.title, null))) return;
@@ -3361,7 +3361,7 @@
} }
async function moveSubtaskTo(sub, from, to) { async function moveSubtaskTo(sub, from, to) {
if (sub.project_id && to.project_id && sub.project_id !== to.project_id) { if (sub.project_id && to.project_id && sub.project_id !== to.project_id) {
showToast("다른 프로젝트의 업무로는 옮길 수 없습니다.", "error"); showToast("다른 프로젝트의 작업으로는 옮길 수 없습니다.", "error");
return; return;
} }
try { try {
@@ -3418,7 +3418,7 @@
}).catch(function (err) { }).catch(function (err) {
expandedSubs.delete(t.id); expandedSubs.delete(t.id);
tog.classList.remove("is-open"); tog.classList.remove("is-open");
showToast("하위 업무를 불러오지 못했습니다: " + err.message, "error"); showToast("하위 작업을 불러오지 못했습니다: " + err.message, "error");
}); });
} }
@@ -3459,7 +3459,7 @@
// 하위 업무 — 아사나처럼 "개수 + 하위 업무 아이콘 + ▾", 누르면 카드 아래로 펼침. // 하위 업무 — 아사나처럼 "개수 + 하위 업무 아이콘 + ▾", 누르면 카드 아래로 펼침.
(t.subtask_total (t.subtask_total
? '<button type="button" class="pj-card-subtoggle' + (expandedSubs.has(t.id) ? " is-open" : "") + ? '<button type="button" class="pj-card-subtoggle' + (expandedSubs.has(t.id) ? " is-open" : "") +
'" title="하위 업무 ' + t.subtask_total + "개 (완료 " + (t.subtask_done || 0) + ')">' + '" title="하위 작업 ' + t.subtask_total + "개 (완료 " + (t.subtask_done || 0) + ')">' +
'<span class="pj-card-subtoggle-n">' + t.subtask_total + "</span>" + '<span class="pj-card-subtoggle-n">' + t.subtask_total + "</span>" +
SUBTASK_ICON_SVG + SUBTASK_ICON_SVG +
'<span class="material-symbols-outlined pj-card-subtoggle-caret">arrow_drop_down</span>' + '<span class="material-symbols-outlined pj-card-subtoggle-caret">arrow_drop_down</span>' +
@@ -3540,9 +3540,9 @@
// 예전처럼 프로젝트·세션을 컬럼으로 둔 평범한 정렬 테이블. // 예전처럼 프로젝트·세션을 컬럼으로 둔 평범한 정렬 테이블.
const LIST_COLS_ALL = [ const LIST_COLS_ALL = [
{ key: "project", label: "프로젝트", text: function (t) { return t.project_name || "-"; }, sort: function (t) { return (t.project_name || "").toLowerCase(); } }, { key: "project", label: "프로젝트", text: function (t) { return t.project_name || "-"; }, sort: function (t) { return (t.project_name || "").toLowerCase(); } },
{ key: "title", label: "업무", text: function (t) { return t.title; }, sort: function (t) { return (t.title || "").toLowerCase(); } }, { key: "title", label: "작업", text: function (t) { return t.title; }, sort: function (t) { return (t.title || "").toLowerCase(); } },
{ key: "assignee", label: "담당자", text: function (t) { return t.assignee_email ? idOf(t.assignee_email) : "-"; }, sort: function (t) { return idOf(t.assignee_email || ""); } }, { key: "assignee", label: "담당자", text: function (t) { return t.assignee_email ? idOf(t.assignee_email) : "-"; }, sort: function (t) { return idOf(t.assignee_email || ""); } },
{ key: "stage", label: "세션", text: function (t) { return t.stage_name || "-"; }, sort: function (t) { return t.stage_name || ""; } }, { key: "stage", label: "섹션", text: function (t) { return t.stage_name || "-"; }, sort: function (t) { return t.stage_name || ""; } },
{ key: "priority", label: "우선순위", text: function (t) { return priorityLabels[t.priority] || t.priority || "-"; }, sort: function (t) { return ({ low: 0, normal: 1, high: 2 })[t.priority]; } }, { key: "priority", label: "우선순위", text: function (t) { return priorityLabels[t.priority] || t.priority || "-"; }, sort: function (t) { return ({ low: 0, normal: 1, high: 2 })[t.priority]; } },
{ key: "start", label: "시작", text: function (t) { return t.start_date || "-"; }, sort: function (t) { return t.start_date || ""; } }, { key: "start", label: "시작", text: function (t) { return t.start_date || "-"; }, sort: function (t) { return t.start_date || ""; } },
{ key: "due", label: "마감", text: function (t) { const di = dueInfo(t.due_date, !!t.completed_at); return di ? di.text : "-"; }, sort: function (t) { return t.due_date || ""; } }, { key: "due", label: "마감", text: function (t) { const di = dueInfo(t.due_date, !!t.completed_at); return di ? di.text : "-"; }, sort: function (t) { return t.due_date || ""; } },
@@ -3700,7 +3700,7 @@
const td = document.createElement("td"); const td = document.createElement("td");
td.colSpan = colSpan; td.colSpan = colSpan;
td.className = "pj-empty-sm"; td.className = "pj-empty-sm";
td.textContent = "세션이 없습니다."; td.textContent = "섹션이 없습니다.";
tr.appendChild(td); tr.appendChild(td);
tbody.appendChild(tr); tbody.appendChild(tr);
} }
@@ -3883,7 +3883,7 @@
const byAssignee = {}; const byAssignee = {};
incomplete.forEach(function (t) { incomplete.forEach(function (t) {
if (!t.start_date && !t.due_date) return; if (!t.start_date && !t.due_date) return;
const k = t.assignee_email ? (t.assignee_name || idOf(t.assignee_email)) : "미지정"; const k = t.assignee_email ? (t.assignee_name || idOf(t.assignee_email)) : "담당자 없음";
byAssignee[k] = (byAssignee[k] || 0) + 1; byAssignee[k] = (byAssignee[k] || 0) + 1;
}); });
let assigneeEntries = Object.keys(byAssignee).map(function (k) { return { label: k, value: byAssignee[k] }; }) let assigneeEntries = Object.keys(byAssignee).map(function (k) { return { label: k, value: byAssignee[k] }; })
@@ -3959,7 +3959,7 @@
function taskContextItems(t) { function taskContextItems(t) {
return [ return [
{ label: "열기", onClick: function () { openTaskModal(t); } }, { label: "열기", onClick: function () { openTaskModal(t); } },
{ label: "링크 복사", onClick: function () { shareTaskLink(t.id); } }, { label: "작업 링크 복사", onClick: function () { shareTaskLink(t.id); } },
{ {
label: t.completed_at ? "완료 취소" : "완료로 표시", label: t.completed_at ? "완료 취소" : "완료로 표시",
onClick: async function () { onClick: async function () {
@@ -4090,7 +4090,7 @@
box.innerHTML = followers.map(function (e) { box.innerHTML = followers.map(function (e) {
return '<span class="pj-follower-chip" data-tip="' + escapeHtml(e) + '">' + return '<span class="pj-follower-chip" data-tip="' + escapeHtml(e) + '">' +
avatarHtml(e, "pj-gicon-sm") + '<span class="pj-follower-name">' + escapeHtml(idOf(e)) + "</span>" + avatarHtml(e, "pj-gicon-sm") + '<span class="pj-follower-name">' + escapeHtml(idOf(e)) + "</span>" +
'<button type="button" class="pj-follower-x" data-email="' + escapeHtml(e) + '" title="팔로워에서 빼기">×</button></span>'; '<button type="button" class="pj-follower-x" data-email="' + escapeHtml(e) + '" title="협업자에서 빼기">×</button></span>';
}).join("") || '<span class="pj-muted-sm">없음</span>'; }).join("") || '<span class="pj-muted-sm">없음</span>';
box.querySelectorAll(".pj-follower-x").forEach(function (b) { box.querySelectorAll(".pj-follower-x").forEach(function (b) {
b.addEventListener("click", function () { setFollower(b.dataset.email, false); }); b.addEventListener("click", function () { setFollower(b.dataset.email, false); });
@@ -4110,7 +4110,7 @@
if (!followersTask || followersTask.id !== tid) return; // 그 사이 다른 업무를 열었다 if (!followersTask || followersTask.id !== tid) return; // 그 사이 다른 업무를 열었다
followers = res.followers || []; followers = res.followers || [];
renderFollowers(); renderFollowers();
} catch (e) { showToast("팔로워 변경 실패: " + e.message, "error"); } } catch (e) { showToast("협업자 변경 실패: " + e.message, "error"); }
} }
function showFollowers(task, list) { function showFollowers(task, list) {
followersTask = task; followersTask = task;
@@ -4237,7 +4237,7 @@
parentBtn.hidden = !isSub; parentBtn.hidden = !isSub;
parentBtn.dataset.parentId = isSub ? String(task.parent_task_id) : ""; parentBtn.dataset.parentId = isSub ? String(task.parent_task_id) : "";
const pt = isSub && tasks.find(function (x) { return x.id === task.parent_task_id; }); const pt = isSub && tasks.find(function (x) { return x.id === task.parent_task_id; });
el("pj-t-parent-title").textContent = isSub ? (task.parent_title || (pt && pt.title) || "상위 업무") : ""; el("pj-t-parent-title").textContent = isSub ? (task.parent_title || (pt && pt.title) || "상위 작업") : "";
} }
const stageCell = document.querySelector(".pj-meta-cell-stage"); const stageCell = document.querySelector(".pj-meta-cell-stage");
if (stageCell) stageCell.style.display = isSub ? "none" : ""; if (stageCell) stageCell.style.display = isSub ? "none" : "";
@@ -4266,7 +4266,7 @@
try { try {
const res = await api("GET", "/project/api/tasks/" + id); const res = await api("GET", "/project/api/tasks/" + id);
if (res && res.task) openTaskModal(res.task); if (res && res.task) openTaskModal(res.task);
} catch (e) { showToast("업무를 열 수 없습니다: " + e.message, "error"); } } catch (e) { showToast("작업을 열 수 없습니다: " + e.message, "error"); }
} }
if (el("pj-t-parent")) el("pj-t-parent").addEventListener("click", function () { if (el("pj-t-parent")) el("pj-t-parent").addEventListener("click", function () {
const pid = parseInt(el("pj-t-parent").dataset.parentId, 10); const pid = parseInt(el("pj-t-parent").dataset.parentId, 10);
@@ -4345,7 +4345,7 @@
}); });
ul.querySelectorAll(".pj-attach-del").forEach(function (b) { ul.querySelectorAll(".pj-attach-del").forEach(function (b) {
b.addEventListener("click", async function () { b.addEventListener("click", async function () {
if (!confirm("이 첨부를 삭제할까요?")) return; if (!confirm("이 첨부 파일을 삭제할까요?")) return;
try { await api("DELETE", "/project/api/attachments/" + b.dataset.id); loadAttachments(taskId); } try { await api("DELETE", "/project/api/attachments/" + b.dataset.id); loadAttachments(taskId); }
catch (e) { alert("삭제 실패: " + e.message); } catch (e) { alert("삭제 실패: " + e.message); }
}); });
@@ -4633,7 +4633,7 @@
// 걸러졌거나 다른 스코프) — 서버에서 그 업무만 받아 연다. // 걸러졌거나 다른 스코프) — 서버에서 그 업무만 받아 연다.
api("GET", "/project/api/tasks/" + taskParam) api("GET", "/project/api/tasks/" + taskParam)
.then(function (res) { if (res && res.task) openTaskModal(res.task); }) .then(function (res) { if (res && res.task) openTaskModal(res.task); })
.catch(function (e) { showToast("업무를 열 수 없습니다: " + e.message, "error"); }); .catch(function (e) { showToast("작업을 열 수 없습니다: " + e.message, "error"); });
} }
} }
@@ -4966,9 +4966,9 @@
li.innerHTML = li.innerHTML =
'<input type="checkbox" class="pj-subtask-done"' + (sub.completed_at ? " checked" : "") + " />" + '<input type="checkbox" class="pj-subtask-done"' + (sub.completed_at ? " checked" : "") + " />" +
'<input type="text" class="pj-subtask-title" />' + '<input type="text" class="pj-subtask-title" />' +
'<select class="pj-subtask-assignee"><option value="">(미지정)</option>' + optionsHtml + "</select>" + '<select class="pj-subtask-assignee"><option value="">담당자 없음</option>' + optionsHtml + "</select>" +
'<input type="date" class="pj-subtask-due" />' + '<input type="date" class="pj-subtask-due" />' +
'<button type="button" class="pj-icon-btn pj-subtask-open" title="하위 업무 열기">' + '<button type="button" class="pj-icon-btn pj-subtask-open" title="하위 작업 열기">' +
'<span class="material-symbols-outlined">chevron_right</span></button>' + '<span class="material-symbols-outlined">chevron_right</span></button>' +
'<button type="button" class="pj-icon-btn pj-subtask-del" title="삭제" hidden>×</button>'; '<button type="button" class="pj-icon-btn pj-subtask-del" title="삭제" hidden>×</button>';
const titleInp = li.querySelector(".pj-subtask-title"); const titleInp = li.querySelector(".pj-subtask-title");
@@ -5026,7 +5026,7 @@
if (addBtn) addBtn.addEventListener("click", async function () { if (addBtn) addBtn.addEventListener("click", async function () {
const title = (input.value || "").trim(); const title = (input.value || "").trim();
if (!title) return; if (!title) return;
if (!taskId) { alert("먼저 업무를 저장한 뒤 하위 업무를 추가할 수 있습니다."); return; } if (!taskId) { alert("먼저 작업을 저장한 뒤 하위 작업을 추가할 수 있습니다."); return; }
const assigneeOpt = addAssignee ? addAssignee.selectedOptions[0] : null; const assigneeOpt = addAssignee ? addAssignee.selectedOptions[0] : null;
try { try {
const res = await api("POST", "/project/api/projects/" + projectId + "/tasks", { const res = await api("POST", "/project/api/projects/" + projectId + "/tasks", {
@@ -5057,7 +5057,7 @@
onOpen = opts.onOpen || null; onOpen = opts.onOpen || null;
if (addAssignee && projectId) { if (addAssignee && projectId) {
membersOptionsHtml(projectId).then(function (html) { membersOptionsHtml(projectId).then(function (html) {
addAssignee.innerHTML = "<option value=''>(미지정)</option>" + html; addAssignee.innerHTML = "<option value=''>담당자 없음</option>" + html;
}); });
} }
}, },
@@ -5125,7 +5125,7 @@
if (saveBtn) saveBtn.addEventListener("click", async function () { if (saveBtn) saveBtn.addEventListener("click", async function () {
const pid = parseInt(projSel.value, 10); const pid = parseInt(projSel.value, 10);
if (!pid) { alert("프로젝트를 선택하세요."); return; } if (!pid) { alert("프로젝트를 선택하세요."); return; }
if (!taskId) { alert("먼저 업무를 저장한 뒤 연결할 수 있습니다."); return; } if (!taskId) { alert("먼저 작업을 저장한 뒤 연결할 수 있습니다."); return; }
try { try {
await api("POST", "/project/api/tasks/" + taskId + "/links", await api("POST", "/project/api/tasks/" + taskId + "/links",
{ project_id: pid, stage_id: stageSel.value ? parseInt(stageSel.value, 10) : null }); { project_id: pid, stage_id: stageSel.value ? parseInt(stageSel.value, 10) : null });
@@ -5606,8 +5606,8 @@
table.querySelectorAll(".pj-trash-restore").forEach(function (btn) { table.querySelectorAll(".pj-trash-restore").forEach(function (btn) {
btn.addEventListener("click", async function () { btn.addEventListener("click", async function () {
const n = parseInt(btn.dataset.count || "1", 10); const n = parseInt(btn.dataset.count || "1", 10);
const msg = "'" + btn.dataset.title + "' 업무" + (n > 1 ? "(하위 업무 " + (n - 1) + "개 포함)" : "") + const msg = "'" + btn.dataset.title + "' 작업" + (n > 1 ? "(하위 작업 " + (n - 1) + "개 포함)" : "") +
"를 복구할까요?\n원래 프로젝트·세션 자리로 돌아갑니다."; "을 복구할까요?\n원래 프로젝트·섹션 자리로 돌아갑니다.";
const ok = window.erpConfirm const ok = window.erpConfirm
? await window.erpConfirm(msg, { okText: "복구", cancelText: "취소" }) ? await window.erpConfirm(msg, { okText: "복구", cancelText: "취소" })
: confirm(msg); : confirm(msg);
+139 -133
View File
@@ -1,8 +1,14 @@
# 프로젝트 관리 모듈 (아사나식) — `app/modules/project/` # 프로젝트 관리 모듈 (아사나식) — `app/modules/project/`
> 회사(dbxcorp.co.kr) 직원이 프로젝트→세션→업무 3단계 구조를 달력/타임라인/ > 회사(dbxcorp.co.kr) 직원이 프로젝트→섹션→작업 3단계 구조를 캘린더/타임라인/
> 보드로 관리하는 아사나(Asana) 스타일 협업 모듈. DB는 `project_db` 전용. > 보드로 관리하는 아사나(Asana) 스타일 협업 모듈. DB는 `project_db` 전용.
**화면 용어는 아사나 한국어판에 맞춘다(2026-09-25 통일)** — 새 화면·메시지도 이 표를 따른다.
작업(예전 "업무") · 하위 작업 / 상위 작업 · 내 작업 · 섹션(예전 "세션") · 협업자(예전 "팔로워") ·
목록(보기 탭, 예전 "리스트") · 캘린더(예전 "달력") · 수신함 · 첨부 파일 · 작업 링크 복사 ·
프로젝트 칸 + "다른 프로젝트에 추가"(예전 "연결된 프로젝트") · 담당자 없음(예전 "(미지정)").
"@태그"는 그대로 쓴다. 코드 식별자·DB 컬럼(`tasks`, `stage_id`, `task_followers` 등)과 코드 주석은 예전 이름 그대로다.
## 1. 개요 ## 1. 개요
| 항목 | 값 | | 항목 | 값 |
@@ -12,84 +18,84 @@
| 연결 env | `PROJECT_DB_URL` (미설정 시 "설정 필요" 안내, 앱은 죽지 않음) | | 연결 env | `PROJECT_DB_URL` (미설정 시 "설정 필요" 안내, 앱은 죽지 않음) |
| 진입 권한 | 권한키 `project` (관리자 페이지 토글로 직원별 부여, admin 자동) | | 진입 권한 | 권한키 `project` (관리자 페이지 토글로 직원별 부여, admin 자동) |
| 멤버 배정 후보 | `project` 권한 보유 등록 사용자 자동 목록 (`GET /project/api/assignable-users`) | | 멤버 배정 후보 | `project` 권한 보유 등록 사용자 자동 목록 (`GET /project/api/assignable-users`) |
| 생성 권한 | **프로젝트·세션·업무(하위 업무 포함) 생성은 로그인해 이 모듈에 접근할 수 있는 사용자 누구나.** 프로젝트를 만든 사람은 자동으로 owner 가 되어 그 프로젝트를 관리(`_can_manage`)할 수 있다. | | 생성 권한 | **프로젝트·섹션·작업(하위 작업 포함) 생성은 로그인해 이 모듈에 접근할 수 있는 사용자 누구나.** 프로젝트를 만든 사람은 자동으로 owner 가 되어 그 프로젝트를 관리(`_can_manage`)할 수 있다. |
| 수정/이동 권한 | 서브프로젝트·업무·세션 CRUD(이름변경·완료토글·순서변경 등) = 그 프로젝트의 배정 멤버 또는 owner 또는 admin(`_require_manage`) | | 수정/이동 권한 | 서브프로젝트·작업·섹션 CRUD(이름변경·완료토글·순서변경 등) = 그 프로젝트의 배정 멤버 또는 owner 또는 admin(`_require_manage`) |
| 조회 권한 | 프로젝트 화면(`/p/{id}`)·멤버/세션/업무/활동/스냅샷 API 도 멤버·owner·admin 만(`_require_manage`). 비멤버는 403. `GET /api/users/tasks` 를 프로젝트 없이 부르면 내가 볼 수 있는 프로젝트의 업무만 돌려준다 | | 조회 권한 | 프로젝트 화면(`/p/{id}`)·멤버/섹션/작업/활동/스냅샷 API 도 멤버·owner·admin 만(`_require_manage`). 비멤버는 403. `GET /api/users/tasks` 를 프로젝트 없이 부르면 내가 볼 수 있는 프로젝트의 작업만 돌려준다 |
| 입력 검증 | URL 의 세션이 URL 의 프로젝트 것인지(`_stage_of_project`), 업무 생성/수정·연결 시 세션이 그 프로젝트 것인지(`stage_in_project`), 하위 업무의 부모가 같은 프로젝트인지 확인 — 권한은 URL 의 project_id 로 보므로 이걸 안 보면 남의 프로젝트를 건드릴 수 있다 | | 입력 검증 | URL 의 섹션이 URL 의 프로젝트 것인지(`_stage_of_project`), 작업 생성/수정·연결 시 섹션이 그 프로젝트 것인지(`stage_in_project`), 하위 작업의 부모가 같은 프로젝트인지 확인 — 권한은 URL 의 project_id 로 보므로 이걸 안 보면 남의 프로젝트를 건드릴 수 있다 |
| 삭제 권한 | **프로젝트·세션·업무 모두 "만든 사람만"**(슈퍼관리자 예외, 생성자 정보 없는 과거 데이터는 admin 허용) — `_can_delete` 하나로 통일 | | 삭제 권한 | **프로젝트·섹션·작업 모두 "만든 사람만"**(슈퍼관리자 예외, 생성자 정보 없는 과거 데이터는 admin 허용) — `_can_delete` 하나로 통일 |
| 멤버 배정 | 여전히 관리자(`is_admin`) 전용. 비관리자가 "새 프로젝트" 모달을 열면 멤버 선택란은 안내 문구만 뜨고 시도하지 않는다(불필요한 403 방지) | | 멤버 배정 | 여전히 관리자(`is_admin`) 전용. 비관리자가 "새 프로젝트" 모달을 열면 멤버 선택란은 안내 문구만 뜨고 시도하지 않는다(불필요한 403 방지) |
| 메일 알림 | `app/mail.py` (stdlib smtplib). 업무 배정/완료 시 관리자에게 발송 | | 메일 알림 | `app/mail.py` (stdlib smtplib). 작업 배정/완료 시 관리자에게 발송 |
## 1-1. 프로젝트 → 세션 → 업무 (하위 업무 포함) 3단계 구조 ## 1-1. 프로젝트 → 섹션 → 작업 (하위 작업 포함) 3단계 구조
**"세션"은 새 개념이 아니라 기존 "단계"(칸반 컬럼)를 그대로 재사용한다** — **"섹션"은 새 개념이 아니라 기존 "단계"(칸반 컬럼)를 그대로 재사용한다** —
아사나도 보드 뷰의 컬럼과 리스트 뷰의 구분선이 같은 "섹션" 하나다. DB 아사나도 보드 뷰의 컬럼과 목록 뷰의 구분선이 같은 "섹션" 하나다. DB
컬럼/테이블 이름(`project_stages`, `stage_id`)은 그대로 두고, 사용자에게 컬럼/테이블 이름(`project_stages`, `stage_id`)은 그대로 두고, 사용자에게
보이는 문구만 "세션"으로 바꿨다. 보이는 문구만 "섹션"으로 바꿨다.
- **세션 관리** — 프로젝트 화면(`/project/p/{id}`)에서 "이 프로젝트" 스코프로 - **섹션 관리** — 프로젝트 화면(`/project/p/{id}`)에서 "이 프로젝트" 스코프로
볼 때만 보드 컬럼에 관리 UI가 붙는다(이름변경·완료토글·삭제·"+ 세션 추가"). 볼 때만 보드 컬럼에 관리 UI가 붙는다(이름변경·완료토글·삭제·"+ 섹션 추가").
컬럼 헤더를 **드래그해서 순서를 바꿀 수 있다**(카드 드래그와 같은 네이티브 컬럼 헤더를 **드래그해서 순서를 바꿀 수 있다**(카드 드래그와 같은 네이티브
HTML5 DnD, `PUT /api/projects/{id}/stages/order` 재사용). "전체 프로젝트" HTML5 DnD, `PUT /api/projects/{id}/stages/order` 재사용). "전체 프로젝트"
스코프(여러 프로젝트를 세션 '이름'으로 합쳐 보는 예전 방식)에서는 세션을 스코프(여러 프로젝트를 섹션 '이름'으로 합쳐 보는 예전 방식)에서는 섹션을
하나로 특정할 수 없어 관리 UI가 없다. 하나로 특정할 수 없어 관리 UI가 없다.
- **하위 업무(subtask)** — 새 테이블이 아니라 `tasks.parent_task_id` 재사용 - **하위 작업(subtask)** — 새 테이블이 아니라 `tasks.parent_task_id` 재사용
(부모 삭제 시 CASCADE). 업무 편집 팝업 안에 인라인으로 표시되며(체크박스+ (부모 삭제 시 CASCADE). 작업 편집 팝업 안에 인라인으로 표시되며(체크박스+
제목+담당자+마감일, 한 줄에서 바로 저장), 보드/캘린더/리스트에는 최상위 제목+담당자+마감일, 한 줄에서 바로 저장), 보드/캘린더/목록에는 최상위
업무만 카드로 뜬다(하위 업무는 부모 카드의 "N ⤷ ▾" 토글로 — 누르면 아사나처럼 카드 아래로 작업만 카드로 뜬다(하위 작업은 부모 카드의 "N ⤷ ▾" 토글로 — 누르면 아사나처럼 카드 아래로
하위 업무 목록(완료 체크·제목·마감·담당자)이 펼쳐진다. 펼친 상태는 페이지에 머무는 동안 유지). 하위 작업 목록(완료 체크·제목·마감·담당자)이 펼쳐진다. 펼친 상태는 페이지에 머무는 동안 유지).
세션을 갖지 않는다(칸반에 안 보이므로). 섹션을 갖지 않는다(칸반에 안 보이므로).
펼친 하위 업무 한 줄을 다른 카드로 드래그하면 그 업무의 하위 업무로 옮겨진다 펼친 하위 작업 한 줄을 다른 카드로 드래그하면 그 작업의 하위 작업으로 옮겨진다
(`POST /api/tasks/{id}/move-parent` `{parent_task_id}` → `db.move_subtask`, 활동 `subtask_moved`). (`POST /api/tasks/{id}/move-parent` `{parent_task_id}` → `db.move_subtask`, 활동 `subtask_moved`).
받는 쪽은 **같은 프로젝트의 최상위 업무만**(순환 방지), 하위 업무의 하위 업무는 함께 따라간다. 받는 쪽은 **같은 프로젝트의 최상위 작업만**(순환 방지), 하위 작업의 하위 작업은 함께 따라간다.
**하위 업무도 업무와 같은 팝업에서 똑같이 편집**(아사나식) — 보드 카드의 하위 업무 줄 클릭·우클릭 "열기", **하위 작업도 작업과 같은 팝업에서 똑같이 편집**(아사나식) — 보드 카드의 하위 작업 줄 클릭·우클릭 "열기",
업무 팝업 하위 업무 줄의 › 버튼, 공유 링크로 연다(`openTaskById`). 제목 위에 상위 업무 경로 작업 팝업 하위 작업 줄의 › 버튼, 공유 링크로 연다(`openTaskById`). 제목 위에 상위 작업 경로
(`#pj-t-parent`, 누르면 상위 업무로 — `GET /api/tasks/{id}` 가 `parent_title` 을 준다), (`#pj-t-parent`, 누르면 상위 작업으로 — `GET /api/tasks/{id}` 가 `parent_title` 을 준다),
세션 칸·다른 프로젝트 연결은 숨긴다. 저장해도 보드 목록(`tasks`)엔 넣지 않는다(`mergeTask`). 섹션 칸·다른 프로젝트 연결은 숨긴다. 저장해도 보드 목록(`tasks`)엔 넣지 않는다(`mergeTask`).
- **멀티호밍(다른 프로젝트에 연결)** — `task_project_links` 테이블. 업무 하나가 - **멀티호밍(다른 프로젝트에 연결)** — `task_project_links` 테이블. 작업 하나가
원래 소속(기본 홈, `tasks.project_id`/`stage_id`)과 무관하게 다른 프로젝트의 원래 소속(기본 홈, `tasks.project_id`/`stage_id`)과 무관하게 다른 프로젝트의
한 세션에도 동시에 나타날 수 있다(아사나의 "Add to project"). 업무 편집 한 섹션에도 동시에 나타날 수 있다(아사나의 "Add to project"). 작업 편집
팝업의 "연결된 프로젝트" 칩에서 추가/해제한다. 새 연결을 만들 때는 원 팝업의 "연결된 프로젝트" 칩에서 추가/해제한다. 새 연결을 만들 때는 원
프로젝트·대상 프로젝트 양쪽 관리 권한이 필요하지만(무단으로 남의 업무를 프로젝트·대상 프로젝트 양쪽 관리 권한이 필요하지만(무단으로 남의 작업을
끌어와 노출시키는 것 방지), **이미 연결된 업무를 그 프로젝트 보드 안에서 끌어와 노출시키는 것 방지), **이미 연결된 작업을 그 프로젝트 보드 안에서
다른 세션으로 드래그하는 것은 대상 프로젝트 권한만 있으면 된다.** 다른 섹션으로 드래그하는 것은 대상 프로젝트 권한만 있으면 된다.**
`list_tasks(project_id=X)`(비재귀 단일 프로젝트 조회, 프로젝트 화면이 쓰는 `list_tasks(project_id=X)`(비재귀 단일 프로젝트 조회, 프로젝트 화면이 쓰는
바로 그 경로)가 자동으로 연결된 업무까지 포함해서 돌려준다 — 다른 호출 바로 그 경로)가 자동으로 연결된 작업까지 포함해서 돌려준다 — 다른 호출
경로(홈/내 업무 등 `project_id` 없이 부르는 전체보기)는 원 소속만 세어 경로(홈/내 작업 등 `project_id` 없이 부르는 전체보기)는 원 소속만 세어
중복 노출을 막는다. 중복 노출을 막는다.
- **사이드바 프로젝트 스코프** — 프로젝트 화면 툴바에 "이 프로젝트"/"전체 - **사이드바 프로젝트 스코프** — 프로젝트 화면 툴바에 "이 프로젝트"/"전체
프로젝트" 토글이 있다. 기본은 "이 프로젝트"(아사나처럼 지금 선택한 프로젝트" 토글이 있다. 기본은 "이 프로젝트"(아사나처럼 지금 선택한
프로젝트의 세션만 보드/캘린더/타임라인/리스트에 나온다), "전체 프로젝트"는 프로젝트의 섹션만 보드/캘린더/타임라인/목록에 나온다), "전체 프로젝트"는
예전처럼 접근 가능한 모든 프로젝트를 합쳐서 보여준다. 서버가 `tasks` 배열의 예전처럼 접근 가능한 모든 프로젝트를 합쳐서 보여준다. 서버가 `tasks` 배열의
각 행에 `context_project_id`(어느 프로젝트를 보다가 담겼는지)를 표시해두고, 각 행에 `context_project_id`(어느 프로젝트를 보다가 담겼는지)를 표시해두고,
클라이언트가 이 값으로 스코프를 걸러낸다(순수 프론트 필터 — 서버 재조회 없음). 클라이언트가 이 값으로 스코프를 걸러낸다(순수 프론트 필터 — 서버 재조회 없음).
- **업무 설명 이미지 삽입** — 설명란이 `contenteditable` 로 바뀌어 이미지를 - **작업 설명 이미지 삽입** — 설명란이 `contenteditable` 로 바뀌어 이미지를
붙여넣거나 파일로 올릴 수 있다. 새 첨부 endpoint 없이 기존 붙여넣거나 파일로 올릴 수 있다. 새 첨부 endpoint 없이 기존
`task_attachments` 업로드를 재사용하고, 표시는 `GET `task_attachments` 업로드를 재사용하고, 표시는 `GET
/api/attachments/{id}/inline`(다운로드용 `/download` 는 `Content-Disposition: /api/attachments/{id}/inline`(다운로드용 `/download` 는 `Content-Disposition:
attachment` 가 걸려 `<img>` 로 못 씀 — 그래서 인라인 전용 endpoint를 따로 attachment` 가 걸려 `<img>` 로 못 씀 — 그래서 인라인 전용 endpoint를 따로
뒀다)로 한다. 저장 전 서버가 `store.sanitize_description_html()` 로 허용 뒀다)로 한다. 저장 전 서버가 `store.sanitize_description_html()` 로 허용
태그만 남기고 스크립트/이벤트속성/위험 URL 스킴을 제거한다(표준 태그만 남기고 스크립트/이벤트속성/위험 URL 스킴을 제거한다(표준
`html.parser`, 외부 라이브러리 없음). 새 업무 작성 중(저장 전, task_id 없음) `html.parser`, 외부 라이브러리 없음). 새 작업 작성 중(저장 전, task_id 없음)
에는 이미지 삽입이 비활성화된다 — 첨부가 업무 id 를 필요로 하기 때문. 에는 이미지 삽입이 비활성화된다 — 첨부가 작업 id 를 필요로 하기 때문.
## 2. 데이터 모델 (`scripts/sql/project_db_init.sql` + `..._002_*` ~ `..._006_*`) ## 2. 데이터 모델 (`scripts/sql/project_db_init.sql` + `..._002_*` ~ `..._006_*`)
- `projects` — `parent_id`(self-FK, NULL=최상위 / NOT NULL=서브프로젝트, `ON DELETE CASCADE`), name, description, color, owner_email, start/due_date, status(active|archived). - `projects` — `parent_id`(self-FK, NULL=최상위 / NOT NULL=서브프로젝트, `ON DELETE CASCADE`), name, description, color, owner_email, start/due_date, status(active|archived).
- `project_members` — 프로젝트↔사용자 배정. role(manager|member), `UNIQUE(project_id, user_email)`. - `project_members` — 프로젝트↔사용자 배정. role(manager|member), `UNIQUE(project_id, user_email)`.
- `project_stages`(="세션") — 진행단계(칸반 컬럼). **프로젝트 생성 시 자동으로 - `project_stages`(="섹션") — 진행단계(칸반 컬럼). **프로젝트 생성 시 자동으로
만들지 않는다**(아사나처럼 직접 "+ 세션 추가"로 만든다 — `create_project` 만들지 않는다**(아사나처럼 직접 "+ 섹션 추가"로 만든다 — `create_project`
의 `seed_stages` 기본값은 `False`). `is_done_stage`=TRUE 단계로 옮기면 업무 의 `seed_stages` 기본값은 `False`). `is_done_stage`=TRUE 단계로 옮기면 작업
완료 처리. `created_by`(003) — 삭제를 "만든 사람만"으로 제한하기 위함. 완료 처리. `created_by`(003) — 삭제를 "만든 사람만"으로 제한하기 위함.
`color`(004, nullable) — 세션 생성/편집 팝업에서 아사나 10색 팔레트 `color`(004, nullable) — 섹션 생성/편집 팝업에서 아사나 10색 팔레트
(`store.STAGE_COLOR_PALETTE`) 중 선택, 보드 컬럼 헤더에 표시. (`store.STAGE_COLOR_PALETTE`) 중 선택, 보드 컬럼 헤더에 표시.
- `tasks` — 업무. stage_id, title, description(HTML — 이미지 삽입 지원), assignee_email/name, priority(low|normal|high), start/due_date, completed_at, `parent_task_id`(003, self-FK `ON DELETE CASCADE`, NULL=최상위 업무). - `tasks` — 작업. stage_id, title, description(HTML — 이미지 삽입 지원), assignee_email/name, priority(low|normal|high), start/due_date, completed_at, `parent_task_id`(003, self-FK `ON DELETE CASCADE`, NULL=최상위 작업).
- `task_project_links`(003) — 멀티호밍. `(task_id, project_id)` UNIQUE, `stage_id` nullable(그 프로젝트 안에서의 세션). - `task_project_links`(003) — 멀티호밍. `(task_id, project_id)` UNIQUE, `stage_id` nullable(그 프로젝트 안에서의 섹션).
- `task_comments` — 댓글. - `task_comments` — 댓글.
- `task_attachments` — 첨부(설명란 이미지도 이걸 재사용). - `task_attachments` — 첨부(설명란 이미지도 이걸 재사용).
- `project_activity` — 활동 이력(created/assigned/completed/stage_changed). 메일 트리거 근거 + 타임라인. - `project_activity` — 활동 이력(created/assigned/completed/stage_changed). 메일 트리거 근거 + 타임라인.
- `task_mentions`(006) — @태그. `(task_id, COALESCE(comment_id,0), mentioned_email)` UNIQUE, - `task_mentions`(006) — @태그. `(task_id, COALESCE(comment_id,0), mentioned_email)` UNIQUE,
`source`=description|comment, `is_read`. 수신함의 "나를 태그한 업무" 목록 근거. `source`=description|comment, `is_read`. 수신함의 "나를 태그한 작업" 목록 근거.
## 3. 화면 / 뷰 ## 3. 화면 / 뷰
@@ -104,47 +110,47 @@
> `<select>` 는 `enhanceAssigneeSelect(sel)` 로 감싼다(select 는 숨겨 값 저장소로 유지). 미지정 = 점선 원 사람 아이콘. > `<select>` 는 `enhanceAssigneeSelect(sel)` 로 감싼다(select 는 숨겨 값 저장소로 유지). 미지정 = 점선 원 사람 아이콘.
> >
> **날짜 규칙.** 마감일(시작일) 고르기는 아사나식 팝업 `openDatePopover(anchor, {start, due, allowStart, onChange})` > **날짜 규칙.** 마감일(시작일) 고르기는 아사나식 팝업 `openDatePopover(anchor, {start, due, allowStart, onChange})`
> 하나만(브라우저 기본 date 달력 금지). 마감일 표기는 `dueInfo(iso, done)` — 어제(빨강)·오늘/내일(초록)·그 밖 mm/dd(요일), > 하나만(브라우저 기본 date 캘린더 금지). 마감일 표기는 `dueInfo(iso, done)` — 어제(빨강)·오늘/내일(초록)·그 밖 mm/dd(요일),
> 지난 날짜 빨강, 완료 업무는 색 없음. > 지난 날짜 빨강, 완료 작업은 색 없음.
- **내 업무** (`/project/`): 프로젝트 모듈의 첫 화면. 예전 홈(프로젝트 카드 그리드)은 - **내 작업** (`/project/`): 프로젝트 모듈의 첫 화면. 예전 홈(프로젝트 카드 그리드)은
**없앴다** — 좌측 "내 업무" 메뉴와 같은 화면이다(`project/mytasks.html`). **없앴다** — 좌측 "내 작업" 메뉴와 같은 화면이다(`project/mytasks.html`).
내가 담당자인 업무를 한 표에 모아 보여준다: 완료 체크박스 · 업무 · 프로젝트 · 세션 · 내가 담당자인 작업을 한 표에 모아 보여준다: 완료 체크박스 · 작업 · 프로젝트 · 섹션 ·
우선순위 · 시작 · 마감. 헤더 클릭으로 정렬, 상단 탭으로 진행 중/완료/전체 필터, 우선순위 · 시작 · 마감. 헤더 클릭으로 정렬, 상단 탭으로 진행 중/완료/전체 필터,
오른쪽에 진행/완료/지연 요약. 체크박스는 그 자리에서 완료 토글, 행을 누르면 그 오른쪽에 진행/완료/지연 요약. 체크박스는 그 자리에서 완료 토글, 행을 누르면 그
프로젝트로 이동하며 업무 편집 팝업이 열리고(`?task=`), 우클릭은 열기/완료/삭제 메뉴. 프로젝트로 이동하며 작업 편집 팝업이 열리고(`?task=`), 우클릭은 열기/완료/삭제 메뉴.
완료된 업무 행은 반투명 + 취소선. 8초 주기로 목록을 다시 받는다. 완료된 작업 행은 반투명 + 취소선. 8초 주기로 목록을 다시 받는다.
표/목록 화면이라 본문 폭은 1180px 로 제한한다(보드·달력 등 프로젝트 뷰는 전체 폭). 표/목록 화면이라 본문 폭은 1180px 로 제한한다(보드·캘린더 등 프로젝트 뷰는 전체 폭).
좌측 사이드바는 프로젝트·수신함 화면과 공용(`project/_side.html`, `side_active` 로 좌측 사이드바는 프로젝트·수신함 화면과 공용(`project/_side.html`, `side_active` 로
활성 메뉴 표시) — 수신함 · 내 업무 · 활성 메뉴 표시) — 수신함 · 내 작업 ·
프로젝트 트리(+ 새 프로젝트) · "전체 멤버". 프로젝트 트리는 **수신함·내 업무·휴지통·프로젝트 프로젝트 트리(+ 새 프로젝트) · "전체 멤버". 프로젝트 트리는 **수신함·내 작업·휴지통·프로젝트
네 화면 모두 같다** — 관리자에게 드래그 순서 변경(⣿)·✎ 수정·× 삭제·우클릭 메뉴(공용 네 화면 모두 같다** — 관리자에게 드래그 순서 변경(⣿)·✎ 수정·× 삭제·우클릭 메뉴(공용
`initSideTree`, 모달은 `project/_side_modals.html` 을 각 화면이 include). "전체 멤버"는 **관리자(`is_admin`)에게만** `initSideTree`, 모달은 `project/_side_modals.html` 을 각 화면이 include). "전체 멤버"는 **관리자(`is_admin`)에게만**
그리고 수신함·내 업무·프로젝트 화면 모두에서 나온다. 아이콘 클릭 = 그 사람의 담당 업무 그리고 수신함·내 작업·프로젝트 화면 모두에서 나온다. 아이콘 클릭 = 그 사람의 담당 작업
팝업(`_member_tasks_modal.html`, `initMemberTasks`) — 프로젝트 화면에선 더블클릭 시 그 자리에서 팝업(`_member_tasks_modal.html`, `initMemberTasks`) — 프로젝트 화면에선 더블클릭 시 그 자리에서
편집 팝업, 다른 화면에선 그 업무의 프로젝트 화면(`?task=`)으로 이동. 편집 팝업, 다른 화면에선 그 작업의 프로젝트 화면(`?task=`)으로 이동.
- **프로젝트** (`/project/p/{id}`): 좌측 사이드바(공용 `_side.html`) + 우측 뷰 토글. - **프로젝트** (`/project/p/{id}`): 좌측 사이드바(공용 `_side.html`) + 우측 뷰 토글.
좌측 "내 업무"는 접이식 패널이 아니라 `/project/` 로 가는 링크다. 좌측 "내 작업"는 접이식 패널이 아니라 `/project/` 로 가는 링크다.
**이 프로젝트의 멤버는 화면 위 제목 오른쪽**에 겹친 아바타로 둔다(`.pj-title-members`) — **이 프로젝트의 멤버는 화면 위 제목 오른쪽**에 겹친 아바타로 둔다(`.pj-title-members`) —
마우스를 올리면 이름(`data-tip`, `initHoverTips` 가 위임 방식이라 동적 요소에도 붙는다), 마우스를 올리면 이름(`data-tip`, `initHoverTips` 가 위임 방식이라 동적 요소에도 붙는다),
클릭하면 그 사람이 이 프로젝트에서 맡은 업무 팝업, 우클릭(관리자)하면 제외, 옆 `+` 는 멤버 배정. 클릭하면 그 사람이 이 프로젝트에서 맡은 작업 팝업, 우클릭(관리자)하면 제외, 옆 `+` 는 멤버 배정.
좌측 트리의 업무 클릭도 페이지 이동 없이 바로 팝업(이미 로드된 전체 업무 데이터 사용). 좌측 트리의 작업 클릭도 페이지 이동 없이 바로 팝업(이미 로드된 전체 작업 데이터 사용).
좌측 맨 위 **수신함**(미확인 @태그 배지)과 **내 업무**(접이식, 기본 접힘 — 업무를 고르면 좌측 맨 위 **수신함**(미확인 @태그 배지)과 **내 작업**(접이식, 기본 접힘 — 작업을 고르면
팝업이 열리며 다시 접힌다)가 있다. 예전 화면 오른쪽에 항상 떠 있던 "내 업무" 패널은 없앴고 팝업이 열리며 다시 접힌다)가 있다. 예전 화면 오른쪽에 항상 떠 있던 "내 작업" 패널은 없앴고
이 메뉴가 그 역할을 대신한다(레이아웃도 3열 → 2열). 이 메뉴가 그 역할을 대신한다(레이아웃도 3열 → 2열).
- **달력** — FullCalendar. 업무를 시작~마감 기간으로 표시. 클릭 편집. - **캘린더** — FullCalendar. 작업을 시작~마감 기간으로 표시. 클릭 편집.
- **타임라인** — vis-timeline(간트형). 기간 있는 업무만. - **타임라인** — vis-timeline(간트형). 기간 있는 작업만.
- **보드** — 세션별 칸반. 세션은 아사나처럼 **가로로 계속 늘어난다** — 화면을 넘치면 - **보드** — 섹션별 칸반. 섹션은 아사나처럼 **가로로 계속 늘어난다** — 화면을 넘치면
아래로 접히지 않고 보드가 가로로 스크롤된다(`.pj-board-canvas` = flex + `width:max-content`, 아래로 접히지 않고 보드가 가로로 스크롤된다(`.pj-board-canvas` = flex + `width:max-content`,
막대는 `attachHScrollIndicator` 가 직접 그린다. 예전 매이슨리 절대배치는 제거). 막대는 `attachHScrollIndicator` 가 직접 그린다. 예전 매이슨리 절대배치는 제거).
카드 안의 **담당자/마감일을 클릭하면 그 자리에서 바로 바꾼다**(담당자=멤버 목록 메뉴, 카드 안의 **담당자/마감일을 클릭하면 그 자리에서 바로 바꾼다**(담당자=멤버 목록 메뉴,
마감일=날짜 입력칸 + 지우기). 값이 없는 칩은 카드에 마우스를 올리면 흐리게 나타난다. 마감일=날짜 입력칸 + 지우기). 값이 없는 칩은 카드에 마우스를 올리면 흐리게 나타난다.
카드 드래그로 세션 이동(`PUT /api/tasks/{id}` `stage_id`, 카드 드래그로 섹션 이동(`PUT /api/tasks/{id}` `stage_id`,
멀티호밍된 업무는 `POST /api/tasks/{id}/links`). 같은 세션 안에서 드래그하면 멀티호밍된 작업은 `POST /api/tasks/{id}/links`). 같은 섹션 안에서 드래그하면
이동이 아니라 카드 순서만 바꾼다(`PUT /api/projects/{id}/stages/{stage_id}/tasks/order`, 이동이 아니라 카드 순서만 바꾼다(`PUT /api/projects/{id}/stages/{stage_id}/tasks/order`,
세션 재정렬과 같은 패턴 — `tasks.sort_order`를 그 세션 소속만 0부터 재배정). 섹션 재정렬과 같은 패턴 — `tasks.sort_order`를 그 섹션 소속만 0부터 재배정).
세션 컬럼 자체도 드래그로 재정렬(§1-1). 섹션 컬럼 자체도 드래그로 재정렬(§1-1).
- **리스트** — 표. - **목록** — 표.
- 4개 뷰 모두 툴바의 "이 프로젝트"/"전체 프로젝트" 스코프 토글을 따른다(§1-1). - 4개 뷰 모두 툴바의 "이 프로젝트"/"전체 프로젝트" 스코프 토글을 따른다(§1-1).
- 라이브러리는 현재 CDN 로드(스켈레톤). 추후 `app/static/vendor/` self-host 권장. - 라이브러리는 현재 CDN 로드(스켈레톤). 추후 `app/static/vendor/` self-host 권장.
@@ -152,7 +158,7 @@
- `app/mail.py` `send_email(...)` — `SMTP_HOST` 있어야 발송, 없으면 skip. STARTTLS/SSL/평문 지원. - `app/mail.py` `send_email(...)` — `SMTP_HOST` 있어야 발송, 없으면 skip. STARTTLS/SSL/평문 지원.
- env: `SMTP_HOST/PORT/USER/PASSWORD/FROM/TLS`, 수신자 `PROJECT_NOTIFY_EMAIL`(쉼표, 비우면 admin 전원). - env: `SMTP_HOST/PORT/USER/PASSWORD/FROM/TLS`, 수신자 `PROJECT_NOTIFY_EMAIL`(쉼표, 비우면 admin 전원).
- 트리거: 업무 신규 배정(생성/수정 시 담당자 변경) · 완료단계 진입. `BackgroundTasks` 비동기, 실패는 로그만. - 트리거: 작업 신규 배정(생성/수정 시 담당자 변경) · 완료단계 진입. `BackgroundTasks` 비동기, 실패는 로그만.
## 5. 배포 ## 5. 배포
@@ -166,8 +172,8 @@ docker exec -i postgres-db psql -U postgres -v app_password="$APP_PWD" \
# PROJECT_DB_URL=postgresql://project_app:<APP_PWD>@postgres-db:5432/project_db # PROJECT_DB_URL=postgresql://project_app:<APP_PWD>@postgres-db:5432/project_db
# (메일 쓰려면 SMTP_* 추가) # (메일 쓰려면 SMTP_* 추가)
# 3) 마이그레이션 002~008 적용 (첨부/알림, 세션 생성자·하위업무·멀티호밍, # 3) 마이그레이션 002~008 적용 (첨부/알림, 섹션 생성자·하위 작업·멀티호밍,
# 업무 시간, 세션 색상, 댓글 첨부, @태그) # 작업 시간, 섹션 색상, 댓글 첨부, @태그)
docker exec -i postgres-db psql -U postgres -d project_db \ docker exec -i postgres-db psql -U postgres -d project_db \
< scripts/sql/project_db_002_attachments_notifications.sql < scripts/sql/project_db_002_attachments_notifications.sql
docker exec -i postgres-db psql -U postgres -d project_db \ docker exec -i postgres-db psql -U postgres -d project_db \
@@ -200,7 +206,7 @@ description 을 항상 HTML로 취급하기 때문). 두 번 실행하면 이중
## 5-1. 설명란 링크 · @태그(멘션) ## 5-1. 설명란 링크 · @태그(멘션)
- **설명란 링크** — 업무 편집 팝업의 설명란(contenteditable)에 웹주소를 붙여넣으면 - **설명란 링크** — 작업 편집 팝업의 설명란(contenteditable)에 웹주소를 붙여넣으면
자동으로 `<a target="_blank" rel="noopener noreferrer">` 가 된다(`linkifyToHtml`). 자동으로 `<a target="_blank" rel="noopener noreferrer">` 가 된다(`linkifyToHtml`).
contenteditable 안에서는 브라우저가 링크를 기본으로 열지 않으므로 클릭을 직접 받아 contenteditable 안에서는 브라우저가 링크를 기본으로 열지 않으므로 클릭을 직접 받아
새 탭으로 연다. 서식바의 링크 버튼으로 만든 링크도 같은 속성으로 맞춘다 새 탭으로 연다. 서식바의 링크 버튼으로 만든 링크도 같은 속성으로 맞춘다
@@ -212,63 +218,63 @@ description 을 항상 HTML로 취급하기 때문). 두 번 실행하면 이중
서버는 설명란은 **저장될 HTML 에서 직접** 이메일을 뽑고(`store.extract_mentions_from_html`, 서버는 설명란은 **저장될 HTML 에서 직접** 이메일을 뽑고(`store.extract_mentions_from_html`,
화면이 보낸 목록을 믿지 않는다), 댓글은 받은 목록을 정규화해 쓴다. 화면이 보낸 목록을 믿지 않는다), 댓글은 받은 목록을 정규화해 쓴다.
새로 태그된 사람에게만 알림(`type=mention`)이 생긴다 — 같은 자리에서 중복 저장 안 됨. 새로 태그된 사람에게만 알림(`type=mention`)이 생긴다 — 같은 자리에서 중복 저장 안 됨.
- **수신함** (`/project/inbox`) — 위쪽 "나를 태그한 업무"(업무 1건당 1행, 최근 태그순. - **수신함** (`/project/inbox`) — 위쪽 "나를 태그한 작업"(작업 1건당 1행, 최근 태그순.
누르면 확인 처리, "열기"는 `?task=` 로 그 업무 편집 팝업까지 연다) + 아래쪽 "알림". 누르면 확인 처리, "열기"는 `?task=` 로 그 작업 편집 팝업까지 연다) + 아래쪽 "알림".
내 업무·프로젝트 화면과 같은 2단 레이아웃(좌측 공용 사이드바 + 우측 프레임)이다. 내 작업·프로젝트 화면과 같은 2단 레이아웃(좌측 공용 사이드바 + 우측 프레임)이다.
API: `GET /api/mentions`, `GET /api/mentions/unread-count`, `POST /api/mentions/read` API: `GET /api/mentions`, `GET /api/mentions/unread-count`, `POST /api/mentions/read`
(`task_id` 주면 그 업무만, 없으면 전부). (`task_id` 주면 그 작업만, 없으면 전부).
006 마이그레이션이 아직 안 돌아간 환경에서도 화면이 죽지 않게 조회/기록은 모두 감싸져 있다. 006 마이그레이션이 아직 안 돌아간 환경에서도 화면이 죽지 않게 조회/기록은 모두 감싸져 있다.
## 5-2. 업무 공유 링크 (퍼머링크) ## 5-2. 작업 공유 링크 (퍼머링크)
- 업무 편집 팝업의 **공유** 버튼(`#pj-share-task`)이 `{origin}/project/t/{task_id}` 를 - 작업 편집 팝업의 **공유** 버튼(`#pj-share-task`)이 `{origin}/project/t/{task_id}` 를
클립보드에 복사한다. 보드/리스트/달력/타임라인 카드 우클릭과 내 업무 목록 클립보드에 복사한다. 보드/목록/캘린더/타임라인 카드 우클릭과 내 작업 목록
우클릭의 "링크 복사"도 같은 함수(`shareTaskLink`)를 쓴다. 우클릭의 "링크 복사"도 같은 함수(`shareTaskLink`)를 쓴다.
`navigator.clipboard` 는 https 에서만 동작하므로 임시 textarea 폴백을 두고, `navigator.clipboard` 는 https 에서만 동작하므로 임시 textarea 폴백을 두고,
둘 다 실패하면 주소를 `prompt` 로 보여준다. 둘 다 실패하면 주소를 `prompt` 로 보여준다.
- `GET /project/t/{task_id}` 는 권한만 확인하고 `/project/p/{project_id}?task=` 로 - `GET /project/t/{task_id}` 는 권한만 확인하고 `/project/p/{project_id}?task=` 로
넘긴다(화면은 기존 경로가 그린다 — 업무가 다른 프로젝트로 옮겨가도 링크는 산다). 넘긴다(화면은 기존 경로가 그린다 — 작업이 다른 프로젝트로 옮겨가도 링크는 산다).
- 로그인 전이면 `/login?next=/project/t/{id}` 로 보내 **로그인 후 그 업무로 복귀**. - 로그인 전이면 `/login?next=/project/t/{id}` 로 보내 **로그인 후 그 작업으로 복귀**.
- `project` 모듈 권한 없음 / 업무 없음 / 그 프로젝트 멤버 아님 → 각각 403·404·403 - `project` 모듈 권한 없음 / 작업 없음 / 그 프로젝트 멤버 아님 → 각각 403·404·403
안내 화면(`denied.html`). 즉 **주소를 알아도 멤버가 아니면 못 본다**. 안내 화면(`denied.html`). 즉 **주소를 알아도 멤버가 아니면 못 본다**.
- 하위 업무 링크도 그 하위 업무 자신의 팝업으로 연다(목록엔 없으니 `GET /api/tasks/{id}` 로 받아 연다). - 하위 작업 링크도 그 하위 작업 자신의 팝업으로 연다(목록엔 없으니 `GET /api/tasks/{id}` 로 받아 연다).
- `?task=` 로 들어왔는데 그 업무가 화면 목록에 없으면(완료 세션 필터 등) - `?task=` 로 들어왔는데 그 작업이 화면 목록에 없으면(완료 섹션 필터 등)
`GET /api/tasks/{id}` 로 그 업무만 받아 팝업을 연다. `GET /api/tasks/{id}` 로 그 작업만 받아 팝업을 연다.
## 6. 댓글 · 첨부 · 알림센터 · 세션 편집 (구현됨) ## 6. 댓글 · 첨부 · 수신함 · 섹션 편집 (구현됨)
- **댓글** `task_comments` — 업무 모달 하단. 등록/삭제(본인·관리자). 새 댓글 시 관련자 인앱 알림. - **댓글** `task_comments` — 작업 모달 하단. 등록/삭제(본인·관리자). 새 댓글 시 관련자 인앱 알림.
- **업무 편집 팝업** — 버튼 줄(공유·완료·삭제·취소·저장)은 **팝업 맨 위에 고정** - **작업 편집 팝업** — 버튼 줄(공유·완료·삭제·취소·저장)은 **팝업 맨 위에 고정**
(`.pj-modal-actions-top`) — 카드가 flex column 이고 `.pj-modal-body` 만 스크롤하므로 sticky 없이 고정된다(sticky 는 카드 padding 안쪽에 붙어 바가 밀려 내려오고 제목을 덮었다). 설명/하위업무가 길어도 스크롤 없이 저장·취소한다. (`.pj-modal-actions-top`) — 카드가 flex column 이고 `.pj-modal-body` 만 스크롤하므로 sticky 없이 고정된다(sticky 는 카드 padding 안쪽에 붙어 바가 밀려 내려오고 제목을 덮었다). 설명/하위 작업이 길어도 스크롤 없이 저장·취소한다.
그 아래 메타(담당자·세션·우선순위·마감일 한 줄 — 마감일은 달력 아이콘 버튼, 좁으면 2×2 | 팔로워), 다시 그 아래 **설명란**과 그 아래 메타(담당자·섹션·우선순위·마감일 한 줄 — 마감일은 캘린더 아이콘 버튼, 좁으면 2×2 | 협업자), 다시 그 아래 **설명란**과
**하위 업무**가 각각 팝업 너비 전체를 쓰는 별도 행(`.pj-desc-block` / `.pj-subtask-full`, **하위 작업**가 각각 팝업 너비 전체를 쓰는 별도 행(`.pj-desc-block` / `.pj-subtask-full`,
그리드 `1 / -1`). 하위 업무는 제목 왼쪽 체크박스로 완료를 토글하고, 완료된 줄은 그리드 `1 / -1`). 하위 작업은 제목 왼쪽 체크박스로 완료를 토글하고, 완료된 줄은
반투명(50%) + 취소선. 좁은 화면과 "새 업무"(compact)에서는 단일 컬럼으로 흐른다. 반투명(50%) + 취소선. 좁은 화면과 "새 작업"(compact)에서는 단일 컬럼으로 흐른다.
- **첨부** `task_attachments` — 업무 모달. 파일 업로드(최대 20MB)/다운로드/삭제. 실제 파일은 `DATA_DIR/project/<task_id>/<uuid>.<ext>`, DB엔 메타만. 첨부 디렉토리는 운영 볼륨(DATA_DIR)에 저장돼 재배포에도 보존. 설명란 이미지 삽입도 이 표를 재사용(§1-1). - **첨부** `task_attachments` — 작업 모달. 파일 업로드(최대 20MB)/다운로드/삭제. 실제 파일은 `DATA_DIR/project/<task_id>/<uuid>.<ext>`, DB엔 메타만. 첨부 디렉토리는 운영 볼륨(DATA_DIR)에 저장돼 재배포에도 보존. 설명란 이미지 삽입도 이 표를 재사용(§1-1).
- **세션 편집** — 보드 칸반 헤더(아사나식): 이름 바로 오른쪽에 업무 수(숫자만), 오른쪽 끝 **+**(업무 추가)· - **섹션 편집** — 보드 칸반 헤더(아사나식): 이름 바로 오른쪽에 작업 수(숫자만), 오른쪽 끝 **+**(작업 추가)·
**…**(메뉴: 업무 추가 / 이름 변경 / 세션 편집(색상·기본 담당자) / 세션 업무 모두 완료 / 완료 세션 지정·해제 / 삭제, **…**(메뉴: 작업 추가 / 이름 변경 / 섹션 편집(색상·기본 담당자) / 섹션 작업 모두 완료 / 완료 섹션 지정·해제 / 삭제,
헤더 우클릭도 같은 메뉴). 이름 클릭 = 그 자리 이름 변경. 트레일링 "+ 세션 추가", **컬럼 드래그로 순서 변경**. `PUT .../stages/order`, `PUT .../stages/{id}`, 삭제는 만든 사람만. 헤더 우클릭도 같은 메뉴). 이름 클릭 = 그 자리 이름 변경. 트레일링 "+ 섹션 추가", **컬럼 드래그로 순서 변경**. `PUT .../stages/order`, `PUT .../stages/{id}`, 삭제는 만든 사람만.
- **알림센터(인앱)** `project_notifications` — 배정/완료/댓글 시 수신자별 알림 생성. 우측 상단 벨(미읽음 배지) → `/project/inbox`. 항목 클릭=읽음, "모두 읽음". 본인 행동은 알림 제외. - **수신함(인앱)** `project_notifications` — 배정/완료/댓글 시 수신자별 알림 생성. 우측 상단 벨(미읽음 배지) → `/project/inbox`. 항목 클릭=읽음, "모두 읽음". 본인 행동은 알림 제외.
- 마이그레이션: `scripts/sql/project_db_002_attachments_notifications.sql` (첨부·알림 테이블 + 권한), `scripts/sql/project_db_003_sections_subtasks_links.sql` (세션 생성자·하위업무·멀티호밍). - 마이그레이션: `scripts/sql/project_db_002_attachments_notifications.sql` (첨부·알림 테이블 + 권한), `scripts/sql/project_db_003_sections_subtasks_links.sql` (섹션 생성자·하위 작업·멀티호밍).
## 6-1. 실시간 반영 · 성능 ## 6-1. 실시간 반영 · 성능
- **live-version** — `GET /api/live-version` 이 돌려주는 값이 바뀌면 화면이 조용히 다시 받는다. - **live-version** — `GET /api/live-version` 이 돌려주는 값이 바뀌면 화면이 조용히 다시 받는다.
007 마이그레이션의 문장 단위 트리거가 projects·members·stages·tasks·comments·attachments· 007 마이그레이션의 문장 단위 트리거가 projects·members·stages·tasks·comments·attachments·
links(+ mentions INSERT) 변경 때마다 `project_live_version.version` 을 1 올린다 — 삭제·세션 links(+ mentions INSERT) 변경 때마다 `project_live_version.version` 을 1 올린다 — 삭제·섹션
이름변경·첨부 추가까지 감지되고, 서버는 PK 한 줄만 읽는다. 007 미적용이면 예전 MAX() 방식 이름변경·첨부 추가까지 감지되고, 서버는 PK 한 줄만 읽는다. 007 미적용이면 예전 MAX() 방식
(삭제 감지 못함)으로 자동 폴백하고 5분마다 다시 확인한다. (삭제 감지 못함)으로 자동 폴백하고 5분마다 다시 확인한다.
- 화면은 열자마자 기준값을 잡고, 탭이 안 보이는 동안(`document.hidden`)은 묻지 않는다. - 화면은 열자마자 기준값을 잡고, 탭이 안 보이는 동안(`document.hidden`)은 묻지 않는다.
바뀌면 `GET /api/projects/{id}/snapshot`(업무+세션+멤버 한 번에)으로 이 프로젝트 맥락의 바뀌면 `GET /api/projects/{id}/snapshot`(작업+섹션+멤버 한 번에)으로 이 프로젝트 맥락의
행을 통째로 바꿔 끼운다(삭제된 업무도 사라짐). 행을 통째로 바꿔 끼운다(삭제된 작업도 사라짐).
- 프로젝트 화면은 접근 가능한 모든 프로젝트의 업무/세션을 각각 **쿼리 한 번**으로 읽는다 - 프로젝트 화면은 접근 가능한 모든 프로젝트의 작업/섹션을 각각 **쿼리 한 번**으로 읽는다
(`list_tasks_for_projects`, `list_stages_for_projects`). 행마다 `context_project_id`· (`list_tasks_for_projects`, `list_stages_for_projects`). 행마다 `context_project_id`·
`is_linked`·`home_stage_id` 가 붙는다 — 연결 업무 행의 `stage_id` 는 연결된 쪽 세션이고, `is_linked`·`home_stage_id` 가 붙는다 — 연결 작업 행의 `stage_id` 는 연결된 쪽 섹션이고,
업무 편집 팝업의 "세션" 선택은 항상 `home_stage_id`(원래 소속)를 쓴다. 작업 편집 팝업의 "섹션" 선택은 항상 `home_stage_id`(원래 소속)를 쓴다.
- 라우터 핸들러는 전부 `def`(sync) — DB 드라이버가 동기라 `async def` 면 쿼리 동안 이벤트 - 라우터 핸들러는 전부 `def`(sync) — DB 드라이버가 동기라 `async def` 면 쿼리 동안 이벤트
루프 전체가 멈춘다. 첨부 업로드는 한도+1 바이트까지만 읽는다. 루프 전체가 멈춘다. 첨부 업로드는 한도+1 바이트까지만 읽는다.
- 첨부 `/inline` 은 png/jpeg/gif/webp/bmp 만 화면에 띄우고 나머지(html·svg 등)는 다운로드로 - 첨부 `/inline` 은 png/jpeg/gif/webp/bmp 만 화면에 띄우고 나머지(html·svg 등)는 다운로드로
내려준다(`X-Content-Type-Options: nosniff` + CSP sandbox). 업무/프로젝트/댓글 삭제 시 내려준다(`X-Content-Type-Options: nosniff` + CSP sandbox). 작업/프로젝트/댓글 삭제 시
디스크 첨부도 같이 지운다. 디스크 첨부도 같이 지운다.
- 설명란 sanitizer 는 URL 을 허용 목록(http/https/mailto/tel/상대경로, img 는 png·jpeg 등 - 설명란 sanitizer 는 URL 을 허용 목록(http/https/mailto/tel/상대경로, img 는 png·jpeg 등
data: 이미지)으로 검사한다 — 금지 목록은 `jav&#x09;ascript:` 로 우회됐다. data: 이미지)으로 검사한다 — 금지 목록은 `jav&#x09;ascript:` 로 우회됐다.
@@ -276,67 +282,67 @@ description 을 항상 HTML로 취급하기 때문). 두 번 실행하면 이중
## 6-2. 검색 · 필터 · 정렬 ## 6-2. 검색 · 필터 · 정렬
- **전체 검색** — 좌측 사이드바 맨 위 검색창(`#pj-global-search`, 어디서든 `/` 키). 2글자 이상이면 - **전체 검색** — 좌측 사이드바 맨 위 검색창(`#pj-global-search`, 어디서든 `/` 키). 2글자 이상이면
`GET /api/search?q=` 로 내가 볼 수 있는 프로젝트의 업무(하위 업무 포함)를 제목·설명·댓글에서 `GET /api/search?q=` 로 내가 볼 수 있는 프로젝트의 작업(하위 작업 포함)를 제목·설명·댓글에서
찾는다. 설명은 HTML 이라 DB 에서 넉넉히 가져와 본문 텍스트로 다시 확인한다(태그 이름에만 찾는다. 설명은 HTML 이라 DB 에서 넉넉히 가져와 본문 텍스트로 다시 확인한다(태그 이름에만
걸린 결과 제거). 결과에 "설명/댓글" 어디서 걸렸는지와 미리보기. 누르면 `/project/t/{id}`. 걸린 결과 제거). 결과에 "설명/댓글" 어디서 걸렸는지와 미리보기. 누르면 `/project/t/{id}`.
008 의 pg_trgm GIN 인덱스(title·description·comment body)가 `ILIKE '%…%'` 를 받쳐준다. 008 의 pg_trgm GIN 인덱스(title·description·comment body)가 `ILIKE '%…%'` 를 받쳐준다.
- **필터 바** — 프로젝트 화면(`#pj-filterbar`): 찾기(제목·설명·담당자·세션) · 상태 · 담당자 - **필터 바** — 프로젝트 화면(`#pj-filterbar`): 찾기(제목·설명·담당자·섹션) · 상태 · 담당자
(나/없음/특정인) · 마감(지남/오늘/이번 주/없음) · 우선순위 · 정렬(기본/마감일/우선순위/제목/ (나/없음/특정인) · 마감(지남/오늘/이번 주/없음) · 우선순위 · 정렬(기본/마감일/우선순위/제목/
담당자/최근 생성). 서버 재조회 없이 `visibleTasks()`(스코프 → 필터 → 정렬)에서 거르므로 담당자/최근 생성). 서버 재조회 없이 `visibleTasks()`(스코프 → 필터 → 정렬)에서 거르므로
보드·리스트·달력·타임라인·대시보드 모두에 적용된다. 프로젝트별로 localStorage 에 기억. 보드·목록·캘린더·타임라인·대시보드 모두에 적용된다. 프로젝트별로 localStorage 에 기억.
필터나 정렬이 켜져 있으면 보드 카드 순서 드래그는 막는다(가려진 카드 때문에 순서가 어긋남). 필터나 정렬이 켜져 있으면 보드 카드 순서 드래그는 막는다(가려진 카드 때문에 순서가 어긋남).
리스트는 열 제목 클릭 정렬이 우선. 내 업무 화면에도 찾기·마감·우선순위 필터(`#pj-mt-filterbar`). 목록은 열 제목 클릭 정렬이 우선. 내 작업 화면에도 찾기·마감·우선순위 필터(`#pj-mt-filterbar`).
공용 로직: `taskMatchesFilter` / `sortTasksBy`. 공용 로직: `taskMatchesFilter` / `sortTasksBy`.
## 6-3. 팔로워 · 마감 알림 ## 6-3. 협업자 · 마감 알림
- **팔로워**(`task_followers`, 008) — 아사나의 협업자. 업무 팝업 메타 목록의 "팔로워" 줄에서 - **협업자**(`task_followers`, 008) — 아사나의 협업자. 작업 팝업 메타 목록의 "협업자" 줄에서
추가(+ → 프로젝트 멤버)/빼기(×)/내 팔로우 토글. 즉시 저장(저장 버튼과 무관). 추가(+ → 프로젝트 멤버)/빼기(×)/내 팔로우 토글. 즉시 저장(저장 버튼과 무관).
자동 팔로우: 만든 사람 · 담당자(배정 시) · 댓글 단 사람 · @태그된 사람. 008 이 기존 업무에도 자동 팔로우: 만든 사람 · 담당자(배정 시) · 댓글 단 사람 · @태그된 사람. 008 이 기존 작업에도
같은 규칙으로 백필한다. API: `GET/POST /api/tasks/{id}/followers`(body `email`, 없으면 나), 같은 규칙으로 백필한다. API: `GET/POST /api/tasks/{id}/followers`(body `email`, 없으면 나),
`DELETE /api/tasks/{id}/followers/{email}` — 다른 사람은 그 프로젝트 멤버·owner·관리자만 추가 가능. `DELETE /api/tasks/{id}/followers/{email}` — 다른 사람은 그 프로젝트 멤버·owner·관리자만 추가 가능.
- **알림 수신자 변경** — 완료·댓글 인앱 알림은 이제 "담당자 + 팔로워"에게만 간다(예전: 프로젝트 - **알림 수신자 변경** — 완료·댓글 인앱 알림은 이제 "담당자 + 협업자"에게만 간다(예전: 프로젝트
멤버 전원). 008 미적용이면 예전 방식으로 폴백. 멤버 전원). 008 미적용이면 예전 방식으로 폴백.
- **마감 알림**(`reminders.py`) — 웹 프로세스 안 데몬 스레드가 5분마다 깨어, 영업일(주말· - **마감 알림**(`reminders.py`) — 웹 프로세스 안 데몬 스레드가 5분마다 깨어, 영업일(주말·
`KR_HOLIDAYS` 제외) 설정 시각(`PROJECT_REMINDER_HOUR`, 기본 9시 KST) 이후 하루 한 번 돈다. `KR_HOLIDAYS` 제외) 설정 시각(`PROJECT_REMINDER_HOUR`, 기본 9시 KST) 이후 하루 한 번 돈다.
`due_soon`(다음 영업일까지 마감 — 금요일이면 주말·월요일분까지) · `due_today` · `overdue` `due_soon`(다음 영업일까지 마감 — 금요일이면 주말·월요일분까지) · `due_today` · `overdue`
(최근 7일 이내 마감분). 수신자는 담당자, 없으면 팔로워. `task_reminders` UNIQUE(업무·종류· (최근 7일 이내 마감분). 수신자는 담당자, 없으면 협업자. `task_reminders` UNIQUE(작업·종류·
마감일·수신자)로 한 번만 — 재기동·중복 실행에도 안전, 마감일을 바꾸면 다시 알린다. 마감일·수신자)로 한 번만 — 재기동·중복 실행에도 안전, 마감일을 바꾸면 다시 알린다.
`PROJECT_REMINDER_EMAIL=true` 면 사람별 요약 메일 1통(SMTP 필요). `PROJECT_REMINDERS=false` 로 끔. `PROJECT_REMINDER_EMAIL=true` 면 사람별 요약 메일 1통(SMTP 필요). `PROJECT_REMINDERS=false` 로 끔.
## 6-4. 세션 기본 담당자 (마이그레이션 009) ## 6-4. 섹션 기본 담당자 (마이그레이션 009)
- `project_stages.default_assignee_email`(TEXT, '' = 미지정). 세션 편집 창(✎ / "+ 세션 추가")의 - `project_stages.default_assignee_email`(TEXT, '' = 미지정). 섹션 편집 창(✎ / "+ 섹션 추가")의
"기본 담당자" 에서 지정 — 후보는 업무 담당자와 같다(프로젝트 멤버 + owner, 서버도 검증). "기본 담당자" 에서 지정 — 후보는 작업 담당자와 같다(프로젝트 멤버 + owner, 서버도 검증).
- **자동 배정 규칙**(`db._stage_default_assignee`) — 담당자가 **비어 있는** 업무만: - **자동 배정 규칙**(`db._stage_default_assignee`) — 담당자가 **비어 있는** 작업만:
· 그 세션에 업무 생성(`create_task`, 하위 업무 제외) · 그 섹션에 작업 생성(`create_task`, 하위 작업 제외)
· 다른 세션에서 그 세션으로 이동(`update_task` 의 `stage_id` 변경 — 카드 드래그·업무 팝업 세션 변경) · 다른 섹션에서 그 섹션으로 이동(`update_task` 의 `stage_id` 변경 — 카드 드래그·작업 팝업 섹션 변경)
이미 담당자가 있으면 그대로. 지정된 사람이 프로젝트 멤버에서 빠졌으면 무시. 이미 담당자가 있으면 그대로. 지정된 사람이 프로젝트 멤버에서 빠졌으면 무시.
자동 배정도 일반 배정과 같이 활동이력·팔로워·인앱 알림·메일이 나간다(`_newly_assigned`). 자동 배정도 일반 배정과 같이 활동이력·협업자·인앱 알림·메일이 나간다(`_newly_assigned`).
멀티호밍으로 연결된 프로젝트 쪽 세션 이동(`/links`)은 대상 아님. 멀티호밍으로 연결된 프로젝트 쪽 섹션 이동(`/links`)은 대상 아님.
- 보드 세션 머리 이름 옆에 기본 담당자 아바타(작게, 툴팁). 새 업무 팝업은 그 세션 기본 담당자를 미리 채운다. - 보드 섹션 머리 이름 옆에 기본 담당자 아바타(작게, 툴팁). 새 작업 팝업은 그 섹션 기본 담당자를 미리 채운다.
- 009 미적용이어도 앱은 동작 — 조회는 `to_jsonb(행)->>'default_assignee_email'` 로 컬럼 유무와 - 009 미적용이어도 앱은 동작 — 조회는 `to_jsonb(행)->>'default_assignee_email'` 로 컬럼 유무와
무관, 지정 시도만 503("마이그레이션 009 필요"). 화면은 기본 담당자가 바뀐 경우에만 필드를 보낸다. 무관, 지정 시도만 503("마이그레이션 009 필요"). 화면은 기본 담당자가 바뀐 경우에만 필드를 보낸다.
## 6-5. 휴지통 (마이그레이션 010) ## 6-5. 휴지통 (마이그레이션 010)
- 업무를 지우면(하위 업무 CASCADE 포함) **지우기 직전 스냅샷**을 같은 트랜잭션에서 `project_trash.payload`(JSONB)에 - 작업을 지우면(하위 작업 CASCADE 포함) **지우기 직전 스냅샷**을 같은 트랜잭션에서 `project_trash.payload`(JSONB)에
남긴 뒤 예전처럼 삭제한다(`db.delete_task` → `(ids, trash_id)`). 스냅샷 = `tasks` + 딸린 테이블 남긴 뒤 예전처럼 삭제한다(`db.delete_task` → `(ids, trash_id)`). 스냅샷 = `tasks` + 딸린 테이블
`task_comments · task_followers · task_mentions · task_attachments · task_project_links · project_activity · `task_comments · task_followers · task_mentions · task_attachments · task_project_links · project_activity ·
task_reminders`(`TRASH_CHILD_TABLES`). 알림(`project_notifications`)은 되살리면 수신함이 옛 알림으로 차서 제외. task_reminders`(`TRASH_CHILD_TABLES`). 알림(`project_notifications`)은 되살리면 수신함이 옛 알림으로 차서 제외.
모든 조회 쿼리에 "삭제됨" 필터를 넣는 소프트 삭제 대신 이 방식 — 기존 화면·쿼리를 안 건드린다. 모든 조회 쿼리에 "삭제됨" 필터를 넣는 소프트 삭제 대신 이 방식 — 기존 화면·쿼리를 안 건드린다.
- 첨부 실물은 지우지 않고 `DATA_DIR/project/_trash/<trash_id>/<task_id>/` 로 옮긴다(복구 시 되돌림). - 첨부 실물은 지우지 않고 `DATA_DIR/project/_trash/<trash_id>/<task_id>/` 로 옮긴다(복구 시 되돌림).
- **보관 3개월**(`expires_at`). 휴지통 화면을 열거나 업무를 지울 때 만료분을 영구 삭제(`_purge_trash`). - **보관 3개월**(`expires_at`). 휴지통 화면을 열거나 작업을 지울 때 만료분을 영구 삭제(`_purge_trash`).
- **관리자 전용**: 좌측 "휴지통" 메뉴·`/project/trash` 화면·`POST /project/api/trash/{id}/restore` 모두 `is_admin`. - **관리자 전용**: 좌측 "휴지통" 메뉴·`/project/trash` 화면·`POST /project/api/trash/{id}/restore` 모두 `is_admin`.
복구는 원래 id 그대로(`restore_trash`): 같은 id 가 이미 있으면 거부, 프로젝트가 지워졌으면 거부, 하위 업무만 복구는 원래 id 그대로(`restore_trash`): 같은 id 가 이미 있으면 거부, 프로젝트가 지워졌으면 거부, 하위 작업만
지웠는데 상위가 없으면 거부(상위 먼저 복구). 지워진 세션은 세션 없이, 지워진 프로젝트를 가리키는 연결/이력은 뺀다. 지웠는데 상위가 없으면 거부(상위 먼저 복구). 지워진 섹션은 섹션 없이, 지워진 프로젝트를 가리키는 연결/이력은 뺀다.
복구하면 휴지통 행은 지운다. 복구하면 휴지통 행은 지운다.
- 화면: 삭제 확인은 `confirmTaskDelete` 하나 — 하위 업무가 있으면 "하위 업무 N개까지 모두 삭제"를 분명히 묻는다. - 화면: 삭제 확인은 `confirmTaskDelete` 하나 — 하위 작업이 있으면 "하위 작업 N개까지 모두 삭제"를 분명히 묻는다.
카드의 하위 업무 줄 우클릭 = 열기 / 완료 / **하위 업무 삭제**. 삭제 후 토스트 "휴지통으로 옮겼습니다". 카드의 하위 작업 줄 우클릭 = 열기 / 완료 / **하위 작업 삭제**. 삭제 후 토스트 "휴지통으로 옮겼습니다".
- 010 미적용이면 휴지통 없이 예전처럼 영구 삭제(휴지통 화면에 안내). - 010 미적용이면 휴지통 없이 예전처럼 영구 삭제(휴지통 화면에 안내).
- 프로젝트 삭제(업무 전체 CASCADE)와 댓글 삭제는 아직 휴지통 대상이 아니다. - 프로젝트 삭제(작업 전체 CASCADE)와 댓글 삭제는 아직 휴지통 대상이 아니다.
## 7. 추후 단계 ## 7. 추후 단계
업무 라벨(태그 분류) · 반복 업무 · 템플릿 · 업무 의존성 · 하위 업무의 하위 업무(다단계 중첩, 작업 라벨(태그 분류) · 반복 작업 · 템플릿 · 작업 의존성 · 하위 작업의 하위 작업(다단계 중첩,
아사나도 UI상 1단계만 허용해 현재 의도적으로 안 함). 아사나도 UI상 1단계만 허용해 현재 의도적으로 안 함).