Page 1 of 5

Recurring tasks

Posted: Mon Nov 20, 2023 11:47 am
by Kofod95
Structure is helpful in many cases, but sometimes it's hard to fit everything in your head.
For that reason, I've made this little add-on to create recurring tasks.
It concists of a new admin page to create, edit and delete recurring tasks, a dashboard module to show tasks that needs to be done and an admin/login-hook to make the tasks active, when they are due.

If anyone finds it useful, feel free to use it, alter it or whatever you may want.
I would really appreciate some feed-back on it, if someone decides to try it or even use it!
Things I really want to know is:
  • Is it easy to use?
  • Does it work as expected?
  • Can you break it with actions that you would be likely to do? (I know at least one easy way to make it produce errors, but that is easily solveable and I wouldn't expect anyone to take those actions)
  • Do you miss some instructions (fx should the page tell about the dashboard-module or should something be clarified further)?
  • Should some things work in another way?
  • How can it be improved?
It's packaged with the Zipur-bundler, so use that to install or just ignore the file "update.php". The SQL will be installed from the new admin-page (admin/tasks.php - link is placed under "Tools")

Re: Recurring tasks

Posted: Mon Nov 20, 2023 4:08 pm
by Denzel
Very nice :) Just a few days before, there was a notice/task add in my mind... First try is doing well, only some optical improvements possible:

- Task with Link +Description looks like this on dashboard:
Unbenannt.PNG

- Task infobox may have the ratio in clear text and no <tr> for the empty fields (or just saying Link:)
Unbenannt2.PNG

A functional think: Maybe a "renew"-button would be useful for tasks without ratio, as they stay in the db anyway.

All done - Good job! ;)
Regards,
Denzel

Re: Recurring tasks

Posted: Mon Nov 20, 2023 4:20 pm
by Kofod95
Denzel wrote: Mon Nov 20, 2023 4:08 pm - Task with Link +Description looks like this on dashboard:
Thank you! Seems I forgot to try out a last minute change... Will correct and upload a bug-fix.
Denzel wrote: Mon Nov 20, 2023 4:08 pm - Task infobox may have the ratio in clear text and no <tr> for the empty fields (or just saying Link:)
Yea, I got the id's of the ratios so stuck in my head that I auto-translated them... I was sure I had made the program translate, but clearly not. Thank you for giving a blind man vision (not litteraly)!
Good idea to just hide the link when not present; I'll add that! 👍
Denzel wrote: Mon Nov 20, 2023 4:08 pm A functional think: Maybe a "renew"-button would be useful for tasks without ratio, as they stay in the db anyway.
Didn't think of that! Honestly, I think I just forgot about the "once"-tasks, so they aren't deleted on completion. An option to renew might be better than deleting - One can always delete themselves later on, so thank you for that suggestion!

And thank you very much for taking the time to give some feedback - it's much appreciated!

//Daniel

Re: Recurring tasks

Posted: Mon Nov 20, 2023 6:13 pm
by 14Steve14
@Kofod95 Just installed this with no problems. Everything works as I m=imagine that it would. I can see lots of tasks that could do with a reminder as I do forget to do some things. The reminders are a good idea and I assume that the text can be edited after to allow the user to see where they got, and what else could be done.

I do like the idea of a RENEW button.

I will have a fiddle with this as see if anything could be improved. So far though, it does what it says it will.

Re: Recurring tasks

Posted: Mon Nov 20, 2023 7:02 pm
by Kofod95
14Steve14 wrote: Mon Nov 20, 2023 6:13 pm [...] I assume that the text can be edited after to allow the user to see where they got, and what else could be done.
Yes, changing the task shouldn't change it's status, unless, of course the recur-ratio is changed. Which makes me aware of a flaw I need to fix, as a task that used to be yearly never would recur, if changed to another ratio... Editing a task should probably reset the completion to zero to make sure it will recur, even if that means one might have to check it immediately after editing. Thank you for bringing that to my attention!
14Steve14 wrote: Mon Nov 20, 2023 6:13 pm I do like the idea of a RENEW button.
Good, thank you! I'll add that along with something to make it clearer on tasks.php which tasks are set as "once" (they are sorted together, but it might be hard to tell them apart with no clear indications of what belongs where)
14Steve14 wrote: Mon Nov 20, 2023 6:13 pm I will have a fiddle with this as see if anything could be improved. So far though, it does what it says it will.
Thank you very much for that and for taking the time to test it out and comment! I really appreciate it, and it makes it easier for me to improve what needs improving 😊

//Daniel

Re: Recurring tasks

Posted: Mon Nov 20, 2023 7:30 pm
by Omar_one
Kofod95 wrote: Mon Nov 20, 2023 11:47 am a dashboard module to show tasks that needs to be done and an admin/login-hook to make the tasks active,
Thank you @Kofod95 for this module ..
it's not a bug but if someone didn't install the dashboard module,
will got a blank login page because the updateTasks.php hook ask for the enabled dashboard module

Code: Select all

if(MODULE_ADMIN_DASHBOARD_TASKS_STATUS == 'True') {  
and here is the error

Code: Select all

PHP Fatal error:  Uncaught Error: Undefined constant "MODULE_ADMIN_DASHBOARD_TASKS_STATUS" in /home/xxxx/public_html/includes/hooks/admin/login/updateTasks.php:16
Stack trace:
#0 /home/xxxx/public_html/includes/system/versioned/1.0.8.1/hooks.php(150): hook_admin_login_updateTasks->listen_injectSiteStart(Array)
#1 /home/xxxx/public_html/admin/includes/template_top.php(23): hooks->cat('injectSiteStart')
#2 /home/xxxx/public_html/admin/login.php(56): require('/home/hattufi/p...')
#3 {main}
  thrown in /home/xxxx/public_html/includes/hooks/admin/login/updateTasks.php on line 16

Br
Omar

Re: Recurring tasks

Posted: Mon Nov 20, 2023 7:38 pm
by Kofod95
Omar_one wrote: Mon Nov 20, 2023 7:30 pm it's not a bug but if someone didn't install the dashboard module,
will got a blank login page because the updateTasks.php hook ask for the enabled dashboard module
Oh yea, thank you!
I'll add a check to make sure it's defined. That was an oversight on my end.

Thank you as well for taking the time to test and comment! It's much appreciated!

//Daniel

Re: Recurring tasks

Posted: Mon Nov 20, 2023 8:30 pm
by Kofod95
Bugfix released in original post (1.0.1)
Changes:
  • Corrected display in dashboard-module when a link is added to the task
  • The recurrence-ratio has been given meaningful text instead of numbers
  • The table-row for links is hidden when no link is added
  • A button to renew tasks has been added to the infoBox of tasks that are completed (and a new action-file makes it do what it says)
  • Editing a task will reset the time of completion to zero to prevent a task getting lost if the ratio is changed
  • The recurrence ratio is now shown in the table listing all tasks
  • The login hook now checks for the data it needs instead of reading for a constant that may not be defined or may be a false positive
Thanks for the feedback so far! Please don't hestitate to bring up more things, if you think of some!

//Daniel

Re: Recurring tasks

Posted: Tue Nov 21, 2023 7:13 am
by Denzel
Hi Daniel,

looks very good! I like those Tooltips, but they stay after opening a link ;) The only thing I can think of now is to display the remaining time in the task panel until the task is due again (maybe days left?).

Regards,
Denzel

Re: Recurring tasks

Posted: Tue Nov 21, 2023 7:23 am
by heatherbell
Using your latest edit/update.

It would be helpful to have a ReadMe. Think that is a must have for all Addons.

It would be good to enable assigning Tasks to people where more than 1 person is administrating the website and showing that on the Dashboard module. E.g. adding a configuration for "F.A.O." (For Attention Of) with an input for a Name or maybe a drop down of Administrators but allowing for "one man bands", that is, show nothing if nothing input.