[otrs-cvs] ITSMConfigurationManagement/Kernel/System/ITSMConfigItem Version.pm, 1.33, 1.33.2.1
"CVS commits notifications of OTRS.org" <[email protected]>
| Newsgroups | gmane.comp.otrs.cvs |
|---|---|
| Message-ID | <[email protected]> |
Comments:
Update of /home/cvs/ITSMConfigurationManagement/Kernel/System/ITSMConfigItem
In directory lancelot:/tmp/cvs-serv31550/Kernel/System/ITSMConfigItem
Modified Files:
Tag: rel-3_1
Version.pm
Log Message:
Added new optional sysconfig option to check if config item names are unique.
Author: ub
Index: Version.pm
===================================================================
RCS file: /home/cvs/ITSMConfigurationManagement/Kernel/System/ITSMConfigItem/Version.pm,v
retrieving revision 1.33
retrieving revision 1.33.2.1
diff -2 -u -d -r1.33 -r1.33.2.1
--- Version.pm 31 Oct 2012 13:28:14 -0000 1.33
+++ Version.pm 30 Nov 2012 19:47:45 -0000 1.33.2.1
@@ -14,4 +14,5 @@
use strict;
use warnings;
+use Kernel::System::VariableCheck qw(:all);
use vars qw($VERSION);
@@ -480,4 +481,28 @@
return if ref $ConfigItemInfo ne 'HASH';
+ # check, whether the feature to check for a unique name is enabled
+ if ( $Self->{ConfigObject}->Get('UniqueCIName::EnableUniquenessCheck') ) {
+
+ my $NameDuplicates = $Self->UniqueNameCheck(
+ ConfigItemID => $Param{ConfigItemID},
+ ClassID => $ConfigItemInfo->{ClassID},
+ Name => $Param{Name},
+ );
+
+ # stop processing if the name is not unique
+ if ( IsArrayRefWithData($NameDuplicates) ) {
+
+ # build a string of all duplicate IDs
+ my $Duplicates = join ', ', @{$NameDuplicates};
+
+ # write an error log message containing all the duplicate IDs
+ $Self->{LogObject}->Log(
+ Priority => 'error',
+ Message => "The name $Param{Name} is already in use (ConfigItemIDs: $Duplicates)!",
+ );
+ return;
+ }
+ }
+
my $Events = $Self->_GetEvents(
Param => \%Param,
---------------------------------------------------------------------
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