This commit is contained in:
2024-10-14 00:08:40 +02:00
parent dbfba56f66
commit 1462d52e13
4572 changed files with 2658864 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
# --
# Copyright (C) 2001-2019 OTRS AG, https://otrs.com/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.
# --
package Kernel::System::SupportDataCollector::Plugin::OTRS::UI::AgentSkinUsage;
use strict;
use warnings;
use parent qw(Kernel::System::SupportDataCollector::PluginBase);
use Kernel::Language qw(Translatable);
our @ObjectDependencies = (
'Kernel::Config',
'Kernel::System::DB',
'Kernel::System::User',
);
sub GetDisplayPath {
return Translatable('OTRS') . '/' . Translatable('UI - Agent Skin Usage');
}
sub Run {
my $Self = shift;
# First get count of all agents. We avoid checking for Valid for performance reasons, as this
# would require fetching of all agent data to check for the preferences.
my $DBObject = $Kernel::OM->Get('Kernel::System::DB');
my $AgentsWithDefaultSkin = 1;
$DBObject->Prepare( SQL => 'SELECT count(*) FROM users' );
while ( my @Row = $DBObject->FetchrowArray() ) {
$AgentsWithDefaultSkin = $Row[0];
}
my $DefaultSkin = $Kernel::OM->Get('Kernel::Config')->Get('Loader::Agent::DefaultSelectedSkin');
my %SkinPreferences = $Kernel::OM->Get('Kernel::System::User')->SearchPreferences(
Key => 'UserSkin',
);
my %SkinUsage;
# Check how many agents have a skin preference configured, assume default skin for the rest.
for my $UserID ( sort keys %SkinPreferences ) {
$SkinUsage{ $SkinPreferences{$UserID} }++;
$AgentsWithDefaultSkin--;
}
$SkinUsage{$DefaultSkin} += $AgentsWithDefaultSkin;
for my $Skin ( sort keys %SkinUsage ) {
$Self->AddResultInformation(
Identifier => $Skin,
Label => $Skin,
Value => $SkinUsage{$Skin},
);
}
return $Self->GetResults();
}
1;

View File

@@ -0,0 +1,67 @@
# --
# Copyright (C) 2001-2019 OTRS AG, https://otrs.com/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.
# --
package Kernel::System::SupportDataCollector::Plugin::OTRS::UI::AgentThemeUsage;
use strict;
use warnings;
use parent qw(Kernel::System::SupportDataCollector::PluginBase);
use Kernel::Language qw(Translatable);
our @ObjectDependencies = (
'Kernel::Config',
'Kernel::System::DB',
'Kernel::System::User',
);
sub GetDisplayPath {
return Translatable('OTRS') . '/' . Translatable('UI - Agent Theme Usage');
}
sub Run {
my $Self = shift;
# First get count of all agents. We avoid checking for Valid for performance reasons, as this
# would require fetching of all agent data to check for the preferences.
my $DBObject = $Kernel::OM->Get('Kernel::System::DB');
my $AgentsWithDefaultTheme = 1;
$DBObject->Prepare( SQL => 'SELECT count(*) FROM users' );
while ( my @Row = $DBObject->FetchrowArray() ) {
$AgentsWithDefaultTheme = $Row[0];
}
my $DefaultThem = $Kernel::OM->Get('Kernel::Config')->Get('DefaultTheme');
my %ThemePreferences = $Kernel::OM->Get('Kernel::System::User')->SearchPreferences(
Key => 'UserTheme',
);
my %ThemeUsage;
# Check how many agents have a theme preference configured, assume default theme for the rest.
for my $UserID ( sort keys %ThemePreferences ) {
$ThemeUsage{ $ThemePreferences{$UserID} }++;
$AgentsWithDefaultTheme--;
}
$ThemeUsage{$DefaultThem} += $AgentsWithDefaultTheme;
for my $Theme ( sort keys %ThemeUsage ) {
$Self->AddResultInformation(
Identifier => $Theme,
Label => $Theme,
Value => $ThemeUsage{$Theme},
);
}
return $Self->GetResults();
}
1;

View File

@@ -0,0 +1,52 @@
# --
# Copyright (C) 2001-2019 OTRS AG, https://otrs.com/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.
# --
package Kernel::System::SupportDataCollector::Plugin::OTRS::UI::SpecialStats;
use strict;
use warnings;
use parent qw(Kernel::System::SupportDataCollector::PluginBase);
use Kernel::Language qw(Translatable);
our @ObjectDependencies = (
'Kernel::Config',
'Kernel::System::DB',
'Kernel::System::User',
);
sub GetDisplayPath {
return Translatable('OTRS') . '/' . Translatable('UI - Special Statistics');
}
sub Run {
my $Self = shift;
my %PreferenceMap = (
UserNavBarItemsOrder => Translatable('Agents using custom main menu ordering'),
AdminNavigationBarFavourites => Translatable('Agents using favourites for the admin overview'),
);
for my $Preference ( sort keys %PreferenceMap ) {
my %FoundPreferences = $Kernel::OM->Get('Kernel::System::User')->SearchPreferences(
Key => $Preference,
);
$Self->AddResultInformation(
Identifier => $Preference,
Label => $PreferenceMap{$Preference},
Value => scalar keys %FoundPreferences,
);
}
return $Self->GetResults();
}
1;