diff --git a/lib/WebGUI/Operation/Help.pm b/lib/WebGUI/Operation/Help.pm index 851b04f49..67674b66f 100644 --- a/lib/WebGUI/Operation/Help.pm +++ b/lib/WebGUI/Operation/Help.pm @@ -26,11 +26,21 @@ sub www_viewHelp { my ($output, %help, @data, $sth, %seeAlso, $namespace); $namespace = $session{form}{namespace} || "WebGUI"; tie %help, 'Tie::CPHash'; - %help = WebGUI::SQL->quickHash("select * from help where helpId=$session{form}{hid} and namespace='$namespace' and language='$session{user}{language}'"); + %help = WebGUI::SQL->quickHash("select * from help where helpId=$session{form}{hid} and namespace='$namespace' and + language='$session{user}{language}'"); + if ($help{action} eq "") { + %help = WebGUI::SQL->quickHash("select * from help where helpId=$session{form}{hid} and namespace='$namespace' and language='English'"); + } $output = '

'.WebGUI::International::get(93).': '.$help{action}.' '.$help{object}.'

'; $output .= $help{body}; $output .= '

'.WebGUI::International::get(94).':'; - $sth = WebGUI::SQL->read("select helpId, action, object, namespace from help where object='$help{object}' and action<>'$help{action}' and language='$session{user}{language}' order by action"); + $sth = WebGUI::SQL->read("select helpId, action, object, namespace from help where object='$help{object}' + and action<>'$help{action}' and language='$session{user}{language}' order by action"); + unless ($sth->rows) { + $sth->finish; + $sth = WebGUI::SQL->read("select helpId, action, object, namespace from help where object='$help{object}' + and action<>'$help{action}' and language='English' order by action"); + } while (@data = $sth->array) { $output .= ' '.$data[1].' '.$data[2].','; @@ -38,7 +48,12 @@ sub www_viewHelp { $sth->finish; $sth = WebGUI::SQL->read("select helpId, namespace from helpSeeAlso where seeAlsoId in ($help{seeAlso})"); while (@data = $sth->array) { - %seeAlso = WebGUI::SQL->quickHash("select helpId,namespace,action,object from help where helpId='$data[0]' and namespace='$data[1]' and language='$session{user}{language}'"); + %seeAlso = WebGUI::SQL->quickHash("select helpId,namespace,action,object from help where helpId='$data[0]' + and namespace='$data[1]' and language='$session{user}{language}'"); + if ($seeAlso{helpId} eq "") { + %seeAlso = WebGUI::SQL->quickHash("select helpId,namespace,action,object from help where helpId='$data[0]' + and namespace='$data[1]' and language='English'"); + } $output .= ' '.$seeAlso{action}.' '.$seeAlso{object}.','; @@ -54,6 +69,10 @@ sub www_viewHelpIndex { $output = '

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

'; $output .= '
'.WebGUI::International::get(96).'

'; $sth = WebGUI::SQL->read("select helpId, action, object, namespace from help where language='$session{user}{language}' order by action,object"); + unless ($sth->rows) { + $sth->finish; + $sth = WebGUI::SQL->read("select helpId, action, object, namespace from help where language='English' order by action,object"); + } while (@data = $sth->array) { if ($data[1] ne $previous) { $output .= '

'.$data[1].'
'; @@ -65,6 +84,10 @@ sub www_viewHelpIndex { $sth->finish; $output .= '

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

'; $sth = WebGUI::SQL->read("select helpId, object, action, namespace from help where language='$session{user}{language}' order by object,action"); + unless ($sth->rows) { + $sth->finish; + $sth = WebGUI::SQL->read("select helpId, object, action, namespace from help where language='English' order by object,action"); + } while (@data = $sth->array) { if ($data[1] ne $previous) { $output .= '

'.$data[1].'
';