diff options
Diffstat (limited to 'httemplate')
| -rwxr-xr-x | httemplate/browse/msgcat.cgi | 4 | ||||
| -rw-r--r-- | httemplate/docs/install.html | 5 | ||||
| -rwxr-xr-x | httemplate/edit/msgcat.cgi | 57 | ||||
| -rw-r--r-- | httemplate/edit/process/msgcat.cgi | 19 | 
4 files changed, 83 insertions, 2 deletions
| diff --git a/httemplate/browse/msgcat.cgi b/httemplate/browse/msgcat.cgi index 5dab5cfc9..774473b36 100755 --- a/httemplate/browse/msgcat.cgi +++ b/httemplate/browse/msgcat.cgi @@ -18,8 +18,8 @@ my $widget = new HTML::Widgets::SelectLayers(      $html .= '</TR>';      #foreach my $msgcat ( sort { $a->msgcode cmp $b->msgcode } -    #                       qsearchs('msgcat', { 'locale' => $layer } ) ) { -    foreach my $msgcat ( qsearchs('msgcat', { 'locale' => $layer } ) ) { +    #                       qsearch('msgcat', { 'locale' => $layer } ) ) { +    foreach my $msgcat ( qsearch('msgcat', { 'locale' => $layer } ) ) {        $html .= '<TR><TD>'. $msgcat->msgnum. '</TD>'.                 '<TD>'. $msgcat->msgcode. '</TD>'.                 '<TD>'. $msgcat->msg. '</TD>'; diff --git a/httemplate/docs/install.html b/httemplate/docs/install.html index 2ad75b15e..4870c7db7 100644 --- a/httemplate/docs/install.html +++ b/httemplate/docs/install.html @@ -181,6 +181,11 @@ $ <a href="man/bin/freeside-adduser.html">freeside-adduser</a> -h /usr/local/etc  $ su freeside  $ bin/fs-setup <b>username</b>  </pre> +  <li>As the freeside UNIX user, run <tt>bin/populate-msgcat <b>username</b></tt> to populate the message catalog, passing the username of a Freeside user you created above: +<pre> +$ su freeside +$ bin/populate-msgcat <b>username</b> +</pre>    <li><tt>freeside-queued</tt> was installed with the Perl modules.  Start it now and ensure that is run upon system startup.    <li>Now proceed to the initial <a href="admin.html">administration</a> of your installation.  </ul> diff --git a/httemplate/edit/msgcat.cgi b/httemplate/edit/msgcat.cgi new file mode 100755 index 000000000..5d256c05b --- /dev/null +++ b/httemplate/edit/msgcat.cgi @@ -0,0 +1,57 @@ +<!-- mason kludge --> +<% + +print header("Message catalog", menubar( +#  'Main Menu' => $p, +)), '<BR>'; + +print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !. $cgi->param('error') +  if $cgi->param('error'); + +my $widget = new HTML::Widgets::SelectLayers( +  'selected_layer' => 'en_US', +  'options'        => { 'en_US'=>'en_US' }, +  'form_action'    => 'process/msgcat.cgi', +  'layer_callback' => sub { +    my $layer = shift; +    my $html = qq!<INPUT TYPE="hidden" NAME="locale" VALUE="$layer">!. +               "<BR>Messages for locale $layer<BR>". table(). +               "<TR><TH COLSPAN=2>Code</TH>". +               "<TH>Message</TH>"; +    $html .= "<TH>en_US Message</TH>" unless $layer eq 'en_US'; +    $html .= '</TR>'; + +    #foreach my $msgcat ( sort { $a->msgcode cmp $b->msgcode } +    #                       qsearch('msgcat', { 'locale' => $layer } ) ) { +    foreach my $msgcat ( qsearch('msgcat', { 'locale' => $layer } ) ) { +      $html .= +        '<TR><TD>'. $msgcat->msgnum. '</TD><TD>'. $msgcat->msgcode. '</TD>'. +        '<TD><INPUT TYPE="text" SIZE=32 '. +        qq! NAME="!. $msgcat->msgnum. '" '. +        qq!VALUE="!. $msgcat->msg. qq!"></TD>!; +      unless ( $layer eq 'en_US' ) { +        my $en_msgcat = qsearchs('msgcat', { +          'locale'  => 'en_US', +          'msgcode' => $msgcat->msgcode, +        } ); +        $html .= '<TD>'. $en_msgcat->msg. '</TD>'; +      } +      $html .= '</TR>'; +    } + +    $html .= '</TABLE><BR><INPUT TYPE="submit" VALUE="Apply changes">'; + +    $html; +  }, + +); + +print $widget->html; + +print <<END; +    </TABLE> +  </BODY> +</HTML> +END + +%> diff --git a/httemplate/edit/process/msgcat.cgi b/httemplate/edit/process/msgcat.cgi new file mode 100644 index 000000000..ab30f06b5 --- /dev/null +++ b/httemplate/edit/process/msgcat.cgi @@ -0,0 +1,19 @@ +<% + +my $error; +foreach my $param ( grep { /^\d+$/ } $cgi->param ) { +  my $old = qsearchs('msgcat', { msgnum=>$param } ); +  my $new = new FS::msgcat { $old->hash }; +  $new->msg($cgi->param($param)); +  $error = $new->replace($old); +  last if $error; +} + +if ( $error ) { +  $cgi->param('error',$error); +  print $cgi->redirect($p. "msgcat.cgi?". $cgi->query_string ); +} else { +  print $cgi->redirect(popurl(3). "browse/msgcat.cgi"); +} + +%> | 
