Index: branches/5.2.x/core/units/user_groups/user_groups_config.php =================================================================== diff -u -N -r14244 -r14437 --- branches/5.2.x/core/units/user_groups/user_groups_config.php (.../user_groups_config.php) (revision 14244) +++ branches/5.2.x/core/units/user_groups/user_groups_config.php (.../user_groups_config.php) (revision 14437) @@ -1,6 +1,6 @@ Array( 'UserName' => 'CONCAT(u.LastName, \' \', u.FirstName)', 'UserLogin' => 'u.Login', + 'PrimaryGroup' => 'IF(u.PrimaryGroupId = %1$s.GroupId, 1, 0)', ), ), 'VirtualFields' => Array ( @@ -83,33 +84,37 @@ 'TitleField' => 'GroupName', 'TableName' => TABLE_PREFIX.'UserGroup', - 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'PortalGroup g ON %1$s.GroupId = g.GroupId'), + 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s + FROM %1$s + LEFT JOIN '.TABLE_PREFIX.'PortalGroup g ON %1$s.GroupId = g.GroupId + LEFT JOIN '.TABLE_PREFIX.'%3$sPortalUser u ON %1$s.PortalUserId = u.PortalUserId'), - 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'PortalGroup g ON %1$s.GroupId = g.GroupId'), - 'AutoDelete' => true, 'AutoClone' => false, 'CalculatedFields' => Array ( '' => Array( 'GroupName' => 'g.Name', 'GroupDescription' => 'g.Description', + 'PrimaryGroup' => 'IF(u.PrimaryGroupId = %1$s.GroupId, 1, 0)', ), ), 'Fields' => Array( 'PortalUserId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), 'GroupId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), 'MembershipExpires' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null), - 'PrimaryGroup' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1), 'ExpirationReminderSent' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), ), 'VirtualFields' => Array ( 'GroupName' => Array('type' => 'string', 'default' => ''), 'GroupDescription' => Array('type' => 'string', 'default' => ''), + 'PrimaryGroup' => Array( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, + 'not_null' => 1, 'default' => 1 + ), ),