[otrs-cvs] SIRIOS/Kernel/Output/HTML NotificationSIRIOS.pm, 1.3,
1.4 NotificationSIRIOSWorkflow.pm, 1.7, 1.8
cvs-log at otrs.org
cvs-log at otrs.org
Sun Feb 3 08:19:24 GMT 2008
Comments:
Update of /home/cvs/SIRIOS/Kernel/Output/HTML
In directory lancelot:/tmp/cvs-serv20697/Kernel/Output/HTML
Modified Files:
NotificationSIRIOS.pm NotificationSIRIOSWorkflow.pm
Log Message:
Use OTRSRecode to improve the code style.
Author: tr
Index: NotificationSIRIOS.pm
===================================================================
RCS file: /home/cvs/SIRIOS/Kernel/Output/HTML/NotificationSIRIOS.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** NotificationSIRIOS.pm 7 Dec 2006 13:27:05 -0000 1.3
--- NotificationSIRIOS.pm 3 Feb 2008 08:19:19 -0000 1.4
***************
*** 1,5 ****
# --
# Kernel/Output/HTML/NotificationSIRIOS.pm
! # Copyright (C) 2003-2006 OTRS GmbH, http://otrs.com/
# --
# $Id$
--- 1,5 ----
# --
# Kernel/Output/HTML/NotificationSIRIOS.pm
! # Copyright (C) 2001-2008 OTRS AG, http://otrs.org/
# --
# $Id$
***************
*** 7,11 ****
# 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 http://www.gnu.org/licenses/gpl.txt.
# --
--- 7,11 ----
# 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 http://www.gnu.org/licenses/gpl-2.0.txt.
# --
***************
*** 13,32 ****
use strict;
use Kernel::System::AuthSession;
use vars qw($VERSION);
! $VERSION = '$Revision$';
! $VERSION =~ s/^\$.*:\W(.*)\W.+?$/$1/;
sub new {
! my $Type = shift;
! my %Param = @_;
# allocate new hash for object
my $Self = {};
! bless ($Self, $Type);
# get needed objects
! foreach (qw(ConfigObject LogObject DBObject LayoutObject UserID)) {
$Self->{$_} = $Param{$_} || die "Got no $_!";
}
--- 13,32 ----
use strict;
+ use warnings;
+
use Kernel::System::AuthSession;
use vars qw($VERSION);
! $VERSION = qw($Revision$) [1];
sub new {
! my ( $Type, %Param ) = @_;
# allocate new hash for object
my $Self = {};
! bless( $Self, $Type );
# get needed objects
! for (qw(ConfigObject LogObject DBObject LayoutObject UserID)) {
$Self->{$_} = $Param{$_} || die "Got no $_!";
}
***************
*** 36,64 ****
sub Run {
! my $Self = shift;
! my %Param = @_;
# get session info
my %WorkingGroups = ();
! my @Sessions = $Self->{SessionObject}->GetAllSessionIDs();
! foreach (@Sessions) {
my %Data = $Self->{SessionObject}->GetSessionIDData(
SessionID => $_,
);
! foreach (keys %Data) {
! if ($_ eq 'PrimaryRoleRealname') {
! $WorkingGroups{$Data{$_}}++;
}
}
}
! foreach (keys %WorkingGroups) {
! if ($Param{Message}) {
$Param{Message} .= ", ";
}
$Param{Message} .= "$_ ($WorkingGroups{$_})";
}
! if ($Param{Message}) {
$Param{Message} .= ";";
}
! return $Self->{LayoutObject}->Notify(Info => $Self->{LayoutObject}->{LanguageObject}->Get('Active Roles').': '.$Param{Message});
}
--- 36,68 ----
sub Run {
! my ( $Self, %Param ) = @_;
!
# get session info
my %WorkingGroups = ();
! my @Sessions = $Self->{SessionObject}->GetAllSessionIDs();
! for (@Sessions) {
my %Data = $Self->{SessionObject}->GetSessionIDData(
SessionID => $_,
);
! for ( keys %Data ) {
! if ( $_ eq 'PrimaryRoleRealname' ) {
! $WorkingGroups{ $Data{$_} }++;
}
}
}
! for ( keys %WorkingGroups ) {
! if ( $Param{Message} ) {
$Param{Message} .= ", ";
}
$Param{Message} .= "$_ ($WorkingGroups{$_})";
}
! if ( $Param{Message} ) {
$Param{Message} .= ";";
}
! return $Self->{LayoutObject}
! ->Notify(
! Info => $Self->{LayoutObject}->{LanguageObject}->Get('Active Roles') . ': '
! . $Param{Message}
! );
}
Author: tr
Index: NotificationSIRIOSWorkflow.pm
===================================================================
RCS file: /home/cvs/SIRIOS/Kernel/Output/HTML/NotificationSIRIOSWorkflow.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** NotificationSIRIOSWorkflow.pm 22 May 2007 11:27:49 -0000 1.7
--- NotificationSIRIOSWorkflow.pm 3 Feb 2008 08:19:19 -0000 1.8
***************
*** 1,5 ****
# --
# Kernel/Output/HTML/NotificationSIRIOSWorkflow.pm
! # Copyright (C) 2001-2007 OTRS GmbH, http://otrs.org/
# --
# $Id$
--- 1,5 ----
# --
# Kernel/Output/HTML/NotificationSIRIOSWorkflow.pm
! # Copyright (C) 2001-2008 OTRS AG, http://otrs.org/
# --
# $Id$
***************
*** 7,11 ****
# 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 http://www.gnu.org/licenses/gpl.txt.
# --
--- 7,11 ----
# 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 http://www.gnu.org/licenses/gpl-2.0.txt.
# --
***************
*** 13,31 ****
use strict;
use vars qw($VERSION);
! $VERSION = '$Revision$';
! $VERSION =~ s/^\$.*:\W(.*)\W.+?$/$1/;
sub new {
! my $Type = shift;
! my %Param = @_;
# allocate new hash for object
my $Self = {};
! bless ($Self, $Type);
# get needed objects
! foreach (qw(ConfigObject LogObject DBObject LayoutObject UserID GroupObject QueueObject TicketObject ParamObject)) {
$Self->{$_} = $Param{$_} || die "Got no $_!";
}
--- 13,33 ----
use strict;
+ use warnings;
use vars qw($VERSION);
! $VERSION = qw($Revision$) [1];
sub new {
! my ( $Type, %Param ) = @_;
# allocate new hash for object
my $Self = {};
! bless( $Self, $Type );
# get needed objects
! for (
! qw(ConfigObject LogObject DBObject LayoutObject UserID GroupObject QueueObject TicketObject ParamObject)
! )
! {
$Self->{$_} = $Param{$_} || die "Got no $_!";
}
***************
*** 35,67 ****
sub Run {
! my $Self = shift;
! my %Param = @_;
my $Output = '';
! if ($Self->{LayoutObject}->{Action} ne 'AgentTicketZoom') {
return '';
}
! my $TicketID = $Self->{ParamObject}->GetParam(Param => 'TicketID') || return;
! my %Ticket = $Self->{TicketObject}->TicketGet(TicketID => $TicketID);
# show involved workflows
my %Groups = $Self->{GroupObject}->GroupMemberList(
UserID => $Self->{UserID},
! Type => 'rw',
Result => 'HASH',
);
! foreach my $WFG (keys %{$Self->{ConfigObject}->Get('Workflow')}) {
! foreach my $WF (keys %{$Self->{ConfigObject}->Get('Workflow')->{$WFG}}) {
! my $String = '';
my $IsInGroup = 0;
! foreach my $Queue (@{$Self->{ConfigObject}->Get('Workflow')->{$WFG}->{$WF}}) {
! my %Queue = $Self->{QueueObject}->QueueGet(Name => $Queue);
! if ($Queue{GroupID}) {
my @Result = $Self->{TicketObject}->TicketSearch(
Result => 'ARRAY',
Queues => [$Queue],
# States => ['new', 'open'],
StateType => 'Open',
# UserID => $Self->{UserID},
! UserID => 1,
Permission => 'ro',
);
--- 37,72 ----
sub Run {
! my ( $Self, %Param ) = @_;
!
my $Output = '';
! if ( $Self->{LayoutObject}->{Action} ne 'AgentTicketZoom' ) {
return '';
}
! my $TicketID = $Self->{ParamObject}->GetParam( Param => 'TicketID' ) || return;
! my %Ticket = $Self->{TicketObject}->TicketGet( TicketID => $TicketID );
!
# show involved workflows
my %Groups = $Self->{GroupObject}->GroupMemberList(
UserID => $Self->{UserID},
! Type => 'rw',
Result => 'HASH',
);
! for my $WFG ( keys %{ $Self->{ConfigObject}->Get('Workflow') } ) {
! for my $WF ( keys %{ $Self->{ConfigObject}->Get('Workflow')->{$WFG} } ) {
! my $String = '';
my $IsInGroup = 0;
! for my $Queue ( @{ $Self->{ConfigObject}->Get('Workflow')->{$WFG}->{$WF} } ) {
! my %Queue = $Self->{QueueObject}->QueueGet( Name => $Queue );
! if ( $Queue{GroupID} ) {
my @Result = $Self->{TicketObject}->TicketSearch(
Result => 'ARRAY',
Queues => [$Queue],
+
# States => ['new', 'open'],
StateType => 'Open',
+
# UserID => $Self->{UserID},
! UserID => 1,
Permission => 'ro',
);
***************
*** 69,89 ****
$String .= ' -> ';
}
! if ($Queue eq $Ticket{Queue}) {
$String .= '<b>';
}
! if ($Groups{$Queue{GroupID}}) {
! my $Action = $Self->{ConfigObject}->Get('NotificationSIRIOSWorkflowLink') || "AgentTicketWorkflow" ;
! $String .= '<a href="$Env{"Baselink"}Action=' . $Action . '&Workflow=' . $WF . '&QueueID=' . $Queue{QueueID}.
! '">'. $Queue. ' (' . ($#Result+1) . ')</a>';
}
else {
! $String .= "$Queue (".($#Result+1).")";
}
! if ($Queue eq $Ticket{Queue}) {
$String .= '</b>';
}
}
! if ($Queue eq $Ticket{Queue}) {
$IsInGroup = 1;
}
--- 74,102 ----
$String .= ' -> ';
}
! if ( $Queue eq $Ticket{Queue} ) {
$String .= '<b>';
}
! if ( $Groups{ $Queue{GroupID} } ) {
! my $Action = $Self->{ConfigObject}->Get('NotificationSIRIOSWorkflowLink')
! || "AgentTicketWorkflow";
! $String
! .= '<a href="$Env{"Baselink"}Action='
! . $Action
! . '&Workflow='
! . $WF
! . '&QueueID='
! . $Queue{QueueID}
! .
! '">' . $Queue . ' (' . ( $#Result + 1 ) . ')</a>';
}
else {
! $String .= "$Queue (" . ( $#Result + 1 ) . ")";
}
! if ( $Queue eq $Ticket{Queue} ) {
$String .= '</b>';
}
}
! if ( $Queue eq $Ticket{Queue} ) {
$IsInGroup = 1;
}
More information about the cvs-log
mailing list