[otrs-cvs] ITSMConfigurationManagement/Kernel/Output/HTML ITSMConfigItemLayoutGeneralCatalog.pm, 1.9, 1.10

"CVS commits notifications of OTRS.org" <[email protected]>
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
Comments:
Update of /home/cvs/ITSMConfigurationManagement/Kernel/Output/HTML
In directory lancelot:/tmp/cvs-serv22195/Kernel/Output/HTML

Modified Files:
	ITSMConfigItemLayoutGeneralCatalog.pm 
Log Message:
Fixed bug# 7974 - ValueDefault doesn't work for GeneralCatalog.

Author: ub

Index: ITSMConfigItemLayoutGeneralCatalog.pm
===================================================================
RCS file: /home/cvs/ITSMConfigurationManagement/Kernel/Output/HTML/ITSMConfigItemLayoutGeneralCatalog.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -2 -u -d -r1.9 -r1.10
--- ITSMConfigItemLayoutGeneralCatalog.pm	12 Jan 2011 11:21:14 -0000	1.9
+++ ITSMConfigItemLayoutGeneralCatalog.pm	20 Dec 2012 16:35:15 -0000	1.10
@@ -1,5 +1,5 @@
 # --
 # Kernel/Output/HTML/ITSMConfigItemLayoutGeneralCatalog.pm - layout backend module
-# Copyright (C) 2001-2011 OTRS AG, http://otrs.org/
+# Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
 # --
 # $Id$
@@ -159,6 +159,4 @@
     }
 
-    my $SelectedID = $Param{Value} || $Param{Item}->{Input}->{ValueDefault} || '';
-
     my $CSSClass = '';
     my $Required = $Param{Required};
@@ -185,4 +183,19 @@
     );
 
+    # reverse the class list
+    my %ReverseClassList = reverse %{$ClassList};
+
+    my $SelectedID;
+
+    # get the current value
+    if ( defined $Param{Value} ) {
+        $SelectedID = $Param{Value};
+    }
+
+    # get the default id by default value
+    else {
+        $SelectedID = $ReverseClassList{ $Param{Item}->{Input}->{ValueDefault} || '' } || '';
+    }
+
     # generate string
     my $String = $Self->{LayoutObject}->BuildSelection(
---------------------------------------------------------------------
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.