• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: use joomla group as drop down menu

use joomla group as drop down menu 11 years 10 months ago #23961

  • kklausen
  • kklausen's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 1
Would it be possible to use a joomla user group as the values of a drop down field ?

My groups in joomla is automated depending on the members ship in my ldap server, so any ldap group member of Manager is auto added to joomla group manager.

Now I would to take that group, Manager, and add that as a drop down menu as I will be sending e-mails to recipients listed in a drop-down field.

This is what I would use a base, a place for volunteers to select the manager in a form and the email goes to their manager.
www.rsjoomla.com/video-tutorials-on-joom...drop-down-field.html

Now to avoid too much administrative work, would it be possible to make that happen automatic depending on who is in the Manager group, take name and email and populate the values in the drob down field?

My programming skills are limited, so hoping someone out there can help if this is possible :)

Thank u
The administrator has disabled public write access.

use joomla group as drop down menu 11 years 10 months ago #23987

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

You can try using the following script within the dropdown's default value area (along with the code tags):
//<code>
$db =& JFactory::getDBO();
$db->setQuery("SELECT `name`,`email` FROM #__users LEFT JOIN #__user_usergroup_map ON #__users.id=#__user_usergroup_map.user_id WHERE #__user_usergroup_map.group_id=6");
$results = $db->loadObjectList();
$items[] = "|Please Select";
foreach ($results as $res){
	$value = $res->email;
	$label = $res->name;
	$items[] = $value.'|'.$label;
}
return implode("\n",$items);
//</code>

The script uses the "|" pipeline symbol to split the value from the label. In the frontend only the label will be showed, the label being the name of the manager and the value will be their email. This way you can use the dropdown's placeholder for the emails which will return the value, being the manager's email.

More information on the usage of the pipeline symbol can be found here:

www.rsjoomla.com/support/documentation/v...le/827-dropdown.html
This is not official customer support. To receive your support, submit a support ticket here.
Last Edit: 11 years 10 months ago by adrianp.
The administrator has disabled public write access.
The following user(s) said Thank You: kklausen, tewebmaster

use joomla group as drop down menu 11 years 10 months ago #24046

  • kklausen
  • kklausen's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 1
Thank u very much, that works :)
The administrator has disabled public write access.

use joomla group as drop down menu 11 years 3 months ago #26422

  • tewebmaster
  • tewebmaster's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
  • Thank you received: 1
Thank you! I was able to adapt your code to allow me to use a joomla group to automate who gets sent e-mails.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!