approval workflow

12 years 2 months ago #192408 by timberlineevents
approval workflow was created by timberlineevents
Hi!

I am trying to change approval workflow based on CB field value and followed this tutorial:

www.joomlapolis.com/support/tutorials/107-use-cases/18219-changing-approval-workflow-based-on-cb-field-value

Being that my case is slightly different:

1. Form A: no need for approval.
2. Form B: needs to be approved.
3. Form C: needs to be approved.

And I don´t really want to mess with the emails, thought doing the opposite:
I Set “Require Admin Approval: yes” in the registration configuration and by auto actions want to set the auto approval for Form A users:

Auto actions:

• onBeforeUserConfirm

UPDATE `#__comprofiler` SET `approved`= '1' WHERE `user_id` = '[user_id]'


Everything fine up to this point: Have green in Approved, green in confirmed but red in enabled (user manager states).

So I tried another auto action:

• onAfterUserConfirm (or before)
UPDATE `#_users` SET `block` = '0' WHERE `id` = '[user_id]'

or

UPDATE `#__comprofiler` SET `enabled`= '1' WHERE `user_id` = '[user_id]'

None of them worked out. Not sure if the command is wrong or the time to apply it. Not sure if: ` SET `enabled`= '1' is valid neither…

Any help here, please???

Another thing is (seeing trouble coming) how to stop the admin email for the auto approved users…

Some more help here, please???

Tks

PS: more info (if needed) on how I set up the form here:

www.joomlapolis.com/forum/153-professional-member-support/192228-solved-need-help-with-conditional-field-and-multiforms

Please Log in to join the conversation.

12 years 2 months ago #192478 by krileon
Replied by krileon on topic Re: approval workflow
Just extend your current Query action to have a second query as you can have more then 1 query in a query action. Example as follows.
UPDATE `#__comprofiler` SET `approved`= '1' WHERE `user_id` = '[user_id]';
UPDATE `#__users` SET `block` = '0' WHERE `id` = '[user_id]'

They're not enabled because the block status in the users table. Your query probably failed because you had #_users and needed 1 more underscore to make it #__users.


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 to join the conversation.

12 years 2 months ago #192487 by timberlineevents
Replied by timberlineevents on topic Re: approval workflow
This worked out. My mistake was taken the code from the comments in that tutorial instead of the actual page code sample.

Thanks.

Now, how can avoid this “not approval needed” users to see this:

“Thank you for confirming your Email Address. Your account requires approval by a moderator. You will receive an email with the outcome of the review.”

They should see something like:

“Thank you for confirming your Email Address.”

Can´t change the text because I need it for the “approval needed” users

Is it possible to do a Url redirect to an article or something like that? Or maybe an auto login just for this users?

Another thing is:
How can I stop the moderator email just for the “not approval needed” users???

Tks

Please Log in to join the conversation.

12 years 2 months ago - 12 years 2 months ago #192494 by krileon
Replied by krileon on topic Re: approval workflow
I don't think you can do either of those. Changing the database has no affect on the already established user object. So as far as CB is concerned it still sees them as blocked and unapproved until next page load. Maybe try using a Field action to change the values if available. Alternatively I guess you can check if after confirmation they are approved and not blocked then redirect to whatever custom page of your choosing, but that probably won't stop the email.


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.195 seconds