Index: /modules/branches/2.10/ringgroups/functions.inc.php =================================================================== --- /modules/branches/2.10/ringgroups/functions.inc.php (revision 13091) +++ /modules/branches/2.10/ringgroups/functions.inc.php (revision 13456) @@ -428,3 +428,40 @@ } } + +if ($amp_conf['EXTENSION_LIST_RINGGROUPS']) { + + function ringgroups_configpageinit($pagename) { + global $currentcomponent; + // On a 'new' user, 'tech_hardware' is set, and there's no extension. + if (($_REQUEST['display'] == 'users'||$_REQUEST['display'] == 'extensions')&& isset($_REQUEST['extdisplay']) && $_REQUEST['extdisplay'] != '') { + $currentcomponent->addprocessfunc('ringgroups_configpageload', 1); + } + } + + // This is called before the page is actually displayed, so we can use addguielem(). draws hook on the extensions/users page + function ringgroups_configpageload() { + global $currentcomponent; + global $display; + $extdisplay=isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:''; + + if ($display == 'extensions' || $display == 'users') { + $section = _('Ring Group Membership'); + + $sql = "SELECT grpnum, description FROM ringgroups WHERE grplist LIKE '$extdisplay-%' OR grplist LIKE '%-$extdisplay-%' OR grplist LIKE '%-$extdisplay' OR grplist = '$extdisplay'"; + $results = sql($sql,"getAll",DB_FETCHMODE_ASSOC); + + $ringgroup_count = 0; + foreach($results as $result) { + $addURL = $_SERVER['PHP_SELF'].'?display=ringgroups&extdisplay='.$result['grpnum']; + $ringgroup_icon = 'images/email_edit.png'; + $ringgroup_label = $result['grpnum']." ".$result['description']; + $ringgroup_label = '  + '.$ringgroup_label. + ' '; + $currentcomponent->addguielem($section, new gui_link('ringgroup_'.$ringgroup_count++, $ringgroup_label, $addURL, true, false), 9); + } + } + } + +} // only included if feature enabled ?> Index: /modules/branches/2.10/ringgroups/install.php =================================================================== --- /modules/branches/2.10/ringgroups/install.php (revision 13091) +++ /modules/branches/2.10/ringgroups/install.php (revision 13456) @@ -321,3 +321,22 @@ } } + +$freepbx_conf =& freepbx_conf::create(); + +// EXTENSION_LIST_RINGGROUPS +// +$set['value'] = false; +$set['defaultval'] =& $set['value']; +$set['readonly'] = 0; +$set['hidden'] = 0; +$set['level'] = 0; +$set['module'] = 'ringgroups'; +$set['category'] = 'Ring Group Module'; +$set['emptyok'] = 0; +$set['sortorder'] = 50; +$set['name'] = 'Display Extension Ring Group Members'; +$set['description'] = 'When set to true extensions that belong to one or more Ring Groups will have a Ring Group section and link back to each group they are a member of.'; +$set['type'] = CONF_TYPE_BOOL; +$freepbx_conf->define_conf_setting('EXTENSION_LIST_RINGGROUPS',$set); + ?>