mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-12 10:31:09 +03:00
Mark get_all_groups_for_operator function as deprecated
This commit is contained in:
parent
4c9f963aa7
commit
e150bd1d26
@ -72,7 +72,7 @@ class CannedMessageController extends AbstractController
|
|||||||
|
|
||||||
// Build list of available groups
|
// Build list of available groups
|
||||||
$all_groups = in_isolation($operator)
|
$all_groups = in_isolation($operator)
|
||||||
? get_all_groups_for_operator($operator)
|
? get_groups_for_operator($operator)
|
||||||
: get_all_groups();
|
: get_all_groups();
|
||||||
$page['groups'] = array();
|
$page['groups'] = array();
|
||||||
$page['groups'][] = array(
|
$page['groups'][] = array(
|
||||||
|
@ -404,7 +404,7 @@ class HistoryController extends AbstractController
|
|||||||
// Also the operator can view threads for the groups he belongs too.
|
// Also the operator can view threads for the groups he belongs too.
|
||||||
// These threads include ones that had no related operator but were
|
// These threads include ones that had no related operator but were
|
||||||
// started for a specified group.
|
// started for a specified group.
|
||||||
$groups = get_all_groups_for_operator($operator);
|
$groups = get_groups_for_operator($operator);
|
||||||
|
|
||||||
$groups_placeholders = array();
|
$groups_placeholders = array();
|
||||||
$counter = 0;
|
$counter = 0;
|
||||||
|
@ -53,7 +53,7 @@ class GroupsController extends AbstractController
|
|||||||
);
|
);
|
||||||
|
|
||||||
$groups = $operator_in_isolation
|
$groups = $operator_in_isolation
|
||||||
? get_all_groups_for_operator($operator)
|
? get_groups_for_operator($operator)
|
||||||
: get_all_groups();
|
: get_all_groups();
|
||||||
|
|
||||||
$can_modify = is_capable(CAN_ADMINISTRATE, $operator);
|
$can_modify = is_capable(CAN_ADMINISTRATE, $operator);
|
||||||
@ -114,7 +114,7 @@ class GroupsController extends AbstractController
|
|||||||
|
|
||||||
// Get all groups that are available for the target operator.
|
// Get all groups that are available for the target operator.
|
||||||
$groups = $operator_in_isolation
|
$groups = $operator_in_isolation
|
||||||
? get_all_groups_for_operator($operator)
|
? get_groups_for_operator($operator)
|
||||||
: get_all_groups();
|
: get_all_groups();
|
||||||
|
|
||||||
// Build list of operator's new groups.
|
// Build list of operator's new groups.
|
||||||
|
@ -514,27 +514,21 @@ function get_all_groups()
|
|||||||
return get_sorted_child_groups_($groups);
|
return get_sorted_child_groups_($groups);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves list of groups the operator can see.
|
||||||
|
*
|
||||||
|
* This function keeps in mind groups isolation.
|
||||||
|
*
|
||||||
|
* @deprecated since 2.1.1. Use {@link get_groups_for_operator()} function
|
||||||
|
* instead.
|
||||||
|
* @param array $operator List of operator's fields. See
|
||||||
|
* {@link operator_by_id()} for details of its keys.
|
||||||
|
* @return array List of group arrays. See {@link group_by_id()} for details
|
||||||
|
* about their structure.
|
||||||
|
*/
|
||||||
function get_all_groups_for_operator($operator)
|
function get_all_groups_for_operator($operator)
|
||||||
{
|
{
|
||||||
$db = Database::getInstance();
|
return get_groups_for_operator($operator, false);
|
||||||
$query = "SELECT DISTINCT g.groupid AS groupid, g.parent, g.vclocalname, g.vclocaldescription "
|
|
||||||
. "FROM {opgroup} g, "
|
|
||||||
. "(SELECT {opgroup}.groupid, {opgroup}.parent FROM {opgroup}, {operatortoopgroup} "
|
|
||||||
. "WHERE {opgroup}.groupid = {operatortoopgroup}.groupid "
|
|
||||||
. "AND {operatortoopgroup}.operatorid = ?) i "
|
|
||||||
. "WHERE g.groupid = i.parent "
|
|
||||||
. "OR g.parent = i.groupid "
|
|
||||||
. "OR (g.parent = i.parent AND g.parent IS NOT NULL) "
|
|
||||||
. "OR g.groupid = i.groupid "
|
|
||||||
. "ORDER BY vclocalname";
|
|
||||||
|
|
||||||
$groups = $db->query(
|
|
||||||
$query,
|
|
||||||
array($operator['operatorid']),
|
|
||||||
array('return_rows' => Database::RETURN_ALL_ROWS)
|
|
||||||
);
|
|
||||||
|
|
||||||
return get_sorted_child_groups_($groups);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_sorted_child_groups_(
|
function get_sorted_child_groups_(
|
||||||
@ -643,7 +637,7 @@ function get_groups($check_away)
|
|||||||
return get_groups_($check_away, null);
|
return get_groups_($check_away, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_groups_for_operator($operator, $check_away)
|
function get_groups_for_operator($operator, $check_away = false)
|
||||||
{
|
{
|
||||||
return get_groups_($check_away, $operator);
|
return get_groups_($check_away, $operator);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user