Skip to Content Skip to Menu

🕒 Save Time and Effort with CB Editor Assistant: Effortlessly create and refine content in Joomla 3, 4, & 5.
🎁 Limited Offer: Enjoy a 5-day FREE trial and save up to 30% afterward!

[SOLVED] Managing family membership via auto-action?

  • fribse2011
  • fribse2011
  • OFFLINE
  • Posts: 921
  • Thanks: 79
  • Karma: 8
8 years 4 days ago - 7 years 11 months ago #290416 by fribse2011
One of our very manual tasks for managing membership in our small diving club is our special family membership.
This has multiple people created under the same membership, and thus the membership number is the same.
I'm wondering how I can handle resignation of those memberships without having to search them out manually.

I was contemplating something like marking one of the members as 'master'.

So when they register, the first user is marked as master, and will get reminders of payment etc. while the others won't.

But if they resign, how do I get auto-action to first find the membership number, and then search through the users after mathing membershipnumbers, is it even possible?

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, så kom ned til os.
Last edit: 7 years 11 months ago by krileon. Reason: Added [SOLVED] tag to subject

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48709
  • Thanks: 8319
  • Karma: 1447
8 years 3 days ago #290445 by krileon
Replied by krileon on topic Managing family membership via auto-action?
You could use a field to keep track of what user_id is the master. So if User A (user id 97) is the master of User B (user id 32) and User C (user id 48) then Users B and C would have their field set to 97. When User A expires, etc.. you just need to find all users where their field is set to 97 and expire them as well.

Using user ids is really the only way to link them properly. It doesn't really have to be a field though. You could create a custom database table that keeps track of these relationships then queries it as needed through CB Auto Actions. I've no idea what you're using for membership management though so not much more I can suggest on how those 2 will integrate.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

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

  • fribse2011
  • fribse2011
  • OFFLINE
  • Posts: 921
  • Thanks: 79
  • Karma: 8
8 years 3 days ago #290477 by fribse2011
Replied by fribse2011 on topic Managing family membership via auto-action?
Hi Kyle

My membership management is Auto-actions :-)
We have a simple excel sheet also, but that's it, and I would like to move it all to CB.

So I'm thinking I'll create a form that all the information is entered into.
Then I'll create the users with an auto-action->register from that form, how do I extract the ID from the user first created (the master) so that I can enter the value in the subsequent users?

How would I go about "... find all users where their field is set to 97 and expire them as well." in an auto-action?

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, så kom ned til os.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48709
  • Thanks: 8319
  • Karma: 1447
8 years 3 days ago #290483 by krileon
Replied by krileon on topic Managing family membership via auto-action?
The registration action fires normal registration triggers. If you need to act on it you'd be able to do so through the user registration trigger.

How would I go about "... find all users where their field is set to 97 and expire them as well." in an auto-action?

In a Query action you'd just add that as part of your WHERE statement on the _comprofiler table. You'd be directly altering the database table which isn't typically recommended, but the only other approach is probably a Code action with Method set to PHP then write the code to find all those users and update their user objects.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

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

  • fribse2011
  • fribse2011
  • OFFLINE
  • Posts: 921
  • Thanks: 79
  • Karma: 8
7 years 11 months ago #291275 by fribse2011
Replied by fribse2011 on topic Managing family membership via auto-action?
Hi Kyle

Now I finally got some extra time to look into this.
I created an SQL query like this:
UPDATE `xxx_comprofiler` SET `cb_type` = 'Not Member' WHERE `cb_familyid` = '{id}' AND `id` != '{id}'
This should modify all the users of the family group the member belongs to, except the 'main' member (whose ID is in the familyid), and which is the one that triggers this secondary action.
This changes the user membership field as it should, but as far as I can see there is no way to make the existing triggers run on the changed objects which are normally run when this field changes, this I guess would require it to be run in PHP instead?

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, så kom ned til os.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48709
  • Thanks: 8319
  • Karma: 1447
7 years 11 months ago #291278 by krileon
Replied by krileon on topic Managing family membership via auto-action?
{id} isn't a valid substitution. You need to use [user_id] if you are trying to substitute in the user id.

This changes the user membership field as it should, but as far as I can see there is no way to make the existing triggers run on the changed objects which are normally run when this field changes, this I guess would require it to be run in PHP instead?

Not sure I understand. You want it to run when a field changes and not the subscription?


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

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

Moderators: beatnantkrileon
Powered by Kunena Forum