× Feature Requests

Please do NOT use this section of the forum to request help if Joomdle does not work for you in some particular way. Your post will be deleted.

[Closed] Request for additional Joomdle API method

6 years 4 months ago 5 years 8 months ago by Antonio Durán.
Civica Digital
Posts: 21
More
Topic Author
[Closed] Request for additional Joomdle API method #1
Hi.

I am writing a Joomdle extension in the form of a Joomla plugin. This plugin allows us to use Joomla groups and access levels to also control parent/child relationships in Moodle.

While writing this code, I have made use of the Joomdle API method 'add_parent_role'. This is called in Joomla within the onUserAfterSave event in my plugin. It can be called in two ways:
- When a user is added to a Joomla group which has a team leader, that team leader is granted parent role in Moodle over the current user.
- When the user is given team leader access rights in Joomla, he is granted Moodle parent role for all the users in that group.

This all works well.

However, in order to complete the functionality, I also need to be able to revoke the parent role, when the Joomla user account is modified in the other direction. But it seems that Joomdle does not have a matching 'remove_parent_role' API method.

In the short term, I have created it for myself in Joomdle by copy+pasting the 'add_parent_role' method and having my function call role_unassign() instead of role_assign(). This also works well. But I don't want to rely on a customised version of Joomdle, so I would like to request that this method is added to the official Joomdle package.

In return, I would be happy to share the code of my plugin, once the method has been added (there's no point until then, as it won't work without it).

I'd also be happy to share my code changes to Joomdle if necessary, although as I say this involved doing very little work apart from copy+paste as a proof of concept.

Many thanks.


Simon C.

ps - I'm aware that Joomdle and various plugins already have parent/child functionality. I believe my plugin works differently from any of the existing options though. I've written it specifically to fit our use-case, but I'm sure it would be useful for others as well.

Please Log in or Create an account to join the conversation.

6 years 4 months ago
Antonio Durán
Posts: 7417
More
[Closed] Request for additional Joomdle API method #2
Hi Simon.

Thanks for your suggestion. I agree that should have include that function.
I will try to add it for next release.

Antonio

Please Log in or Create an account to join the conversation.

6 years 4 months ago
Civica Digital
Posts: 21
More
Topic Author
[Closed] Request for additional Joomdle API method #3
Awesome, thank you!

Please let me know when you're likely to release it. (not trying to pressure you; just because it'll be helpful for me to know so I can decide whether to launch my project with my customised version or wait for your official release)

Please Log in or Create an account to join the conversation.

6 years 4 months ago
Antonio Durán
Posts: 7417
More
[Closed] Request for additional Joomdle API method #4
I am sorry, but I cannot give you any estimate at this point.

Please Log in or Create an account to join the conversation.

6 years 4 months ago
Civica Digital
Posts: 21
More
Topic Author
[Closed] Request for additional Joomdle API method #5
Hi. Okay, no worries. That's probably enough to tell me not to delay the project to wait for it. :)

Thanks again. Regards,


Simon C.

Please Log in or Create an account to join the conversation.

5 years 11 months ago
Civica Digital
Posts: 21
More
Topic Author
[Closed] Request for additional Joomdle API method #6
Hi.

Just resurecting this thread to ask if you're still planning to add the API method I requested, as you said you'd consider it for the next release and I notice the announcement about Moodle 3.1 saying there will be a new release of Joomdle soon.

(please note, I'm not trying to be pushy! but I need to know whether it will be in there or not, as it will affect my ability to do the upgrade, as I've already made my own changes to Joomdle core to add the method for myself)

Many thanks,


Simon C.

Please Log in or Create an account to join the conversation.

5 years 11 months ago
Chris
Posts: 2118
More
[Closed] Request for additional Joomdle API method #7
I'll let Antonio make a comment into specific works done. However, if you have made it happen already and it is generic enough, Antonio may be able to incorporate your changes to the core Joomdle. This, I think would satisfy your concern over making upgrades in the future.

Please Log in or Create an account to join the conversation.

5 years 11 months ago
Antonio Durán
Posts: 7417
More
[Closed] Request for additional Joomdle API method #8
Hi Simon.

Thanks for the reminder, I will include your code for next release (once I resolve some of the pending issues with Moodle 3.1)

Please Log in or Create an account to join the conversation.

5 years 10 months ago
Civica Digital
Posts: 21
More
Topic Author
[Closed] Request for additional Joomdle API method #9
Hi Antonio.

Just to say thank you -- I downloaded 1.0.6 today and I can see that you have added the remove_parent_role() method. I haven't tested it yet, but the code looks identical to mine, so I expect it'll work fine.

Once I've had a chance to test it and get it installed in my client's system, I'll come back here and share my plugin with you as promised. :)

Please Log in or Create an account to join the conversation.

5 years 9 months ago
Civica Digital
Posts: 21
More
Topic Author
[Closed] Request for additional Joomdle API method #10
Hi Antonio.

I promised ages ago that I would share the plugin I wrote once you had released the Joomdle update with the remove_parent_role() method.

I'm sorry it's taken so long, but here it is. (hopefully your forum will accept a zip attachment)

I'm intending to publish this on Github, but posting here first to give you the chance to review it and make any comments.

Regards,


Simon C.
Attachments:

Please Log in or Create an account to join the conversation.