|
|
@ -299,10 +299,10 @@ function prepare_user_sql_query($is_count) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$variables = Session::read('variables_to_show', []); |
|
|
|
$variables = Session::read('variables_to_show', []); |
|
|
|
|
|
|
|
if (!empty($variables)) { |
|
|
|
$extraField = new ExtraField('user'); |
|
|
|
$extraField = new ExtraField('user'); |
|
|
|
|
|
|
|
|
|
|
|
$extraFieldResult = []; |
|
|
|
$extraFieldResult = []; |
|
|
|
|
|
|
|
$extraFieldHasData = []; |
|
|
|
foreach ($variables as $variable) { |
|
|
|
foreach ($variables as $variable) { |
|
|
|
if (isset($_GET['extra_'.$variable])) { |
|
|
|
if (isset($_GET['extra_'.$variable])) { |
|
|
|
if (is_array($_GET['extra_'.$variable])) { |
|
|
|
if (is_array($_GET['extra_'.$variable])) { |
|
|
@ -310,31 +310,53 @@ function prepare_user_sql_query($is_count) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$values = [$_GET['extra_'.$variable]]; |
|
|
|
$values = [$_GET['extra_'.$variable]]; |
|
|
|
} |
|
|
|
} |
|
|
|
$info = $extraField->get_handler_field_info_by_field_variable($variable); |
|
|
|
|
|
|
|
|
|
|
|
if (empty($values)) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$info = $extraField->get_handler_field_info_by_field_variable( |
|
|
|
|
|
|
|
$variable |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
if (empty($info)) { |
|
|
|
if (empty($info)) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
foreach ($values as $value) { |
|
|
|
foreach ($values as $value) { |
|
|
|
|
|
|
|
if (empty($value)) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
if ($info['field_type'] == ExtraField::FIELD_TYPE_TAG) { |
|
|
|
if ($info['field_type'] == ExtraField::FIELD_TYPE_TAG) { |
|
|
|
$result = $extraField->getAllUserPerTag($info['id'], $value); |
|
|
|
$result = $extraField->getAllUserPerTag( |
|
|
|
$result = empty($result) ? [] : array_column($result, 'user_id'); |
|
|
|
$info['id'], |
|
|
|
|
|
|
|
$value |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
$result = empty($result) ? [] : array_column( |
|
|
|
|
|
|
|
$result, |
|
|
|
|
|
|
|
'user_id' |
|
|
|
|
|
|
|
); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$result = UserManager::get_extra_user_data_by_value( |
|
|
|
$result = UserManager::get_extra_user_data_by_value( |
|
|
|
$variable, |
|
|
|
$variable, |
|
|
|
$value |
|
|
|
$value |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$extraFieldHasData[] = true; |
|
|
|
if (!empty($result)) { |
|
|
|
if (!empty($result)) { |
|
|
|
$extraFieldResult = array_merge($extraFieldResult, $result); |
|
|
|
$extraFieldResult = array_merge( |
|
|
|
|
|
|
|
$extraFieldResult, |
|
|
|
|
|
|
|
$result |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!empty($extraFieldResult)) { |
|
|
|
if (!empty($extraFieldHasData)) { |
|
|
|
$sql .= " AND (u.id IN ('".implode("','", $extraFieldResult)."')) "; |
|
|
|
$sql .= " AND (u.id IN ('".implode("','", $extraFieldResult)."')) "; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// adding the filter to see the user's only of the current access_url |
|
|
|
// adding the filter to see the user's only of the current access_url |
|
|
|
if ((api_is_platform_admin() || api_is_session_admin()) |
|
|
|
if ((api_is_platform_admin() || api_is_session_admin()) |
|
|
@ -457,7 +479,7 @@ function get_user_data($from, $number_of_items, $column, $direction) |
|
|
|
|
|
|
|
|
|
|
|
$res = Database::query($sql); |
|
|
|
$res = Database::query($sql); |
|
|
|
|
|
|
|
|
|
|
|
$users = array (); |
|
|
|
$users = array(); |
|
|
|
$t = time(); |
|
|
|
$t = time(); |
|
|
|
while ($user = Database::fetch_row($res)) { |
|
|
|
while ($user = Database::fetch_row($res)) { |
|
|
|
$userPicture = UserManager::getUserPicture($user[0], USER_IMAGE_SIZE_SMALL); |
|
|
|
$userPicture = UserManager::getUserPicture($user[0], USER_IMAGE_SIZE_SMALL); |
|
|
|