diff options
author | Ivan Kohler <ivan@freeside.biz> | 2014-12-05 14:24:01 -0800 |
---|---|---|
committer | Jeremy Davis <jeremyd@freeside.biz> | 2014-12-09 13:51:16 -0500 |
commit | 6199f898a744f2cc2f9f03450d49286866a3f4d0 (patch) | |
tree | c5956aba2e89a768f0f7bd0031518c982628d070 /FS | |
parent | fa868107440f645205e7943fd370fb48e677f091 (diff) |
disable agent types, RT#31446
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Schema.pm | 7 | ||||
-rw-r--r-- | FS/FS/agent_type.pm | 17 |
2 files changed, 17 insertions, 7 deletions
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 3ff475f43..cdfc07e3a 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -497,12 +497,13 @@ sub tables_hashref { 'agent_type' => { 'columns' => [ - 'typenum', 'serial', '', '', '', '', - 'atype', 'varchar', '', $char_d, '', '', + 'typenum', 'serial', '', '', '', '', + 'atype', 'varchar', '', $char_d, '', '', + 'disabled', 'char', 'NULL', 1, '', '', ], 'primary_key' => 'typenum', 'unique' => [], - 'index' => [], + 'index' => [ ['disabled'] ], }, 'type_pkgs' => { diff --git a/FS/FS/agent_type.pm b/FS/FS/agent_type.pm index 5d6b94e0c..e0f749500 100644 --- a/FS/FS/agent_type.pm +++ b/FS/FS/agent_type.pm @@ -45,9 +45,17 @@ FS::Record. The following fields are currently supported: =over 4 -=item typenum - primary key (assigned automatically for new agent types) +=item typenum -=item atype - Text name of this agent type +primary key (assigned automatically for new agent types) + +=item atype + +Text name of this agent type + +=item disabled + +Disabled flag, empty or 'Y' =back @@ -103,8 +111,9 @@ sub check { my $self = shift; $self->ut_numbern('typenum') - or $self->ut_text('atype') - or $self->SUPER::check; + || $self->ut_text('atype') + || $self->ut_enum('disabled', [ '', 'Y' ] ) + || $self->SUPER::check; } |