working message catalogs (not used for enough yet)
[freeside.git] / httemplate / edit / process / msgcat.cgi
diff --git a/httemplate/edit/process/msgcat.cgi b/httemplate/edit/process/msgcat.cgi
new file mode 100644 (file)
index 0000000..ab30f06
--- /dev/null
@@ -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");
+}
+
+%>