Filter project management

#1

Hi,

We’ve been using Kanboard for since way-back-when (early 2015), and over that time have generated a lot of projects. The problem is, now when you look at the project management screen you get a 2 page list of projects with maybe only half a dozen active.

Is it possible to add a filter feature to that page, like the kanboard page itself, so I can type “status:open” and only see currently active/open projects? That’d be incredibly helpful.

Thanks,
Algy

#2

It would be very simple to add a toggle on that page, that would allow you to hide/unhide closed projects.

Just to be clear, you are talking about this page, correct?

image

#3

Working example:

which you can test out here: https://projects.nachostudio.ml/
user: admin
pw: admin

things change on that server daily so, no guarantee it will still be testable in x amount of days…

If this is what you are looking for, steps to reproduce would be:
1.) Register a plugin: https://docs.kanboard.org/en/latest/plugins/registration.html
2.) add a togglecontroller to set the toggle status in the configModel, and redirect back to ProjectListController, show function
3.) hook a toggle link that calls above controller to template:project-list:menu:after : https://docs.kanboard.org/en/latest/plugins/hooks.html#template-hooks

  • you might want to also add a condition to the template you are hooking that changes the verbiage of the link like i did, i.e. “Show Closed…” “Hide Closed…”
  • add array('plugin' => 'yourPluginName') to call your own controller, i.e. $this->url->icon('eye-slash', t('Show Closed Projects'), 'ToggleController', 'hideProjects', array('plugin' => 'yourPluginName'))

4.) copy and edit the template project_list/listing.php to include a conditional wrapper inside the contents of the foreach loop, i.e. if ($project['is_active'] != 0) : https://github.com/kanboard/kanboard/blob/11b6bf6d25668b8bb9d0304c30f803f8194ab1d8/app/Template/project_list/listing.php#L38-L52
5.) conditionally override project_list/listing.php when the toggle is on, don’t override when it is off : https://docs.kanboard.org/en/latest/plugins/overrides.html#template-overrides