Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement an approval Workflow #160

Open
dasistwas opened this issue May 31, 2021 · 8 comments
Open

Implement an approval Workflow #160

dasistwas opened this issue May 31, 2021 · 8 comments
Assignees

Comments

@dasistwas
Copy link
Member

In order to publish a course, a approval workflow should be implemented, that generates E-Mails to certain persons or roles. The process is cascading:

  1. Teacher submits the datalynx instance with all the entries so that the study director will get an e-mail.
  2. The study director has a look at the datalynx instance and if everything ist correct
  3. The study director approves it. Mails goes to the office so they can take the next steps. The mail has to include the course link or the course id the datalynx instance is used in.

In general: teachers are creating the semester plan for their students with a datalynx instance in their course. The teacher adds one entry for each study phase. The final datalynx instance is composed of several entries with workload, and description of the phase. The workload is calculated (JS implementation) for all the entries together. When the plan is approved by the study director, the office staff will enrol the students in the course.

Possible implementation

There is already a status field in datalynx, which could be used. But the feature wanted is more based on the whole instance than on a single entry. So there could be a separate view for approval. So maybe that can be created as rule or event type notification with conditions.

@michaelpollak
Copy link
Collaborator

image

Extended the UI to allow a rule that only triggers on specific checkboxes and sends mail to specific user. Currently testing and working on an issue where mail is sent everytime an entry is updated and the checkbox is marked. Will update after I've found a neat fix.

@dasistwas
Copy link
Member Author

great. just to be sure: "checkbox" is the name of the checkbox and not the "type" of the element?

@michaelpollak
Copy link
Collaborator

Yes exactly, I named the field of type checkbox "checkbox" :)
For the UI we are looking for all checkboxes in this datalynx instance and offer a dropdown list for selection. The default is "All" to keep backwards compatibility. For easier usage the area "Trigger only on specific element" is hidden until the Trigger event "Entry updated" is selected.

michaelpollak added a commit to michaelpollak/moodle-mod_datalynx that referenced this issue Jun 15, 2021
@michaelpollak
Copy link
Collaborator

Workflow for approval:

  • Set up a field checkbox "waiting for approval"
  • Set up a field checkbox "Approved"
  • Set up a view "Approval workflow"
  • Add the two checkboxes
  • Add Event notification "Approved" that triggers on updates of checkbox "Approved" and sends mail to "Other user"
  • Add Event notification "Waiting for approval" that triggers on updates of checkbox "Waiting for approval" and sends mail to "Other user"

This whole setup can be reused for every course. When checkbox "Waiting" is marked by teacher mail is sent out.
When checkbox "Approved" is marked and "Waiting for approval" is removed mails are sent out.

Looking forward to your feedback and improvements, thank you, have a nice day.

@dasistwas
Copy link
Member Author

@michaelpollak we would need the trigger also on "entry created". Maybe limiting to entry updated is not necessary at all...

michaelpollak added a commit to michaelpollak/moodle-mod_datalynx that referenced this issue Jun 28, 2021
@dasistwas
Copy link
Member Author

When I assign a manager to the course category and then trigger the event and choose as the receiver the role manager I get that error:

Sending message to the user with id 11
++ Attempt to send msg from a provider mod_datalynx/event_entry_created that is inactive or not allowed for the user id=11 ++
* line 224 of /lib/messagelib.php: call to debugging()
* line 46 of /mod/datalynx/classes/task/sendmessage_task.php: call to message_send()
* line 333 of /lib/cronlib.php: call to mod_datalynx\task\sendmessage_task->execute()
* line 198 of /lib/cronlib.php: call to cron_run_inner_adhoc_task()
* line 76 of /lib/cronlib.php: call to cron_run_adhoc_tasks()
* line 79 of /admin/cli/cron.php: call to cron_run()
Sent.

@dasistwas
Copy link
Member Author

that's the reason probably.
Screenshot 2021-06-30 at 21-24-43 FHB Administration Users Permissions Define roles

@michaelpollak
Copy link
Collaborator

Yes it is built on moodle events so the usual permissions apply.
By default we only allow teachers and non-editing-teachers to receive "notifyentryupdate", we could change this default to integrate the managers as well if you like to? Or just have the admins decide who can receive event updates and add it somewhere as a note in the user interface?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants