diff --git a/Asset/js/relocate.js b/Asset/js/relocate.js
new file mode 100644
index 0000000..ce0ec9b
--- /dev/null
+++ b/Asset/js/relocate.js
@@ -0,0 +1,56 @@
+/*
+ * OrganonTweaks -- place the "Remove this Column" entry inside the native column menu.
+ *
+ * Kanboard only exposes the template:board:column:dropdown hook AFTER the column menu
+ *
, and its dropdown JS clones just that when the menu opens. So the hook item
+ * cannot reach the menu on its own. column_dropdown.php renders the item hidden next to
+ * the menu; this script moves each such item into that column's real so it appears
+ * alongside the native entries. It re-runs when the board is redrawn (AJAX polling /
+ * drag-and-drop refresh).
+ */
+(function () {
+ "use strict";
+
+ function relocate() {
+ var items = document.querySelectorAll(".organontweaks-remove-column-item");
+
+ for (var i = 0; i < items.length; i++) {
+ var li = items[i];
+
+ // Already moved into a menu list: just make sure it is visible.
+ if (li.closest("ul")) {
+ li.style.display = "";
+ continue;
+ }
+
+ // The hook renders the item as a child of the column's dropdown wrapper;
+ // its first is the native menu.
+ var menu = li.parentNode ? li.parentNode.querySelector("ul") : null;
+
+ if (menu) {
+ menu.appendChild(li);
+ li.style.display = "";
+ }
+ }
+ }
+
+ function init() {
+ if (!document.getElementById("board")) {
+ return;
+ }
+
+ relocate();
+
+ var container = document.getElementById("board-container");
+
+ if (container && window.MutationObserver) {
+ new MutationObserver(relocate).observe(container, { childList: true, subtree: true });
+ }
+ }
+
+ if (document.readyState === "loading") {
+ document.addEventListener("DOMContentLoaded", init);
+ } else {
+ init();
+ }
+})();
diff --git a/Controller/ColumnController.php b/Controller/ColumnController.php
new file mode 100644
index 0000000..e6d49ec
--- /dev/null
+++ b/Controller/ColumnController.php
@@ -0,0 +1,71 @@
+getProject();
+ $column_id = $this->request->getIntegerParam('column_id');
+ $this->checkAccess($project['id'], $column_id);
+
+ $this->response->html($this->template->render('organonTweaks:board/remove_column', array(
+ 'project' => $project,
+ 'column' => $this->columnModel->getColumnTitleById($column_id),
+ 'column_id' => $column_id,
+ )));
+ }
+
+ /**
+ * Remove the column and return to the board.
+ */
+ public function remove()
+ {
+ $project = $this->getProject();
+ $values = $this->request->getValues();
+ $column_id = isset($values['column_id']) ? (int) $values['column_id'] : 0;
+
+ $this->checkAccess($project['id'], $column_id);
+
+ if ($this->columnModel->remove($column_id)) {
+ $this->flash->success(t('Column removed successfully.'));
+ } else {
+ $this->flash->failure(t('Unable to remove this column.'));
+ }
+
+ $this->response->redirect($this->helper->url->to('BoardViewController', 'show', array('project_id' => $project['id'])));
+ }
+
+ /**
+ * Allow only users who can manage columns, and only for a column with no tasks at all
+ * (open or closed) -- ColumnModel::remove() is a bare delete, so a non-empty column
+ * would orphan its tasks.
+ */
+ private function checkAccess($project_id, $column_id)
+ {
+ if (! $this->helper->user->hasProjectAccess('ColumnController', 'remove', $project_id)) {
+ throw new AccessForbiddenException();
+ }
+
+ $count = $this->taskFinderModel->countByColumnId(
+ $project_id,
+ $column_id,
+ array(TaskModel::STATUS_OPEN, TaskModel::STATUS_CLOSED)
+ );
+
+ if ($count > 0) {
+ throw new AccessForbiddenException();
+ }
+ }
+}
diff --git a/Helper/OrganonColumnHelper.php b/Helper/OrganonColumnHelper.php
new file mode 100644
index 0000000..b11d6c9
--- /dev/null
+++ b/Helper/OrganonColumnHelper.php
@@ -0,0 +1,31 @@
+taskFinderModel->countByColumnId(
+ $project_id,
+ $column_id,
+ array(TaskModel::STATUS_OPEN, TaskModel::STATUS_CLOSED)
+ );
+
+ self::$emptyCache[$column_id] = ($count === 0);
+ }
+
+ return self::$emptyCache[$column_id];
+ }
+}
diff --git a/Template/board/column_dropdown.php b/Template/board/column_dropdown.php
new file mode 100644
index 0000000..05b3108
--- /dev/null
+++ b/Template/board/column_dropdown.php
@@ -0,0 +1,12 @@
+user->hasProjectAccess('ColumnController', 'remove', $column['project_id']) && $this->OrganonColumnHelper->hasNoTasks($column['project_id'], $column['id'])): ?>
+ by the only column hook, then moved into it by
+ Asset/js/relocate.js. Hidden until relocated so it never flashes in the header.
+ Shown only for empty columns (no open or closed tasks). */ ?>
+ -
+ = $this->modal->confirm('trash-o', t('Remove this Column'), 'ColumnController', 'confirm', array(
+ 'plugin' => 'OrganonTweaks',
+ 'project_id' => $column['project_id'],
+ 'column_id' => $column['id'],
+ )) ?>
+
+
diff --git a/Template/board/remove_column.php b/Template/board/remove_column.php
new file mode 100644
index 0000000..845b03c
--- /dev/null
+++ b/Template/board/remove_column.php
@@ -0,0 +1,17 @@
+
+
+