diff options
author | Ivan Kohler <ivan@freeside.biz> | 2014-12-05 14:24:01 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2014-12-05 14:24:01 -0800 |
commit | e68a2a20972de41485c438c46d197b5abeee3267 (patch) | |
tree | c1ec35d55fb428e9114bd63e70ac1d67ff267fd8 /FS/FS | |
parent | 289958e5f402e896e561e6911081b9cd36c4c098 (diff) |
disable agent types, RT#31446
Diffstat (limited to 'FS/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 91dfc5d97..492f8e2b7 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -556,12 +556,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; } |