diff options
author | ivan <ivan> | 2006-08-10 11:55:50 +0000 |
---|---|---|
committer | ivan <ivan> | 2006-08-10 11:55:50 +0000 |
commit | 264ad081e68057c7bc30a8b2ad741b783e1342ff (patch) | |
tree | ee1376c0552c6a40f3c3d6cf05a4a25e6b16fcf8 /httemplate/edit | |
parent | 6495ab5fb29dcdb8233f004b5d60d3d97db058b9 (diff) |
agent-virtualize advertising sources
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-x | httemplate/edit/part_referral.cgi | 44 | ||||
-rwxr-xr-x | httemplate/edit/part_referral.html | 9 | ||||
-rwxr-xr-x | httemplate/edit/process/part_referral.cgi | 28 | ||||
-rwxr-xr-x | httemplate/edit/process/part_referral.html | 5 |
4 files changed, 14 insertions, 72 deletions
diff --git a/httemplate/edit/part_referral.cgi b/httemplate/edit/part_referral.cgi deleted file mode 100755 index dce1e6394..000000000 --- a/httemplate/edit/part_referral.cgi +++ /dev/null @@ -1,44 +0,0 @@ -<% - -my $part_referral; -if ( $cgi->param('error') ) { - $part_referral = new FS::part_referral ( { - map { $_, scalar($cgi->param($_)) } fields('part_referral') - } ); -} elsif ( $cgi->keywords ) { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $part_referral = qsearchs( 'part_referral', { 'refnum' => $1 } ); -} else { #adding - $part_referral = new FS::part_referral {}; -} -my $action = $part_referral->refnum ? 'Edit' : 'Add'; -my $hashref = $part_referral->hashref; - -my $p1 = popurl(1); - -%><%= include('/elements/header.html', "$action Advertising source", menubar( - 'Main Menu' => popurl(2), - 'View all advertising sources' => popurl(2). "browse/part_referral.cgi", -)) %> - -<% if ( $cgi->param('error') ) { %> - <FONT SIZE="+1" COLOR="#ff0000">Error: <%= $cgi->param('error') %></FONT> -<% } %> - -<FORM ACTION="<%= $p1 %>process/part_referral.cgi" METHOD=POST> - -<INPUT TYPE="hidden" NAME="refnum" VALUE="<%= $hashref->{refnum} %>"> - -<% -#print "Referral #", $hashref->{refnum} ? $hashref->{refnum} : "(NEW)"; -%> - -Advertising source <INPUT TYPE="text" NAME="referral" SIZE=32 VALUE="<%= $hashref->{referral} %>"> - -<BR> -<INPUT TYPE="submit" VALUE="<%= $hashref->{refnum} ? "Apply changes" : "Add advertising source" %>"> - -</FORM> - -<%= include('/elements/footer.html') %> diff --git a/httemplate/edit/part_referral.html b/httemplate/edit/part_referral.html new file mode 100755 index 000000000..ec0f32f58 --- /dev/null +++ b/httemplate/edit/part_referral.html @@ -0,0 +1,9 @@ +<%= include( 'elements/edit.html', + 'name' => 'Advertising source', + 'table' => 'part_referral', + 'fields' => [ 'referral' ], + 'labels' => { 'referral' => 'Advertising source' }, + 'viewall_dir' => 'browse', + 'html_table_bottom' => include('/elements/tr-select-agent.html'), + ) +%> diff --git a/httemplate/edit/process/part_referral.cgi b/httemplate/edit/process/part_referral.cgi deleted file mode 100755 index fd2c01506..000000000 --- a/httemplate/edit/process/part_referral.cgi +++ /dev/null @@ -1,28 +0,0 @@ -<% - -my $refnum = $cgi->param('refnum'); - -my $new = new FS::part_referral ( { - map { - $_, scalar($cgi->param($_)); - } fields('part_referral') -} ); - -my $error; -if ( $refnum ) { - my $old = qsearchs( 'part_referral', { 'refnum' =>$ refnum } ); - die "(Old) Record not found!" unless $old; - $error = $new->replace($old); -} else { - $error = $new->insert; -} -$refnum=$new->refnum; - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "part_referral.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "browse/part_referral.cgi"); -} - -%> diff --git a/httemplate/edit/process/part_referral.html b/httemplate/edit/process/part_referral.html new file mode 100755 index 000000000..0b5d959a0 --- /dev/null +++ b/httemplate/edit/process/part_referral.html @@ -0,0 +1,5 @@ +<%= include( 'elements/process.html', + 'table' => 'part_referral', + 'viewall_dir' => 'browse', + ) +%> |