summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/agent_type.cgi
diff options
context:
space:
mode:
authorivan <ivan>2006-08-23 22:25:39 +0000
committerivan <ivan>2006-08-23 22:25:39 +0000
commit3ce7691203a7737406bf2d4442f7fd84b81f847e (patch)
tree90658b097da96772224f04771888ac6ca1a940aa /httemplate/edit/process/agent_type.cgi
parent15e561850b61b10a92a46d8f3e316d53d4970087 (diff)
Will things ever be the same again?
It's the final masonize
Diffstat (limited to 'httemplate/edit/process/agent_type.cgi')
-rwxr-xr-xhttemplate/edit/process/agent_type.cgi71
1 files changed, 36 insertions, 35 deletions
diff --git a/httemplate/edit/process/agent_type.cgi b/httemplate/edit/process/agent_type.cgi
index fd8ca88..b8d0370 100755
--- a/httemplate/edit/process/agent_type.cgi
+++ b/httemplate/edit/process/agent_type.cgi
@@ -1,36 +1,37 @@
-<%
+%
+%
+%my $typenum = $cgi->param('typenum');
+%my $old = qsearchs('agent_type',{'typenum'=>$typenum}) if $typenum;
+%
+%my $new = new FS::agent_type ( {
+% map {
+% $_, scalar($cgi->param($_));
+% } fields('agent_type')
+%} );
+%
+%my $error;
+%if ( $typenum ) {
+% $error = $new->replace($old);
+%} else {
+% $error = $new->insert;
+% $typenum = $new->getfield('typenum');
+%}
+%#$error ||= $new->process_m2m( );
+%
+%if ( $error ) {
+% $cgi->param('error', $error);
+% print $cgi->redirect(popurl(2). "agent_type.cgi?". $cgi->query_string );
+%} else {
+%
+% my $error = $new->process_m2m(
+% 'link_table' => 'type_pkgs',
+% 'target_table' => 'part_pkg',
+% 'params' => scalar($cgi->Vars)
+% );
+% die $error if $error;
+%
+% print $cgi->redirect(popurl(3). "browse/agent_type.cgi");
+%}
+%
+%
-my $typenum = $cgi->param('typenum');
-my $old = qsearchs('agent_type',{'typenum'=>$typenum}) if $typenum;
-
-my $new = new FS::agent_type ( {
- map {
- $_, scalar($cgi->param($_));
- } fields('agent_type')
-} );
-
-my $error;
-if ( $typenum ) {
- $error = $new->replace($old);
-} else {
- $error = $new->insert;
- $typenum = $new->getfield('typenum');
-}
-#$error ||= $new->process_m2m( );
-
-if ( $error ) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(2). "agent_type.cgi?". $cgi->query_string );
-} else {
-
- my $error = $new->process_m2m(
- 'link_table' => 'type_pkgs',
- 'target_table' => 'part_pkg',
- 'params' => scalar($cgi->Vars)
- );
- die $error if $error;
-
- print $cgi->redirect(popurl(3). "browse/agent_type.cgi");
-}
-
-%>