default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / httemplate / edit / process / msgcat.cgi
1 %if ( $error ) {
2 %  $cgi->param('error',$error);
3 <% $cgi->redirect($p. "msgcat.cgi?". $cgi->query_string ) %>
4 %} else {
5 <% $cgi->redirect(popurl(3). "browse/msgcat.cgi") %>
6 %}
7 <%init>
8
9 die "access denied"
10   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
11
12 my $error;
13 foreach my $param ( grep { /^\d+$/ } $cgi->param ) {
14   my $old = qsearchs('msgcat', { msgnum=>$param } );
15   next if $old->msg eq $cgi->param($param); #no need to update identical records
16   die "editing en_US locale is currently disabled" if $old->locale eq 'en_US';
17   my $new = new FS::msgcat { $old->hash };
18   $new->msg($cgi->param($param));
19   $error = $new->replace($old);
20   last if $error;
21 }
22
23 </%init>