[freeside-commits] freeside/httemplate/edit/elements svc_Common.html, 1.8.2.5, 1.8.2.6 edit.html, 1.39.2.3, 1.39.2.4

Ivan,,, ivan at wavetail.420.am
Thu Mar 11 19:36:49 PST 2010


Update of /home/cvs/cvsroot/freeside/httemplate/edit/elements
In directory wavetail.420.am:/tmp/cvs-serv12512/httemplate/edit/elements

Modified Files:
      Tag: FREESIDE_1_9_BRANCH
	svc_Common.html edit.html 
Log Message:
add location to svc_phone, RT#7047

Index: edit.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/elements/edit.html,v
retrieving revision 1.39.2.3
retrieving revision 1.39.2.4
diff -u -w -d -r1.39.2.3 -r1.39.2.4
--- edit.html	1 Mar 2010 21:36:21 -0000	1.39.2.3
+++ edit.html	12 Mar 2010 03:36:47 -0000	1.39.2.4
@@ -40,7 +40,7 @@
                     'disabled' => 0,
                     'onchange' => 'javascript_function',
 
-                    'include_opt_callback' => sub { #my $ = @_;
+                    'include_opt_callback' => sub { my $object = @_;
                                                     ( 'option' => 'value', );
                                                   },
 
@@ -296,11 +296,15 @@
 %
 %   if ( $type eq 'tablebreak-tr-title' ) {
 %     $include_common{'table_id'} = 'TableNumber'. $tablenum++;
+%   }
+%   if ( $type eq 'tablebreak-tr-title' || $type eq 'title' ) {
 %     $include_common{'colspan'} = $f->{colspan} if $f->{colspan};
 %   }
 %
 %   if ( $f->{include_opt_callback} ) {
-%     %include_common = ( %include_common, &{ $f->{include_opt_callback} } );
+%     %include_common = ( %include_common,
+%                         &{ $f->{include_opt_callback} }( $object )
+%                       );
 %   }
 %
 %   my $layer_prefix_on = '';

Index: svc_Common.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/elements/svc_Common.html,v
retrieving revision 1.8.2.5
retrieving revision 1.8.2.6
diff -u -w -d -r1.8.2.5 -r1.8.2.6
--- svc_Common.html	8 Mar 2010 07:03:00 -0000	1.8.2.5
+++ svc_Common.html	12 Mar 2010 03:36:47 -0000	1.8.2.6
@@ -34,12 +34,14 @@
                  'new_hashref_callback' => sub {
                    #my( $cgi, $svc_x ) = @_;
 
-                   { svcpart => $svcpart };
+                   { pkgnum  => $pkgnum,
+                     svcpart => $svcpart,
+                   };
 
                  },
 
                  'new_callback' => sub {
-                    my( $cgi, $svc_x, $fields, $opt ) = @_;;
+                    my( $cgi, $svc_x, $fields, $opt ) = @_;
 
                     $part_svc = qsearchs( 'part_svc', { svcpart=>$svcpart });
                     die "No part_svc entry!" unless $part_svc;
@@ -48,6 +50,13 @@
 
                     #$svcnum='';
 
+                    if ( my $cb = $opt{'svc_new_callback'} ) {
+                     my $cust_pkg = $pkgnum
+                                      ? qsearchs('cust_pkg', {pkgnum=>$pkgnum})
+                                      : ''; #?
+                      &{ $cb }( $cgi,$svc_x, $part_svc,$cust_pkg, $fields,$opt);
+                    }
+
                     $svc_x->set_default_and_fixed;
 
                  },
@@ -141,11 +150,13 @@
 sub label_fixup {
   my( $part_svc, $opt ) = @_;
 
+  $opt->{'name'} ||= $part_svc->svc;
+
   my $svcdb = $part_svc->svcdb;
   require "FS/$svcdb.pm";
 
   if ( UNIVERSAL::can("FS::$svcdb", 'table_info') ) {
-    $opt->{'name'} ||= "FS::$svcdb"->table_info->{'name'};
+    #$opt->{'name'} ||= "FS::$svcdb"->table_info->{'name'};
 
     my $fields = "FS::$svcdb"->table_info->{'fields'};
     $opt->{'fields'} ||= [ grep { $_ ne 'svcnum' } keys %$fields ];
@@ -165,7 +176,7 @@
   my $labels = $opt->{labels}; # with -> here
   foreach my $field ( keys %{ $opt->{labels} } ) {
     my $col = $part_svc->part_svc_column($field);
-    $labels->{$field} = $col->columnlabel if $col->columnlabel !~ /^\S*$/;
+    $labels->{$field} = $col->columnlabel if $col->columnlabel !~ /^\s*$/;
   }
 
 }



More information about the freeside-commits mailing list