From c3534b1e4fca5e6de22090dbf38f8ab6d87b3e50 Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Fri, 28 Aug 2015 14:33:40 -0600 Subject: [PATCH 1/2] Add in a part_svc.comment, with ability to edit/view --- FS/FS/Schema.pm | 1 + FS/FS/part_svc.pm | 3 +++ httemplate/edit/part_svc.cgi | 7 ++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index a799ceebee..457f30870d 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -3580,6 +3580,7 @@ sub tables_hashref { 'columns' => [ 'svcpart', 'serial', '', '', '', '', 'svc', 'varchar', '', $char_d, '', '', + 'comment', 'varchar', 'NULL', $char_d, '', '', 'svcdb', 'varchar', '', $char_d, '', '', 'disabled', 'char', 'NULL', 1, '', '', 'preserve', 'char', 'NULL', 1, '', '', diff --git a/FS/FS/part_svc.pm b/FS/FS/part_svc.pm index 518e847a2b..ab97fe83e7 100644 --- a/FS/FS/part_svc.pm +++ b/FS/FS/part_svc.pm @@ -48,6 +48,8 @@ FS::Record. The following fields are currently supported: =item svc - text name of this service definition +=item comment - text comment of this service definition + =item svcdb - table used for this service. See L, L, and L, among others. @@ -414,6 +416,7 @@ sub check { $error= $self->ut_numbern('svcpart') || $self->ut_text('svc') + || $self->ut_text('comment') || $self->ut_alpha('svcdb') || $self->ut_flag('disabled') || $self->ut_flag('preserve') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index a07fc60054..d1e060bfdc 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -150,6 +150,11 @@ window.onload = function() { + + Service Comment + + + <& /elements/tr-select-part_svc_class.html, curr_value=>$hashref->{classnum} &> @@ -244,7 +249,7 @@ my $widget = new HTML::Widgets::SelectLayers( #'form_action' => 'process/part_svc.cgi', 'form_action' => 'part_svc.cgi', #self 'form_elements' => [qw( svc svcpart classnum selfservice_access - disabled preserve + disabled preserve comment )], 'html_between' => $help, 'layer_callback' => sub { From aa04c998f263168bfedafe7a3ebc804505f90660 Mon Sep 17 00:00:00 2001 From: "Jason (Jayce^) Hall" Date: Mon, 31 Aug 2015 15:08:25 -0600 Subject: [PATCH 2/2] Fix nullable error Fix bug where interface wouldn't post the comment field across the various svc_column elements --- FS/FS/part_svc.pm | 2 +- httemplate/edit/elements/part_svc_column.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FS/FS/part_svc.pm b/FS/FS/part_svc.pm index ab97fe83e7..c93f527356 100644 --- a/FS/FS/part_svc.pm +++ b/FS/FS/part_svc.pm @@ -416,7 +416,7 @@ sub check { $error= $self->ut_numbern('svcpart') || $self->ut_text('svc') - || $self->ut_text('comment') + || $self->ut_textn('comment') || $self->ut_alpha('svcdb') || $self->ut_flag('disabled') || $self->ut_flag('preserve') diff --git a/httemplate/edit/elements/part_svc_column.html b/httemplate/edit/elements/part_svc_column.html index bc679e5779..2040a23f1c 100644 --- a/httemplate/edit/elements/part_svc_column.html +++ b/httemplate/edit/elements/part_svc_column.html @@ -264,7 +264,7 @@ <& /elements/progress-init.html, $svcdb, #form name [ # form fields to send - qw(svc svcpart classnum selfservice_access disabled preserve exportnum), + qw(svc svcpart classnum selfservice_access disabled preserve exportnum comment), @fields ], 'process/part_svc.cgi', # target