Merge pull request #4009 from cunha17/ticket/14253

* cunha17-master:
  [ticket/14253] Show group requests pending aproval at the ACP groups summary
  [ticket/14253] Show group requests pending aproval at the ACP groups summary

fixes #4009
This commit is contained in:
Tristan Darricau 2016-01-25 13:15:52 +01:00
commit 56062a2635
3 changed files with 12 additions and 4 deletions

View file

@ -267,11 +267,12 @@
<!-- EVENT acp_groups_manage_before --> <!-- EVENT acp_groups_manage_before -->
<table class="table1"> <table class="table1">
<col class="col1" /><col class="col1" /><col class="col2" /><col class="col2" /><col class="col2" /> <col class="col1" /><col class="col1" /><col class="col1" /><col class="col2" /><col class="col2" /><col class="col2" />
<thead> <thead>
<tr> <tr>
<th style="width: 50%">{L_GROUP}</th> <th style="width: 50%">{L_GROUP}</th>
<th>{L_TOTAL_MEMBERS}</th> <th>{L_TOTAL_MEMBERS}</th>
<th>{L_PENDING_MEMBERS}</th>
<th colspan="2">{L_OPTIONS}</th> <th colspan="2">{L_OPTIONS}</th>
<th>{L_ACTION}</th> <th>{L_ACTION}</th>
</tr> </tr>
@ -281,7 +282,7 @@
<!-- IF groups.S_SPECIAL --> <!-- IF groups.S_SPECIAL -->
<!-- IF groups.S_FIRST_ROW --> <!-- IF groups.S_FIRST_ROW -->
<tr> <tr>
<td colspan="5" class="row3">{L_NO_GROUPS_CREATED}</td> <td colspan="6" class="row3">{L_NO_GROUPS_CREATED}</td>
</tr> </tr>
<!-- ENDIF --> <!-- ENDIF -->
</tbody> </tbody>
@ -302,11 +303,12 @@
<p>{L_SPECIAL_GROUPS_EXPLAIN}</p> <p>{L_SPECIAL_GROUPS_EXPLAIN}</p>
<table class="table1"> <table class="table1">
<col class="col1" /><col class="col1" /><col class="col2" /><col class="col2" /><col class="col2" /> <col class="col1" /><col class="col1" /><col class="col1" /><col class="col2" /><col class="col2" />
<thead> <thead>
<tr> <tr>
<th style="width: 50%">{L_GROUP}</th> <th style="width: 50%">{L_GROUP}</th>
<th>{L_TOTAL_MEMBERS}</th> <th>{L_TOTAL_MEMBERS}</th>
<th>{L_PENDING_MEMBERS}</th>
<th colspan="2">{L_OPTIONS}</th> <th colspan="2">{L_OPTIONS}</th>
<th>{L_ACTION}</th> <th>{L_ACTION}</th>
</tr> </tr>
@ -316,6 +318,7 @@
<tr> <tr>
<td><strong>{groups.GROUP_NAME}</strong></td> <td><strong>{groups.GROUP_NAME}</strong></td>
<td style="text-align: center;">{groups.TOTAL_MEMBERS}</td> <td style="text-align: center;">{groups.TOTAL_MEMBERS}</td>
<td style="text-align: center;">{groups.PENDING_MEMBERS}</td>
<td style="text-align: center;"><a href="{groups.U_EDIT}">{L_SETTINGS}</a></td> <td style="text-align: center;"><a href="{groups.U_EDIT}">{L_SETTINGS}</a></td>
<td style="text-align: center;"><a href="{groups.U_LIST}">{L_MEMBERS}</a></td> <td style="text-align: center;"><a href="{groups.U_LIST}">{L_MEMBERS}</a></td>
<td style="text-align: center;"><!-- IF not groups.S_GROUP_SPECIAL and groups.U_DELETE --><a href="{groups.U_DELETE}" data-ajax="row_delete">{L_DELETE}</a><!-- ELSE -->{L_DELETE}<!-- ENDIF --></td> <td style="text-align: center;"><!-- IF not groups.S_GROUP_SPECIAL and groups.U_DELETE --><a href="{groups.U_DELETE}" data-ajax="row_delete">{L_DELETE}</a><!-- ELSE -->{L_DELETE}<!-- ENDIF --></td>

View file

@ -930,11 +930,12 @@ class acp_groups
// used for easy access to the data within a group // used for easy access to the data within a group
$cached_group_data[$type][$row['group_id']] = $row; $cached_group_data[$type][$row['group_id']] = $row;
$cached_group_data[$type][$row['group_id']]['total_members'] = 0; $cached_group_data[$type][$row['group_id']]['total_members'] = 0;
$cached_group_data[$type][$row['group_id']]['pending_members'] = 0;
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
// How many people are in which group? // How many people are in which group?
$sql = 'SELECT COUNT(ug.user_id) AS total_members, ug.group_id $sql = 'SELECT COUNT(ug.user_id) AS total_members, SUM(ug.user_pending) AS pending_members, ug.group_id
FROM ' . USER_GROUP_TABLE . ' ug FROM ' . USER_GROUP_TABLE . ' ug
WHERE ' . $db->sql_in_set('ug.group_id', array_keys($lookup)) . ' WHERE ' . $db->sql_in_set('ug.group_id', array_keys($lookup)) . '
GROUP BY ug.group_id'; GROUP BY ug.group_id';
@ -944,6 +945,7 @@ class acp_groups
{ {
$type = $lookup[$row['group_id']]; $type = $lookup[$row['group_id']];
$cached_group_data[$type][$row['group_id']]['total_members'] = $row['total_members']; $cached_group_data[$type][$row['group_id']]['total_members'] = $row['total_members'];
$cached_group_data[$type][$row['group_id']]['pending_members'] = $row['pending_members'];
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
@ -972,6 +974,7 @@ class acp_groups
'GROUP_NAME' => $group_name, 'GROUP_NAME' => $group_name,
'TOTAL_MEMBERS' => $row['total_members'], 'TOTAL_MEMBERS' => $row['total_members'],
'PENDING_MEMBERS' => $row['pending_members']
)); ));
} }
} }

View file

@ -130,6 +130,8 @@ $lang = array_merge($lang, array(
'NO_USERS_ADDED' => 'No users were added to the group.', 'NO_USERS_ADDED' => 'No users were added to the group.',
'NO_VALID_USERS' => 'You havent entered any users eligible for that action.', 'NO_VALID_USERS' => 'You havent entered any users eligible for that action.',
'PENDING_MEMBERS' => 'Pending',
'SELECT_GROUP' => 'Select a group', 'SELECT_GROUP' => 'Select a group',
'SPECIAL_GROUPS' => 'Pre-defined groups', 'SPECIAL_GROUPS' => 'Pre-defined groups',
'SPECIAL_GROUPS_EXPLAIN' => 'Pre-defined groups are special groups, they cannot be deleted or directly modified. However you can still add users and alter basic settings.', 'SPECIAL_GROUPS_EXPLAIN' => 'Pre-defined groups are special groups, they cannot be deleted or directly modified. However you can still add users and alter basic settings.',