init III
This commit is contained in:
94
Perl OTRS/Kernel/Modules/AgentITSMSLA.pm
Normal file
94
Perl OTRS/Kernel/Modules/AgentITSMSLA.pm
Normal file
@@ -0,0 +1,94 @@
|
||||
# --
|
||||
# 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::Modules::AgentITSMSLA;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Kernel::Language qw(Translatable);
|
||||
|
||||
our $ObjectManagerDisabled = 1;
|
||||
|
||||
sub new {
|
||||
my ( $Type, %Param ) = @_;
|
||||
|
||||
# allocate new hash for object
|
||||
my $Self = {%Param};
|
||||
bless( $Self, $Type );
|
||||
|
||||
return $Self;
|
||||
}
|
||||
|
||||
sub Run {
|
||||
my ( $Self, %Param ) = @_;
|
||||
|
||||
# get layout object
|
||||
my $LayoutObject = $Kernel::OM->Get('Kernel::Output::HTML::Layout');
|
||||
|
||||
# output overview
|
||||
$LayoutObject->Block(
|
||||
Name => 'Overview',
|
||||
Data => {%Param},
|
||||
);
|
||||
|
||||
# get sla object
|
||||
my $SLAObject = $Kernel::OM->Get('Kernel::System::SLA');
|
||||
|
||||
# get sla list
|
||||
my %SLAList = $SLAObject->SLAList(
|
||||
UserID => $Self->{UserID},
|
||||
);
|
||||
|
||||
if (%SLAList) {
|
||||
for my $SLAID ( sort { $SLAList{$a} cmp $SLAList{$b} } keys %SLAList ) {
|
||||
|
||||
# get sla data
|
||||
my %SLA = $SLAObject->SLAGet(
|
||||
SLAID => $SLAID,
|
||||
UserID => $Self->{UserID},
|
||||
);
|
||||
|
||||
# output overview row
|
||||
$LayoutObject->Block(
|
||||
Name => 'OverviewRow',
|
||||
Data => {
|
||||
%SLA,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
# otherwise it displays a no data found message
|
||||
else {
|
||||
$LayoutObject->Block(
|
||||
Name => 'NoDataFoundMsg',
|
||||
);
|
||||
}
|
||||
|
||||
# investigate refresh
|
||||
my $Refresh = $Self->{UserRefreshTime} ? 60 * $Self->{UserRefreshTime} : undef;
|
||||
|
||||
# output header
|
||||
my $Output = $LayoutObject->Header(
|
||||
Title => Translatable('Overview'),
|
||||
Refresh => $Refresh,
|
||||
);
|
||||
$Output .= $LayoutObject->NavigationBar();
|
||||
|
||||
# generate output
|
||||
$Output .= $LayoutObject->Output(
|
||||
TemplateFile => 'AgentITSMSLA',
|
||||
Data => \%Param,
|
||||
);
|
||||
$Output .= $LayoutObject->Footer();
|
||||
|
||||
return $Output;
|
||||
}
|
||||
|
||||
1;
|
||||
Reference in New Issue
Block a user