[freeside-commits] freeside/httemplate/edit/elements svc_Common.html, 1.8.2.1, 1.8.2.2
Ivan,,,
ivan at wavetail.420.am
Fri Feb 12 18:53:51 PST 2010
Update of /home/cvs/cvsroot/freeside/httemplate/edit/elements
In directory wavetail.420.am:/tmp/cvs-serv29840/httemplate/edit/elements
Modified Files:
Tag: FREESIDE_1_9_BRANCH
svc_Common.html
Log Message:
svc_external.title from inventory, RT#7010
Index: svc_Common.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/elements/svc_Common.html,v
retrieving revision 1.8.2.1
retrieving revision 1.8.2.2
diff -u -d -r1.8.2.1 -r1.8.2.2
--- svc_Common.html 25 Jan 2010 22:17:29 -0000 1.8.2.1
+++ svc_Common.html 13 Feb 2010 02:53:49 -0000 1.8.2.2
@@ -62,6 +62,8 @@
? 'fixed'
: 'hidden';
$f->{'value'} = $columndef->columnvalue;
+ } elsif ( $flag eq 'A' ) {
+ $f->{'type'} = 'hidden';
}
if ( $f->{'type'} eq 'select-svc_pbx' ) {
@@ -121,10 +123,29 @@
sub label_fixup {
my( $part_svc, $opt ) = @_;
+ my $svcdb = $part_svc->svcdb;
+ require "FS/$svcdb.pm";
+
+ if ( UNIVERSAL::can("FS::$svcdb", 'table_info') ) {
+ $opt->{'name'} ||= "FS::$svcdb"->table_info->{'name'};
+
+ my $fields = "FS::$svcdb"->table_info->{'fields'};
+ $opt->{'fields'} ||= [ grep { $_ ne 'svcnum' } keys %$fields ];
+
+ $opt->{labels} ||= {
+ map { $_ => ( ref($fields->{$_})
+ ? $fields->{$_}{'label'}
+ : $fields->{$_}
+ );
+ }
+ keys %$fields
+ };
+ }
+
#false laziness w/view/svc_Common.html
#override default labels with service-definition labels if applicable
my $labels = $opt->{labels}; # with -> here
- foreach my $field ( keys %$labels ) {
+ foreach my $field ( keys %{ $opt->{labels} } ) {
my $col = $part_svc->part_svc_column($field);
$labels->{$field} = $col->columnlabel if $col->columnlabel !~ /^\S*$/;
}
More information about the freeside-commits
mailing list