[otrs-cvs] ITSMChangeManagement/Kernel/System/ITSMChange/Number DateChecksum.pm, 1.1, 1.2 Date.pm, 1.1, 1.2
"CVS commits notifications of OTRS.org" <[email protected]> Tue, 9 Apr 2013 12:56:15 +0000
| Newsgroups | gmane.comp.otrs.cvs |
|---|---|
| Message-ID | <[email protected]> |
Comments:
Update of /home/cvs/ITSMChangeManagement/Kernel/System/ITSMChange/Number
In directory lancelot:/tmp/cvs-serv14981/Kernel/System/ITSMChange/Number
Modified Files:
DateChecksum.pm Date.pm
Log Message:
Small code style improvements.
Author: ub
Index: DateChecksum.pm
===================================================================
RCS file: /home/cvs/ITSMChangeManagement/Kernel/System/ITSMChange/Number/DateChecksum.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -2 -u -d -r1.1 -r1.2
--- DateChecksum.pm 29 Jun 2010 12:41:36 -0000 1.1
+++ DateChecksum.pm 9 Apr 2013 12:56:10 -0000 1.2
@@ -1,5 +1,5 @@
# --
# ITSMChange/Number/DateChecksum.pm - a date based change number generator
-# Copyright (C) 2001-2010 OTRS AG, http://otrs.org/
+# Copyright (C) 2001-2013 OTRS AG, http://otrs.org/
# --
# $Id$
@@ -54,9 +54,13 @@
my $Count = 0;
my $LastModify = '';
+
+ # try to read existing counter from file
if ( -f $CounterLog ) {
+
my $ContentSCALARRef = $Self->{MainObject}->FileRead(
Location => $CounterLog,
);
if ( $ContentSCALARRef && ${$ContentSCALARRef} ) {
+
( $Count, $LastModify ) = split( /;/, ${$ContentSCALARRef} );
@@ -89,11 +93,11 @@
Content => \$Content,
);
- if ($Write) {
- if ( $Self->{Debug} > 0 ) {
- $Self->{LogObject}->Log(
- Priority => 'debug',
- Message => "Write counter: $Count",
- );
- }
+
+ # log debug message
+ if ( $Write && $Self->{Debug} ) {
+ $Self->{LogObject}->Log(
+ Priority => 'debug',
+ Message => "Write counter: $Count",
+ );
}
Author: ub
Index: Date.pm
===================================================================
RCS file: /home/cvs/ITSMChangeManagement/Kernel/System/ITSMChange/Number/Date.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -2 -u -d -r1.1 -r1.2
--- Date.pm 29 Jun 2010 12:41:36 -0000 1.1
+++ Date.pm 9 Apr 2013 12:56:10 -0000 1.2
@@ -1,5 +1,5 @@
# --
# ITSMChange/Number/Date.pm - a date based change number generator
-# Copyright (C) 2001-2010 OTRS AG, http://otrs.org/
+# Copyright (C) 2001-2013 OTRS AG, http://otrs.org/
# --
# $Id$
@@ -10,5 +10,5 @@
# --
-# Generates ticket numbers like yyyymmddss##### (e. g. 2002062300001)
+# Generates change numbers like yyyymmddss##### (e. g. 2002062300001)
package Kernel::System::ITSMChange::Number::Date;
@@ -41,9 +41,14 @@
my $Count = 0;
my $LastModify = '';
+
+ # try to read existing counter from file
if ( -f $CounterLog ) {
+
my $ContentSCALARRef = $Self->{MainObject}->FileRead(
Location => $CounterLog,
);
+
if ( $ContentSCALARRef && ${$ContentSCALARRef} ) {
+
( $Count, $LastModify ) = split( /;/, ${$ContentSCALARRef} );
@@ -76,11 +81,12 @@
Content => \$Content,
);
- if ($Write) {
- if ( $Self->{Debug} > 0 ) {
- $Self->{LogObject}->Log(
- Priority => 'debug',
- Message => "Write counter: $Count",
- );
- }
+
+ # log debug message
+ if ( $Write && $Self->{Debug} ) {
+
+ $Self->{LogObject}->Log(
+ Priority => 'debug',
+ Message => "Write counter: $Count",
+ );
}
---------------------------------------------------------------------
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