Hi,

It would be nice to have different types of relationships per role type.

Example:

Two roles for two different types of users:
User type 1: Customer
User type 2: Supplier

Relationships types:

Customer:
-Friend
-My Supplier

Supplier:
-Friend
-My Customer

The form where the type of relationship is chosen should filter the ones available for that role.

Thanks,
introfini

CommentFileSizeAuthor
#7 Admin settings17.7 KBalex.k

Comments

4drian’s picture

I definitely second this - I have exactly the same situation as above. I also have relations such as "lead" which I'd rather certain users did not know the existence of.

Vuds’s picture

I'm needing to have that too. It doesn't have to be two-way for me, but I think that if you'd implement that, you'll do the complete thing.

webchick’s picture

I agree that this would be useful.

Implementation-wise, we're probably looking at a new user_relationships_types_roles table, adding a list of checkboxes for roles on the relationship setup screen, and doing a join on that new table when pulling up a list of available relationships for a user to select from.

Super Druper’s picture

Same request here. This would be a great feature to see implemented in future releases of the module. Seems like there's some interest for this feature, hopefully the momentum will build up to make it happen.

ryanscott’s picture

Version: 5.x-2.x-dev » 6.x-1.x-dev

me too - need employee/employer along w friend/fan and supporter (one way) all in the same site depending on role.

stopbox’s picture

Yes please, this feature would be fantastic.

alex.k’s picture

Assigned: Unassigned » alex.k
Status: Active » Fixed
StatusFileSize
new17.7 KB

Implemented and committed. It's part of core functionality, no need to enable another module. The UI is pretty simple, it's a set of checkboxes on the relationship type setup form, like webchick suggested. Default is to allow everyone access, so that existing installs are not interrupted. Be sure to run update.php when you download the latest -dev release.

Any issues, please reopen or create a new one.

jaydub’s picture

Hey alex I just picked up this change when checking out the fix to the SERIAL issue. Was thinking that the hook_update_N call for the new user_relationship_type_roles table should be user_relationships_api_update_6101 and not _6200.

There's not 6.2 branch yet and an update function of 6200 implies an update to 6.2 branch. At least that's what I seem to recall being the update_N numbering system...

alex.k’s picture

Oops, you are right. Did not look in the docs http://api.drupal.org/api/function/hook_update_N/6 before writing... Renamed the function and committed. Users who have run the incorrect 6200 update will need to execute this SQL statement:

UPDATE system SET schema_version='6101' WHERE filename LIKE '%user_relationships_api.module%'

alex.k’s picture

Regarding fixing the update function numbering, see #386370: After running update.php, got this? Normal? (UR) for what happens if you do not run the SQL statement. Basically it tried to rerun earlier updates, which fail but do not break anything.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

perceptum’s picture

Has this been ported to 5.x at all?

Bryan

alex.k’s picture

No, I would accept patches for 5.x but have no plans to port it.