[otrs-cvs] TimeAccounting/Kernel/Modules AgentTimeAccounting.pm, 1.90, 1.91
"CVS commits notifications of OTRS.org" <[email protected]>
| Newsgroups | gmane.comp.otrs.cvs |
|---|---|
| Message-ID | <[email protected]> |
Comments:
Update of /home/cvs/TimeAccounting/Kernel/Modules
In directory lancelot:/tmp/cvs-serv20717/Kernel/Modules
Modified Files:
AgentTimeAccounting.pm
Log Message:
Code cleanup with OTRSRecode.
Author: mh
Index: AgentTimeAccounting.pm
===================================================================
RCS file: /home/cvs/TimeAccounting/Kernel/Modules/AgentTimeAccounting.pm,v
retrieving revision 1.90
retrieving revision 1.91
diff -2 -u -d -r1.90 -r1.91
--- AgentTimeAccounting.pm 2 Nov 2012 18:48:12 -0000 1.90
+++ AgentTimeAccounting.pm 30 Nov 2012 15:56:50 -0000 1.91
@@ -168,6 +168,7 @@
my %UserData
- = $Self->{TimeAccountingObject}
- ->SingleUserSettingsGet( UserID => $GetParam{UserID} );
+ = $Self->{TimeAccountingObject}->SingleUserSettingsGet(
+ UserID => $GetParam{UserID}
+ );
# get parameters for all registered periods
@@ -340,5 +341,5 @@
# if more than one check box was checked it is a server error
if ( scalar keys %CheckboxCheck > 1 ) {
- for my $Checkbox ( keys %CheckboxCheck ) {
+ for my $Checkbox ( sort keys %CheckboxCheck ) {
$Errors{ $Checkbox . 'Invalid' } = 'ServerError';
}
@@ -494,6 +495,6 @@
push @StartTimeServerErrorBlock, 'StartTimeRepeatedHourServerError'
if !
- grep( /^StartTimeRepeatedHourServerError$/,
- @StartTimeServerErrorBlock );
+ grep( /^StartTimeRepeatedHourServerError$/,
+ @StartTimeServerErrorBlock );
}
else {
@@ -501,6 +502,6 @@
push @EndTimeServerErrorBlock, 'EndTimeRepeatedHourServerError'
if !
- grep( /^EndTimeRepeatedHourServerError$/,
- @EndTimeServerErrorBlock );
+ grep( /^EndTimeRepeatedHourServerError$/,
+ @EndTimeServerErrorBlock );
}
}
@@ -510,6 +511,6 @@
push @StartTimeServerErrorBlock, 'StartTimeRepeatedHourServerError'
if !
- grep( /^StartTimeRepeatedHourServerError$/,
- @StartTimeServerErrorBlock );
+ grep( /^StartTimeRepeatedHourServerError$/,
+ @StartTimeServerErrorBlock );
}
@@ -518,6 +519,6 @@
push @EndTimeServerErrorBlock, 'EndTimeRepeatedHourServerError'
if !
- grep( /^EndTimeRepeatedHourServerError$/,
- @EndTimeServerErrorBlock );
+ grep( /^EndTimeRepeatedHourServerError$/,
+ @EndTimeServerErrorBlock );
}
@@ -530,6 +531,6 @@
push @StartTimeServerErrorBlock, 'StartTimeRepeatedHourServerError'
if !
- grep( /^StartTimeRepeatedHourServerError$/,
- @StartTimeServerErrorBlock );
+ grep( /^StartTimeRepeatedHourServerError$/,
+ @StartTimeServerErrorBlock );
}
@@ -542,6 +543,6 @@
push @EndTimeServerErrorBlock, 'EndTimeRepeatedHourServerError'
if !
- grep( /^EndTimeRepeatedHourServerError$/,
- @EndTimeServerErrorBlock );
+ grep( /^EndTimeRepeatedHourServerError$/,
+ @EndTimeServerErrorBlock );
}
}
@@ -700,5 +701,5 @@
my @ActionIDs = sort { $ActionList{$a} cmp $ActionList{$b} } keys %ActionList;
my @JSActions;
- foreach my $ActionID (@ActionIDs) {
+ for my $ActionID (@ActionIDs) {
push @JSActions, "['$ActionID', '$ActionList{$ActionID}']";
}
@@ -708,5 +709,5 @@
= $Self->{ConfigObject}->Get('TimeAccounting::ActionListConstraints');
my @JSActionListConstraints;
- for my $ProjectNameRegExp ( keys %{$ActionListConstraints} ) {
+ for my $ProjectNameRegExp ( sort keys %{$ActionListConstraints} ) {
my $ActionNameRegExp = $ActionListConstraints->{$ProjectNameRegExp};
s{(['"\\])}{\\$1}smxg for ( $ProjectNameRegExp, $ActionNameRegExp );
@@ -1043,5 +1044,5 @@
);
- foreach my $WorkingDays ( sort keys %IncompleteWorkingDaysList ) {
+ for my $WorkingDays ( sort keys %IncompleteWorkingDaysList ) {
my ( $Year, $Month, $Day )
= split( /-/, $IncompleteWorkingDaysList{$WorkingDays} );
@@ -1176,6 +1177,7 @@
}
elsif ( $Param{Notification} eq 'Successful' ) {
- $Output .= $Self->{LayoutObject}
- ->Notify( Info => 'Successfully inserted entries for several dates!', );
+ $Output .= $Self->{LayoutObject}->Notify(
+ Info => 'Successfully inserted entries for several dates!',
+ );
}
@@ -1950,5 +1952,5 @@
# Only one function should be enough
- for my $UserID ( keys %ShownUsers ) {
+ for my $UserID ( sort keys %ShownUsers ) {
# Overview per project and action
@@ -1961,5 +1963,5 @@
if ( $ProjectData{ $Param{ProjectID} } ) {
my $ActionsRef = $ProjectData{ $Param{ProjectID} }{Actions};
- for my $ActionID ( keys %{$ActionsRef} ) {
+ for my $ActionID ( sort keys %{$ActionsRef} ) {
$ProjectTime{$ActionID}{$UserID}{Hours} = $ActionsRef->{$ActionID}{Total};
}
@@ -1980,5 +1982,5 @@
# better solution for sort actions necessary
my %NewAction = ();
- for my $ActionID ( keys %ProjectTime ) {
+ for my $ActionID ( sort keys %ProjectTime ) {
$NewAction{$ActionID} = $Action{$ActionID}{Action};
}
@@ -2527,5 +2529,5 @@
Result => 'HASH',
);
- for my $GroupKey ( keys %Groups ) {
+ for my $GroupKey ( sort keys %Groups ) {
if ( $Groups{$GroupKey} eq 'time_accounting' && !$GroupData{$GroupKey} ) {
@@ -2643,5 +2645,5 @@
# save entries in the db
- foreach my $Date (@Dates) {
+ for my $Date (@Dates) {
my ( $Year, $Month, $Day ) = split /[-]/, $Date;
@@ -2740,5 +2742,5 @@
Result => 'HASH',
);
- for my $GroupKey ( keys %GroupList ) {
+ for my $GroupKey ( sort keys %GroupList ) {
if ( $GroupList{$GroupKey} eq 'time_accounting' ) {
return $Self->{LayoutObject}->Redirect(
@@ -2761,5 +2763,5 @@
# get action settings
ACTIONID:
- for my $ActionID ( keys %Action ) {
+ for my $ActionID ( sort keys %Action ) {
next ACTIONID if !$Action{$ActionID}{ActionStatus};
next ACTIONID if !$Action{$ActionID}{Action};
@@ -2790,10 +2792,10 @@
# loop over actions to find matches for configured project
# and action regexp pairs
- for my $ActionID ( keys %{ $Param{ActionList} } ) {
+ for my $ActionID ( sort keys %{ $Param{ActionList} } ) {
my $ActionName = $Param{ActionList}->{$ActionID};
REGEXP:
- for my $ProjectNameRegExp ( keys %{ $Param{ActionListConstraints} } ) {
+ for my $ProjectNameRegExp ( sort keys %{ $Param{ActionListConstraints} } ) {
my $ActionNameRegExp = $Param{ActionListConstraints}->{$ProjectNameRegExp};
if (
@@ -2812,5 +2814,5 @@
# all available actions will be added if no action was added above (possible misconfiguration)
if ( !keys %List ) {
- for my $ActionID ( keys %{ $Param{ActionList} } ) {
+ for my $ActionID ( sort keys %{ $Param{ActionList} } ) {
my $ActionName = $Param{ActionList}->{$ActionID};
$List{$ActionID} = $ActionName;
@@ -2897,6 +2899,5 @@
}
-sub _ProjectListConstraints
-{
+sub _ProjectListConstraints {
my ( $Self, %Param ) = @_;
@@ -2918,5 +2919,5 @@
# get project list constraints
my %ProjectRegex;
- for my $ProjectRegex ( keys %{$ProjectListConstraints} ) {
+ for my $ProjectRegex ( sort keys %{$ProjectListConstraints} ) {
for my $ProjectGroup ( split /,\s*/, $ProjectListConstraints->{$ProjectRegex} ) {
if ( $Groups{$ProjectGroup} ) {
@@ -2976,5 +2977,5 @@
my $Project2RemarkRegExp = $Self->{ConfigObject}->Get('TimeAccounting::Project2RemarkRegExp');
- for my $ProjectID ( keys %{ $ProjectData{Project} } ) {
+ for my $ProjectID ( sort keys %{ $ProjectData{Project} } ) {
if ( $ProjectData{Project}{$ProjectID} =~ m{$Project2RemarkRegExp}smx ) {
push @Projects2Remark, $ProjectID;
@@ -3364,6 +3365,7 @@
if (%User) {
my $LastPeriodNumber
- = $Self->{TimeAccountingObject}
- ->UserLastPeriodNumberGet( UserID => $Param{UserID} );
+ = $Self->{TimeAccountingObject}->UserLastPeriodNumberGet(
+ UserID => $Param{UserID}
+ );
for ( my $Period = 1; $Period <= $LastPeriodNumber; $Period++ ) {
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log