-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnotes.php
More file actions
152 lines (135 loc) · 6.69 KB
/
Copy pathnotes.php
File metadata and controls
152 lines (135 loc) · 6.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<?php
/**
* Phase 139 (2026-08-14) — Quick Notes.
*
* Review/manage notes captured via the /log command bar shortcut. Every
* note here belongs strictly to the logged-in user — no RBAC screen gate
* beyond being authenticated, matching profile.php/time-entries.php's
* self-service pattern, since ownership by user_id IS the access control.
*/
require_once __DIR__ . '/config.php';
require_once __DIR__ . '/inc/i18n.php';
require_once __DIR__ . '/inc/rbac.php';
require_once __DIR__ . '/inc/session-bootstrap.php';
sess_bootstrap_auto();
session_start();
if (empty($_SESSION['user_id'])) {
header('Location: login.php');
exit;
}
require_once __DIR__ . '/inc/force-pw-change.php';
force_pw_change_redirect();
$theme = $_SESSION['day_night'] ?? 'Day';
$bs_theme = ($theme === 'Night') ? 'dark' : 'light';
$csrf = csrf_token();
?>
<!DOCTYPE html>
<html lang="<?php echo e(i18n_lang()); ?>" data-bs-theme="<?php echo $bs_theme; ?>">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="<?php echo e($csrf); ?>">
<title>Quick Notes — <?php echo e(t('login.title', 'Tickets NewUI')); ?> <?php echo newui_version(); ?></title>
<link rel="stylesheet" href="assets/vendor/bootstrap/bootstrap.min.css">
<link rel="stylesheet" href="assets/vendor/bootstrap/bootstrap-icons.min.css">
<link rel="stylesheet" href="assets/css/dashboard.css">
<link rel="stylesheet" href="assets/css/sop.css">
<link rel="stylesheet" href="assets/css/notes.css?v=<?php echo newui_version(); ?>">
</head>
<body>
<?php include_once NEWUI_ROOT . '/inc/navbar.php'; ?>
</header>
<div class="container-fluid p-3">
<div class="d-flex align-items-center justify-content-between mb-3">
<h5 class="mb-0"><i class="bi bi-journal-richtext text-primary me-2"></i>Quick Notes</h5>
<div class="text-body-secondary small">Captured with <code>/log <text></code> in the command bar. Notes here are private to you.</div>
</div>
<div id="alertArea"></div>
<div class="row g-3 mb-3">
<div class="col-12">
<div class="input-group input-group-sm">
<span class="input-group-text"><i class="bi bi-plus-lg"></i></span>
<input type="text" id="newNoteInput" class="form-control form-control-sm" placeholder="Type a note and press Enter…" autocomplete="off" aria-label="Type a new quick note">
</div>
</div>
</div>
<div class="row g-3">
<!-- ═══════════ LEFT: Notes list ═══════════ -->
<div class="col-md-7">
<div class="card">
<div class="card-header d-flex align-items-center py-2">
<span class="fw-semibold small">Notes</span>
<div class="btn-group btn-group-sm ms-auto" role="group" id="notesFilterGroup">
<button type="button" class="btn btn-outline-secondary active" data-filter="all">All</button>
<button type="button" class="btn btn-outline-secondary" data-filter="open">Open</button>
<button type="button" class="btn btn-outline-secondary" data-filter="done">Done</button>
</div>
</div>
<div class="card-body p-0">
<div id="notesList" class="list-group list-group-flush"></div>
<div id="notesEmpty" class="p-3 text-body-secondary small d-none">
No notes yet — type <code>/log <text></code> in the command bar, or use the box above.
</div>
</div>
</div>
</div>
<!-- ═══════════ RIGHT: Personal wiki tree (drop target) ═══════════ -->
<div class="col-md-5">
<div class="card">
<div class="card-header d-flex align-items-center py-2">
<i class="bi bi-diagram-3 me-2"></i>
<span class="fw-semibold small">Your Personal Wiki Pages</span>
<button type="button" class="btn btn-sm btn-outline-success ms-auto py-0 px-1" id="btnNewWikiPage" title="New personal page">
<i class="bi bi-plus-lg"></i>
</button>
</div>
<div class="card-body p-2">
<div class="small text-body-secondary mb-2">
Drag a note onto a page below to copy or move its text there.
</div>
<div id="wikiTree" class="sop-tree"></div>
<div id="wikiTreeEmpty" class="text-body-secondary small p-2 d-none">
No personal pages yet. Click <i class="bi bi-plus-lg"></i> above, or drop a note and name a new page.
</div>
</div>
</div>
</div>
</div>
</div>
<!-- ═══════════ Send-to modal (incident activity log / ICS-214) ═══════════ -->
<div class="modal fade" id="sendToModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header py-2">
<h6 class="modal-title" id="sendToModalTitle">Send note</h6>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body" id="sendToModalBody"></div>
</div>
</div>
</div>
<!-- ═══════════ Wiki drop confirm (copy vs move) ═══════════ -->
<div class="modal fade" id="wikiDropModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header py-2">
<h6 class="modal-title">Send to <span id="wikiDropPageName"></span></h6>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div class="d-flex gap-2">
<button type="button" class="btn btn-sm btn-primary" id="wikiDropCopyBtn" autofocus>
<i class="bi bi-files me-1"></i>Copy (note stays here too)
</button>
<button type="button" class="btn btn-sm btn-outline-secondary" id="wikiDropMoveBtn">
<i class="bi bi-arrow-right me-1"></i>Move (removed from your list)
</button>
</div>
</div>
</div>
</div>
</div>
<script src="assets/vendor/bootstrap/bootstrap.bundle.min.js"></script>
<script src="assets/js/quick-notes.js?v=<?php echo newui_version(); ?>"></script>
</body>
</html>