after having a problem and then after some time digging into plugin stuff for Kanboard with some help, I finally came up with something maybe usful for me. Maybe it’s useful for others as well:
This is a simple plugin (without configuration yet), which makes the default sorting for tasks on the dashboard overview and tasks site sort by Due date DESC by default.
One main thing I still try to figure out is how to make tasks without due date appear still on the bottom of the list. I managed something like this with another huge project of mine, yet it used Doctrine … and Kanboard uses PicoDB, which is totally new to me. So in case somebody might be able to help here: you are welcome!
Well, I got it. For the pagination stuff only, though. Means: for the dashboard overview and tasks view.
Next step would be to have this sorting for the projects task list as well (the one right next to the board button). Unfortunately it did not seem to work to come up with a similar solution like $this->container['taskListController'] = ..., since the controllers either cannot be replaced, or it is done differently.
sorry, i dozed. when i said the query, i meant the first line. thats an array of tasks. $query = $this->taskFinderModel->getUserQuery($userId); This is an array of tasks.
i would have simply removed all the empty due dates there, then run it through your sorting logic, then merged them back in, at the end of the array. so no matter your sort, they would always be at the bottom of your sort.
First of all: thanks for the new replies and big sorry for my late reply. I wanted to answer yesterday, but since I am a new user in this forum, there seem to be a posting cap.
I should have posted the error message at least, sorry! I actually fixed the problem after all: MySQL does not allow CASE WHEN ... is 1 but CASE WHEN ... = 1. This seem to work now. I also updated my repo already.
Not sure if it’s the same, but I understood it this way that this is a PicoDB object. …I might give this a try. Maybe my plugin could work more smooth this way then. Thanks for the example as well.
Oh sorry, mustr have forgotten this. Yes, this makes sense!
You guys here in this forum are so great, wow! Just thank you a lot. This makes it easier to dig into the plugin development. I am very grateful for that. (=