Skip to content

Commit

Permalink
Merge pull request #1 from manne65-hd/kb-1.2.9
Browse files Browse the repository at this point in the history
Made adjustments for Kanboard 1.2.9
  • Loading branch information
manne65-hd authored Mar 22, 2020
2 parents 7241498 + 9530d69 commit e4bb568
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public function initialize()
{
$this->template->setTemplateOverride('project_header/views', 'SortBoardByDates:project_header/views');
$this->template->setTemplateOverride('board/table_tasks', 'SortBoardByDates:board/table_tasks');
$this->template->setTemplateOverride('board/table_column', 'SortBoardByDates:board/table_column');
$this->template->hook->attach('template:project:dropdown', 'SortBoardByDates:board/dropdown');
$this->template->hook->attach('template:project:sidebar', 'SortBoardByDates:board/sidebar');
}
Expand All @@ -37,7 +38,7 @@ public function getPluginAuthor()

public function getPluginVersion()
{
return '0.5.0';
return '0.6.0';
}

public function getPluginHomepage()
Expand All @@ -47,6 +48,6 @@ public function getPluginHomepage()

public function getCompatibleVersion()
{
return '>=1.2.8';
return '>=1.2.9';
}
}
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Sort Board By Dates for kanboard
Allows boards to be sorted by different dates
- Date due, started, created, modified, moved, closed ...
- ... or *(of course)* in kanboard default-mode
- The new actions to reorder tasks by column *(coming with Kanboard 1.2.9)* are ONLY displayed, if the current board is set to kanboard's default sort-method!
- ONLY project-managers/admins can set the preferences via a new "Board sort-settings"-panel on a per-project base
- includes german translation

Expand All @@ -25,10 +26,18 @@ Besides the option to configure this plugin in the new settings-panel via *Confi
![New ProjectDropdown](https://user-images.githubusercontent.com/48651533/77249294-53ed7880-6c40-11ea-9e30-b9ae1fece58b.png)

#### Board-view
If any other than the default sort-method is selected, there are icons next to the *board-TAB* indicating that sort-method. In addition you can get a plaintext-tooltip by hovering the mouse over that icon.
If any other than the default sort-method is selected, there is an icon next to the *board-TAB* indicating that sort-method. In addition you can get a plaintext-tooltip by hovering the mouse over that icon.

![New BoardView](https://user-images.githubusercontent.com/48651533/77249329-89926180-6c40-11ea-9bcd-5ab3a9800b7a.png)

#### New actions to reorder tasks by column NOT displayed!
The new actions to reorder tasks by column *(coming with Kanboard 1.2.9)* are NOT displayed, if the current board ist set to a NON-default sort-method, because this plugin will overrule these settings.

If the current board ist set to the Kanboard-default sort-method the new actions are of course available!

![NewKanboardSortMethods1 2 9-disabled](https://user-images.githubusercontent.com/48651533/77255489-33d1af80-6c68-11ea-989f-3104b794a7a4.png)


Credits
-------
This plugin is based on the work of [David Morlitz](https://github.com/dmorlitz), the author of the [kanboard-duedate-plugin](https://github.com/dmorlitz/kanboard-duedate)
Expand All @@ -44,7 +53,7 @@ Author
Requirements
------------

- Kanboard >= 1.2.8
- Kanboard >= 1.2.9

Installation
------------
Expand Down
114 changes: 114 additions & 0 deletions Template/board/table_column.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<!-- column titles -->

<?= $this->hook->render('template:board:table:column:before-header-row', array('swimlane' => $swimlane)) ?>

<tr class="board-swimlane-columns-<?= $swimlane['id'] ?>">
<?php foreach ($swimlane['columns'] as $column): ?>
<th class="board-column-header board-column-header-<?= $column['id'] ?>" data-column-id="<?= $column['id'] ?>">

<!-- column in collapsed mode -->
<div class="board-column-collapsed">
<small class="board-column-header-task-count" title="<?= t('Show this column') ?>">
<span id="task-number-column-<?= $column['id'] ?>"><?= $column['nb_tasks'] ?></span>
</small>
</div>

<!-- column in expanded mode -->
<div class="board-column-expanded">
<?php if (! $not_editable && $this->projectRole->canCreateTaskInColumn($column['project_id'], $column['id'])): ?>
<?= $this->task->getNewBoardTaskButton($swimlane, $column) ?>
<?php endif ?>

<?php if ($column['nb_tasks'] > 0): ?>
<span title="<?= t('Task count') ?>">
(<span id="task-number-column-<?= $column['id'] ?>"><?= $column['nb_tasks'] ?></span>)
</span>
<?php endif ?>

<span class="board-column-title">
<?php if ($not_editable): ?>
<?= $this->text->e($column['title']) ?>
<?php else: ?>
<span class="dropdown">
<a href="#" class="dropdown-menu"><?= $this->text->e($column['title']) ?> <i class="fa fa-caret-down"></i></a>
<ul>
<li>
<i class="fa fa-minus-square fa-fw"></i>
<a href="#" class="board-toggle-column-view" data-column-id="<?= $column['id'] ?>"><?= t('Hide this column') ?></a>
</li>
<?php if ($this->projectRole->canCreateTaskInColumn($column['project_id'], $column['id'])): ?>
<li>
<?= $this->modal->medium('align-justify', t('Create tasks in bulk'), 'TaskBulkController', 'show', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id'])) ?>
</li>
<?php endif ?>

<?php if ($column['nb_tasks'] > 0 && $this->projectRole->canChangeTaskStatusInColumn($column['project_id'], $column['id'])): ?>
<li>
<?= $this->modal->confirm('close', t('Close all tasks of this column'), 'BoardPopoverController', 'confirmCloseColumnTasks', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id'])) ?>
</li>
<?php endif ?>

<?php if ( $this->task->projectMetadataModel->get($column['project_id'], 'SortBoardBy_Method', 'sortboardby_kb_default') == 'sortboardby_kb_default' ){ ?>
<?php if ($column['nb_tasks'] > 0 && $this->user->hasProjectAccess('TaskModificationController', 'update', $column['project_id'])): ?>
<li>
<?= $this->url->icon('sort-numeric-asc', t('Reorder this column by priority (ASC)'), 'TaskReorderController', 'reorderColumn', ['sort' => 'priority', 'direction' => 'asc', 'project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']]) ?>
</li>
<li>
<?= $this->url->icon('sort-numeric-desc', t('Reorder this column by priority (DESC)'), 'TaskReorderController', 'reorderColumn', ['sort' => 'priority', 'direction' => 'desc', 'project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']]) ?>
</li>
<li>
<?= $this->url->icon('sort-amount-asc', t('Reorder this column by assignee and priority (ASC)'), 'TaskReorderController', 'reorderColumn', ['sort' => 'assignee-priority', 'direction' => 'asc', 'project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']]) ?>
</li>
<li>
<?= $this->url->icon('sort-amount-desc', t('Reorder this column by assignee and priority (DESC)'), 'TaskReorderController', 'reorderColumn', ['sort' => 'assignee-priority', 'direction' => 'desc', 'project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']]) ?>
</li>
<li>
<?= $this->url->icon('sort-alpha-asc', t('Reorder this column by assignee (A-Z)'), 'TaskReorderController', 'reorderColumn', ['sort' => 'assignee', 'direction' => 'asc', 'project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']]) ?>
</li>
<li>
<?= $this->url->icon('sort-alpha-desc', t('Reorder this column by assignee (Z-A)'), 'TaskReorderController', 'reorderColumn', ['sort' => 'assignee', 'direction' => 'desc', 'project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']]) ?>
</li>
<?php endif ?>
<?php } ?>

<?= $this->hook->render('template:board:column:dropdown', array('swimlane' => $swimlane, 'column' => $column)) ?>
</ul>
</span>
<?php endif ?>
</span>

<span class="pull-right">
<?php if ($swimlane['nb_swimlanes'] > 1 && ! empty($column['column_score'])): ?>
<span title="<?= t('Total score in this column across all swimlanes') ?>">
(<span><?= $column['column_score'] ?></span>)
</span>
<?php endif ?>

<?php if (! empty($column['score'])): ?>
<span title="<?= t('Score') ?>">
<?= $column['score'] ?>
</span>
<?php endif ?>

<?php if (! $not_editable && ! empty($column['description'])): ?>
<?= $this->app->tooltipMarkdown($column['description']) ?>
<?php endif ?>
</span>

<?php if (! empty($column['column_nb_tasks'])): ?>
<span title="<?= t('Total number of tasks in this column across all swimlanes') ?>" class="board-column-header-task-count">
<?php if ($column['task_limit'] > 0): ?>
(<span><?= $column['column_nb_tasks'] ?></span> / <span title="<?= t('Task limit') ?>"><?= $this->text->e($column['task_limit']) ?></span>)
<?php else: ?>
(<span><?= $column['column_nb_tasks'] ?></span>)
<?php endif ?>
</span>
<?php endif ?>
<?= $this->hook->render('template:board:column:header', array('swimlane' => $swimlane, 'column' => $column)) ?>
</div>

</th>
<?php endforeach ?>
</tr>

<?= $this->hook->render('template:board:table:column:after-header-row', array('swimlane' => $swimlane)) ?>

0 comments on commit e4bb568

Please sign in to comment.