From 71c4bf0d64526356b0b8e2643e26d9e19b0ecf7c Mon Sep 17 00:00:00 2001 From: "John W. Krahn" Date: Tue, 4 Feb 2003 23:49:19 +0000 Subject: [PATCH] simplify and optimise --- lib/WebGUI/Operation/International.pm | 35 ++++++++------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/lib/WebGUI/Operation/International.pm b/lib/WebGUI/Operation/International.pm index 69dac1d29..3b75a6d03 100644 --- a/lib/WebGUI/Operation/International.pm +++ b/lib/WebGUI/Operation/International.pm @@ -130,7 +130,6 @@ sub www_deleteLanguageConfirm { #------------------------------------------------------------------- sub www_editInternationalMessage { - my ( $output, $message, $f, $language ); return WebGUI::Privilege::adminOnly() unless WebGUI::Privilege::isInGroup( 3 ); my ( $language ) = WebGUI::SQL->quickArray( 'select language from language where languageId=' . $session{ form }{ lid } ); my $output = '

' . WebGUI::International::get( 597 ) . '

'; @@ -251,34 +250,20 @@ sub www_listInternationalMessages { $sth = WebGUI::SQL->read( 'select * from international where languageId=1' ); while ( %data = $sth->hash ) { my $key = $data{ namespace } . '-' . $data{ internationalId }; - if ( $session{ form }{ search } ne '' ) { - if ( $list{ 'z-' . $key } ) { - if ( $list{ 'z-' . $key }{ lastUpdated } < $data{ lastUpdated } ) { - $list{ 'o-' . $key } = delete $list{ 'z-' . $key }; - $list{ 'o-' . $key }{ status } = 'updated'; - } - else { - $list{ 'q-' . $key } = delete $list{ 'z-' . $key }; - $list{ 'q-' . $key }{ status } = 'ok'; - } - } - } - else { - unless ( $list{ 'z-' . $key } ) { - @{ $list{ 'a-' . $key } }{ qw[namespace id status] } - = ( @data{ qw[namespace internationalId] }, 'missing' ); + if ( $list{ 'z-' . $key } ) { + if ( $list{ 'z-' . $key }{ lastUpdated } < $data{ lastUpdated } ) { + $list{ 'o-' . $key } = delete $list{ 'z-' . $key }; + $list{ 'o-' . $key }{ status } = 'updated'; } else { - if ( $list{ 'z-' . $key }{ lastUpdated } < $data{ lastUpdated } ) { - $list{ 'o-' . $key } = delete $list{ 'z-' . $key }; - $list{ 'o-' . $key }{ status } = 'updated'; - } - else { - $list{ 'q-' . $key } = delete $list{ 'z-' . $key }; - $list{ 'q-' . $key }{ status } = 'ok'; - } + $list{ 'q-' . $key } = delete $list{ 'z-' . $key }; + $list{ 'q-' . $key }{ status } = 'ok'; } } + elsif ( $session{ form }{ search } eq '' ) { + @{ $list{ 'a-' . $key } }{ qw[namespace id status] } + = ( @data{ qw[namespace internationalId] }, 'missing' ); + } } $sth->finish;