summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/msgcat.cgi
blob: 7175fa2b3851a5f711bcaa9acbf825946777f1e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
%if ( $error ) {
%  $cgi->param('error',$error);
<% $cgi->redirect($p. "msgcat.cgi?". $cgi->query_string ) %>
%} else {
<% $cgi->redirect(popurl(3). "browse/msgcat.cgi") %>
%}
<%init>

die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');

my $error;
foreach my $param ( grep { /^\d+$/ } $cgi->param ) {
  my $old = qsearchs('msgcat', { msgnum=>$param } );
  next if $old->msg eq $cgi->param($param); #no need to update identical records
  my $new = new FS::msgcat { $old->hash };
  $new->msg($cgi->param($param));
  $error = $new->replace($old);
  last if $error;
}

</%init>