Hi
This doesn't quite do what I want. It almost does.
If I log in as office.no then it goes to that form lisMembershipReceiptsRecent. If I log off and try again as (say) guest it seems to pick up the original values of option and takes me back to lisMembershipReceiptsRecent.
I am trying to exclude the values of option or chronoform as in the code. I have tried
I guess I could do that using custom code, buttons and coding in different links and not use the Redirect actions but this looks like the 'correct' way.
Any suggestions?
Regards
Nick
This doesn't quite do what I want. It almost does.
<?php
$userName=substr($form->data['byUser'], 0, 7);
// Nick - todo change that to office group
if ($userName=='office.')
{
?>
option=com_chronoforms
chronoform=lisMembershipReceiptsRecent
<?php
}
else {
?>
<?php
}
If I log in as office.no then it goes to that form lisMembershipReceiptsRecent. If I log off and try again as (say) guest it seems to pick up the original values of option and takes me back to lisMembershipReceiptsRecent.
I am trying to exclude the values of option or chronoform as in the code. I have tried
option=''
chronoform=''
but that crashes with a 404 error.I guess I could do that using custom code, buttons and coding in different links and not use the Redirect actions but this looks like the 'correct' way.
Any suggestions?
Regards
Nick
Hi Nick,
I probably wouldn't do it this way* - but I'm not at all sure what you are trying to do here :-( Please can you explain the objective?
Bob
* Maybe using the Event Switcher [GH] and simple redirects or Form Loader actions??
I probably wouldn't do it this way* - but I'm not at all sure what you are trying to do here :-( Please can you explain the objective?
Bob
* Maybe using the Event Switcher [GH] and simple redirects or Form Loader actions??
Hi Bob,
The form that I am developing is to apply for membership of our U3A organisation. It can be completed by individuals or by office staff on behalf of an individual. If the former, then on completion of the form, I want to transfer to the site front page. If the latter, completed by the office staff, I want to transfer to a different form - a list of receipts - so that the officer can record payment of a membership fee.
Does that make things clearer?
The form that I am developing is to apply for membership of our U3A organisation. It can be completed by individuals or by office staff on behalf of an individual. If the former, then on completion of the form, I want to transfer to the site front page. If the latter, completed by the office staff, I want to transfer to a different form - a list of receipts - so that the officer can record payment of a membership fee.
Does that make things clearer?
Hi Bob
I can see that the Show Form Action works fine to one form. I presume then that I use that Event Switcher and embed a Show Form in each one, setting different forms in each. Can you point me to an example that shows me how to use those? I want to direct different user groups to different forms. So how do I make a specific event trigger for each group? As I understand it, write code in the Event Switcher box. I need an example of how to do that. 🤨 😶
Regards
Nick
I can see that the Show Form Action works fine to one form. I presume then that I use that Event Switcher and embed a Show Form in each one, setting different forms in each. Can you point me to an example that shows me how to use those? I want to direct different user groups to different forms. So how do I make a specific event trigger for each group? As I understand it, write code in the Event Switcher box. I need an example of how to do that. 🤨 😶
Regards
Nick
Always happens - I think that I have found it.
http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=26&t=21096&start=30
Is there one of your excellent tutorials around?
http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=26&t=21096&start=30
Is there one of your excellent tutorials around?
Hi Nick,
Using the Event Switcher is one way, you could then add a ReDirect User action to send the individuals to the home page; and a Show Form action in a second event to redirect the Officials. That would work OK but is a bit complicated.
Here's how I would do this in a Custom Code action; assuming that Officials are in User Group 99:
This will redirect the individuals away from the form and so any remaining actions after the Custom Code action will only be run for Officials.
Bob
Using the Event Switcher is one way, you could then add a ReDirect User action to send the individuals to the home page; and a Show Form action in a second event to redirect the Officials. That would work OK but is a bit complicated.
Here's how I would do this in a Custom Code action; assuming that Officials are in User Group 99:
<?php
$user =& JFactory::getUser();
$groups = $user->getUserGroups();
if ( !in_array('99', $groups ) {
// this is an individual user
$mainframe =& JFactory::getApplication();
$mainframe->redirect('index.php');
}
?>
This will redirect the individuals away from the form and so any remaining actions after the Custom Code action will only be run for Officials.
Bob
Many thanks Bob - much neater and all more information for the future.
I had to make a few changes to get it to work - a couple of typos. Just for the record for others
I had to make a few changes to get it to work - a couple of typos. Just for the record for others
<?php
$user =& JFactory::getUser();
$groups = $user->groups;
if ( !in_array('10', $groups)) {
// this is an individual user
$mainframe =& JFactory::getApplication();
$mainframe->redirect('index.php');
}
?>
This topic is locked and no more replies can be posted.