Bitrix Site Manager

CPosting::GetGroupList

CPosting::GetGroupList(
    $ID
);

The method GetGroupList returns a list of user groups to whom the message will be sent.

Parameters

ParameterDescription
$ID The issue ID.

Return Values

Returns an instance of the CDBResult class. The ID and NAME fields of the object "Group" become available after calling one of the CDBResult methods.

Example



<?
//show user groups and check selected for the issue
$aPostGrp = array();
if($ID>0)
{
    $post_grp = CPosting::GetGroupList($ID);
    while($post_grp_arr = $post_grp->Fetch()) 
        $aPostGrp[] = $post_grp_arr["ID"];
}
$group = CGroup::GetList(($by="name"), ($order="asc"));
while($group->ExtractFields("g_")):
?>
<input 
 type="checkbox" 
 name="GROUP_ID[]" 
 value="<?echo $g_ID?>"
 <?if(in_array($g_ID, $aPostGrp)) echo " checked"?>>
<?echo $g_NAME?><br>
<?
endwhile;
?>