× 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] Field Data Mapping Using "aliases" and "shortnames"

3 years 2 months ago 2 years 8 months ago by Antonio Durán.
ACM
Posts: 16
More
Topic Author
[Closed] Field Data Mapping Using "aliases" and "shortnames" #1
Hello again, Antonio,

We are still mapping two data sources to Moodle: EasyProfile and Hikashop.

We are creating A LOT of custom user profile fields in EasyProfile as part of registrations and extended "meeting you" questionnaires. Many of the fields have the same "name" labels. Mapping is now becoming too difficult because of multiple fields with labels like, "Father's First Name" or "What is your age?"

For each course we create a new field for everything and categorize in both EasyProfile and Moodle. Each of our internal field names (both Joomla "aliases" and Moodle "shortnames") are unique and meaningful.

We would like the ability to select the Joomla aliases and associated Moodle shortnames instead of name labels when mapping field data. I noticed that internal field names are visible for the Moodle "default" profile fields, but not for the extended, custom user profile fields in Moodle. It would be important to see both Joomla aliases and Moodle shortnames in the dropdown mapping lists with the same searchability that you have now.

Do you also think it would be possible to have additional filtering options using EasyProfile categories? And would it be possible to display the field ID numbers next to the aliases, concatenating the strings? It looks to me like the dropdown list is already sorted by the field ID #.

Thanks,
Jim

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

3 years 2 months ago
Antonio Durán
Posts: 7417
More
[Closed] Field Data Mapping Using "aliases" and "shortnames" #2
Hi Jim.

Thanks for your suggestions. I am looking into it to try to get a new version of the plugin with them.

I have 2 doubts:
- display the field ID numbers next to the aliases. Where do you want this? In the mappings listing, in the form to create mappings or both?
- additional filtering options using EasyProfile categories. I guess you mean in the mappings listing?

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

3 years 2 months ago
ACM
Posts: 16
More
Topic Author
[Closed] Field Data Mapping Using "aliases" and "shortnames" #3
Antonio,

We are most interested in the form to create the mappings, so first priority would be to use aliases and shortnames instead of long name label strings.

It might be difficult to append a field id next to the aliases in the form's dropdowns. But if possible, use a format similar to this: father_first_name [36]

My original thought was to also have search filtering using Easy Profile groups (categories) on the form when creating the mappings, but that would be a very low priority if the above was possible.

If easy to add the Easy Profile groups to the mappings listings, then that would be very nice, but not critical in the short term if we have the aliases and shortnames listed instead of current name labels.

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

3 years 2 months ago
Antonio Durán
Posts: 7417
More
[Closed] Field Data Mapping Using "aliases" and "shortnames" #4
Thanks for the info.

I went ahead and added a new option to Easyprofile integration plugin, to decide what you want to show (name, alias, alias+id).
Please get it here and test, and let me know if you need any changes:
www.joomdle.com/aux/plg_joomdleprofile_j...syprofile_v1.2.0.zip k

As for showing Moodle custom field shortnames: I think it is a good idea, so I have implemented it for next release. It shows it in format: name (shotname)
If you want to use this change right away, changes are easy to implement: Let me know and I will explain.

> My original thought was to also have search filtering using Easy Profile groups (categories) on the form when creating the mappings, but that would be a very low priority if the above was possible.

Good, because I don't think it is something we want to add right now, as it would need much bigger changes.

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

3 years 2 months ago
ACM
Posts: 16
More
Topic Author
[Closed] Field Data Mapping Using "aliases" and "shortnames" #5
Thanks again for all of your speedy replies and solutions!

I will test the easyprofile plugin and let you know how it goes. That was great idea adding options to the plugin options..

And yes, explain the Moodle change and I'll merge into my test environment right away. Thanks for considering and getting it into your next release.

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

3 years 2 months ago
Antonio Durán
Posts: 7417
More
[Closed] Field Data Mapping Using "aliases" and "shortnames" #6
Ok, here they are:

File: moodle/auth/joomdle/auth.php
Function: user_custom_fields
Add:
            $custom_fields[$i]['shortname'] = $field->shortname;
After:
            $custom_fields[$i]['name'] = $field->name;

File: moodle/auth/joomdle/helpers/externallib.php
Function: user_custom_fields_returns
Add to the array:
                  'shortname' => new external_value(PARAM_TEXT, 'field short name'),

File: administrator/components/com_joomdle/models/fields/moodlefield.php
Function: getOptions
Change:
            $option['text'] = $mf['name'];
By:
            $option['text'] = $mf['name'] . ' (' . $mf['shortname'] . ')';

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

3 years 2 months ago
ACM
Posts: 16
More
Topic Author
[Closed] Field Data Mapping Using "aliases" and "shortnames" #7
Hi Antonio,

I tested the Moodle fields using the array debug code you sent me, and there is still a problem.

The id and name is passed to Joomla, but unfortunately the shortname is empty.

I've attached a screen shot of the code mods you gave me for moodlefield.php, and also a screenshot of the results: "shortname" is empty for every element of the array.

Joomla and Moodle connectivity is fine. I can change a field in Joomla and it changes in Moodle. And vice versa. SSO works.


When creating a mapping, we would prefer if the shortname is displayed before the long name in the Moodle field dropdown, and also in the mapping listing.

$option = $mf . ' (' . $mf . ')';

would change to something like this...

$option = $mf . ' - ' . $mf ;

That would help with searches in the dropdown by having the first two or three characters of the search go to the unique prefixes of the shortnames in the same way that we search now in the Joomla/EasyProfile fields dropdown when creating the mapping.
Attachments:

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

3 years 2 months ago
ACM
Posts: 16
More
Topic Author
[Closed] Field Data Mapping Using "aliases" and "shortnames" #8
Sorry, I should have used the code option in the editor...
$option['text'] = $mf['name'] . ' (' . $mf['shortname'] . ')';

would change to something like this...
$option['text'] = $mf['shortname'] . ' - ' . $mf['name'];

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

3 years 2 months ago
Antonio Durán
Posts: 7417
More
[Closed] Field Data Mapping Using "aliases" and "shortnames" #9
Sorry, I forgot one change:
File: moodle/auth/joomdle/auth.php
Function: user_custom_fields
Change:
        $query = "SELECT id, name
By:
        $query = "SELECT id, name, shortname

As for the change in formatting: I think you are right, as we are showing database field names for "normal" moodle fields.
You will need to change administrator/components/com_joomdle/models/fields/moodlefield.php
Change old line by this one:
            $option['text'] = $mf['shortname'] . ' - ' . $mf['name'];

Also file administrator/components/com_joomdle/helpers/mappings.php
Function: get_moodle_field_name
Change:
                return $field['name'];
By:
                return $field['shortname'] . ' - ' . $field['name'];

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

3 years 2 months ago
ACM
Posts: 16
More
Topic Author
[Closed] Field Data Mapping Using "aliases" and "shortnames" #10
Hi Antonio,

That solved all of the issues and the mapping listing look great. When creating the mappings, the search feature is solid and very useful now.

Thanks for your fine work and great customer service! I didn't expect such quick turnaround for a "feature request" !! :woohoo:

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