[otrs-cvs] module-tools Config2Docbook.pl,1.3,1.4

"CVS commits notifications of OTRS.org" <[email protected]>
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
Comments:
Update of /home/cvs/module-tools
In directory lancelot:/tmp/cvs-serv15332

Modified Files:
	Config2Docbook.pl 
Log Message:
Added fix for OTRS 2.4 style config files.

Author: cr

Index: Config2Docbook.pl
===================================================================
RCS file: /home/cvs/module-tools/Config2Docbook.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -2 -u -d -r1.3 -r1.4
--- Config2Docbook.pl	20 Nov 2012 19:16:48 -0000	1.3
+++ Config2Docbook.pl	22 Nov 2012 23:20:41 -0000	1.4
@@ -265,9 +265,25 @@
             for my $Setting ( @{ $Param{ConfigSettings}->{$SettingFile}->{ConfigItem} } ) {
 
+                # TODO: Lang shoud be a parameter
+                my $DescriptionContent;
+
+                if ( ref $Setting->{Description} eq 'ARRAY' ) {
+                    DESCRIPTION:
+                    for my $Description ( @{ $Setting->{Description} } ) {
+                        next DESCRIPTION if $Description->{Lang} ne 'en';
+
+                        $DescriptionContent = $Description->{content};
+                        last DESCRIPTION;
+                    }
+                }
+                else {
+                    $DescriptionContent = $Setting->{Description}->{content};
+                }
+
                 push @ConvertedSettings, {
                     title => $Setting->{Name} . ".",
                     para  => [
                         "Group: $Setting->{Group}, Subgroup: $Setting->{SubGroup}.",
-                        $Setting->{Description}->{content},
+                        $DescriptionContent,
                     ],
                 };
@@ -280,9 +296,25 @@
             my $Setting = $Param{ConfigSettings}->{$SettingFile}->{ConfigItem};
 
+            # TODO: Lang shoud be a parameter
+            my $DescriptionContent;
+
+            if ( ref $Setting->{Description} eq 'ARRAY' ) {
+                DESCRIPTION:
+                for my $Description ( @{ $Setting->{Description} } ) {
+                    next DESCRIPTION if $Description->{Lang} ne 'en';
+
+                    $DescriptionContent = $Description->{content};
+                    last DESCRIPTION;
+                }
+            }
+            else {
+                $DescriptionContent = $Setting->{Description}->{content};
+            }
+
             push @ConvertedSettings, {
                 title => $Setting->{Name} . ".",
                 para  => [
                     "Group: $Setting->{Group}, Subgroup: $Setting->{SubGroup}.",
-                    $Setting->{Description}->{content},
+                    $DescriptionContent,
                 ],
             };
---------------------------------------------------------------------
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.