From 5ac9e46a92f4eefd795f97643f3e8f62ec1a2b26 Mon Sep 17 00:00:00 2001 From: mark Date: Sun, 7 Nov 2010 07:07:06 +0000 Subject: [PATCH] export names, RT#9827 --- FS/FS/Schema.pm | 1 + FS/FS/part_export.pm | 3 +++ httemplate/browse/part_export.cgi | 6 +++++- httemplate/browse/part_svc.cgi | 11 ++++++++++- httemplate/edit/part_export.cgi | 8 +++++++- httemplate/edit/part_svc.cgi | 8 ++++++-- 6 files changed, 32 insertions(+), 5 deletions(-) diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 6ed7756a5..4c85da1cf 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -2024,6 +2024,7 @@ sub tables_hashref { 'part_export' => { 'columns' => [ 'exportnum', 'serial', '', '', '', '', + 'exportname', 'varchar', 'NULL', $char_d, '', '', 'machine', 'varchar', '', $char_d, '', '', 'exporttype', 'varchar', '', $char_d, '', '', 'nodomain', 'char', 'NULL', 1, '', '', diff --git a/FS/FS/part_export.pm b/FS/FS/part_export.pm index 588606dc1..6f5aedc35 100644 --- a/FS/FS/part_export.pm +++ b/FS/FS/part_export.pm @@ -50,6 +50,8 @@ fields are currently supported: =item exportnum - primary key +=item exportname - Descriptive name + =item machine - Machine name =item exporttype - Export type @@ -159,6 +161,7 @@ sub check { my $self = shift; my $error = $self->ut_numbern('exportnum') + || $self->ut_textn('exportname') || $self->ut_domain('machine') || $self->ut_alpha('exporttype') ; diff --git a/httemplate/browse/part_export.cgi b/httemplate/browse/part_export.cgi index 1cd201360..8e28f4fc6 100755 --- a/httemplate/browse/part_export.cgi +++ b/httemplate/browse/part_export.cgi @@ -35,7 +35,11 @@ function part_export_areyousure(href) { <% $part_export->exportnum %> - <% $part_export->exporttype %> to <% $part_export->machine %> (edit | delete) + +% if( $part_export->exportname ) { + <% $part_export->exportname %>:
+% } +<% $part_export->exporttype %> to <% $part_export->machine %> (edit | delete) <% itable() %> diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi index 94afdef15..82b1150cc 100755 --- a/httemplate/browse/part_svc.cgi +++ b/httemplate/browse/part_svc.cgi @@ -129,7 +129,16 @@ function part_export_areyousure(href) { % - <% $part_export->exportnum %>: <% $part_export->exporttype %> to <% $part_export->machine %> + +<% $part_export->exportnum %>:  +% if ($part_export->exportname) { +<% $part_export->exportname %> ( +% } +<% $part_export->exporttype %> to <% $part_export->machine %> +% if ($part_export->exportname) { +) +% } + % } diff --git a/httemplate/edit/part_export.cgi b/httemplate/edit/part_export.cgi index a2fad56a3..32ed1fc94 100644 --- a/httemplate/edit/part_export.cgi +++ b/httemplate/edit/part_export.cgi @@ -7,6 +7,12 @@ <% ntable("#cccccc",2) %> + Export name + + + + + Export host @@ -53,7 +59,7 @@ my $widget = new HTML::Widgets::SelectLayers( 'options' => \%layers, 'form_name' => 'dummy', 'form_action' => 'process/part_export.cgi', - 'form_text' => [qw( exportnum machine )], + 'form_text' => [qw( exportnum exportname machine )], # 'form_checkbox' => [qw()], 'html_between' => "\n", 'layer_callback' => sub { diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index e14acb5a9..fcffc4f56 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -114,8 +114,12 @@ that field. % && qsearchs( 'export_svc', { % exportnum => $part_export->exportnum, % svcpart => $clone || $part_svc->svcpart }); -% $html .= '>'. $part_export->exportnum. ': '. $part_export->exporttype. -% ' to '. $part_export->machine. ''; +% $html .= '>'.$part_export->exportnum. ': '; +% $html .= $part_export->exportname . '
' +% if ( $part_export->exportname ); +% $html .= $part_export->exporttype. ' to '. $part_export->machine; +% $html .= '
' if ( $part_export->exportname ); +% $html .= ''; % $count++; % $html .= '' unless $count % $columns; % } -- 2.11.0