Will things ever be the same again?
[freeside.git] / httemplate / edit / process / msgcat.cgi
1 %
2 %
3 %my $error;
4 %foreach my $param ( grep { /^\d+$/ } $cgi->param ) {
5 %  my $old = qsearchs('msgcat', { msgnum=>$param } );
6 %  next if $old->msg eq $cgi->param($param); #no need to update identical records
7 %  my $new = new FS::msgcat { $old->hash };
8 %  $new->msg($cgi->param($param));
9 %  $error = $new->replace($old);
10 %  last if $error;
11 %}
12 %
13 %if ( $error ) {
14 %  $cgi->param('error',$error);
15 %  print $cgi->redirect($p. "msgcat.cgi?". $cgi->query_string );
16 %} else {
17 %  print $cgi->redirect(popurl(3). "browse/msgcat.cgi");
18 %}
19 %
20 %
21