summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2016-04-13 13:18:41 -0700
committerMark Wells <mark@freeside.biz>2016-10-06 12:35:30 -0700
commit0e3e0640d1ca5dfb2b0571e4b820b71a5606a1df (patch)
tree85602a58774b63d44552582cbdca18b2e60d15ab
parent893eb33723f9e113e9fd0a15d23ba0f295c2585c (diff)
add part_referral external ID for API signups, #39776
-rw-r--r--FS/FS/Schema.pm5
-rw-r--r--FS/FS/part_referral.pm4
-rwxr-xr-xhttemplate/edit/part_referral.html2
3 files changed, 9 insertions, 2 deletions
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index a98d984..0c31340 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -3614,10 +3614,11 @@ sub tables_hashref {
'refnum', 'serial', '', '', '', '',
'referral', 'varchar', '', $char_d, '', '',
'disabled', 'char', 'NULL', 1, '', '',
- 'agentnum', 'int', 'NULL', '', '', '',
+ 'agentnum', 'int', 'NULL', '', '', '',
+ 'title', 'varchar', 'NULL', $char_d, '', '',
],
'primary_key' => 'refnum',
- 'unique' => [],
+ 'unique' => [ ['agentnum', 'title'] ],
'index' => [ ['disabled'], ['agentnum'], ],
'foreign_keys' => [
{ columns => [ 'agentnum' ],
diff --git a/FS/FS/part_referral.pm b/FS/FS/part_referral.pm
index e4a5823..2df8a75 100644
--- a/FS/FS/part_referral.pm
+++ b/FS/FS/part_referral.pm
@@ -44,6 +44,9 @@ The following fields are currently supported:
=item agentnum - Optional agentnum (see L<FS::agent>)
+=item title - an optional external string that identifies this
+referral source, such as an advertising campaign code.
+
=back
=head1 NOTE
@@ -101,6 +104,7 @@ sub check {
|| $self->ut_text('referral')
|| $self->ut_enum('disabled', [ '', 'Y' ] )
#|| $self->ut_foreign_keyn('agentnum', 'agent', 'agentnum')
+ || $self->ut_textn('title')
|| ( $setup_hack
? $self->ut_foreign_keyn('agentnum', 'agent', 'agentnum' )
: $self->ut_agentnum_acl('agentnum', 'Edit global advertising sources')
diff --git a/httemplate/edit/part_referral.html b/httemplate/edit/part_referral.html
index e9fd794..04287d6 100755
--- a/httemplate/edit/part_referral.html
+++ b/httemplate/edit/part_referral.html
@@ -3,11 +3,13 @@
'table' => 'part_referral',
'fields' => [ 'referral',
{ field=>'agentnum', type=>'select-agent', },
+ 'title',
{ field=>'disabled', type=>'checkbox', value=>'Y' } ,
],
'labels' => { 'refnum' => 'Ad Source',
'referral' => 'Advertising source',
'agentnum' => 'Agent',
+ 'title' => 'External ID',
'disabled' => 'Disabled',
},
'viewall_dir' => 'browse',