[freeside-commits] freeside/FS/FS m2m_Common.pm, 1.3, 1.4 part_pkg.pm, 1.66, 1.67
Ivan,,,
ivan at wavetail.420.am
Tue Apr 15 18:03:13 PDT 2008
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv18264/FS/FS
Modified Files:
m2m_Common.pm part_pkg.pm
Log Message:
fix new link editing in new package editor
Index: m2m_Common.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/m2m_Common.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- m2m_Common.pm 16 Apr 2008 00:16:52 -0000 1.3
+++ m2m_Common.pm 16 Apr 2008 01:03:11 -0000 1.4
@@ -1,7 +1,7 @@
package FS::m2m_Common;
use strict;
-use vars qw( @ISA $DEBUG );
+use vars qw( @ISA $DEBUG $me );
use FS::Schema qw( dbdef );
use FS::Record qw( qsearch qsearchs dbh );
@@ -9,6 +9,7 @@
#@ISA = qw( FS::Record );
$DEBUG = 0;
+$me = '[FS::m2m_Common]';
=head1 NAME
@@ -66,10 +67,15 @@
sub process_m2m {
my( $self, %opt ) = @_;
+ #use Data::Dumper;
+ #warn "$me process_m2m called on $self with options:\n". Dumper(%opt)
+ warn "$me process_m2m called on $self"
+ if $DEBUG;
+
my $self_pkey = $self->dbdef_table->primary_key;
my $base_field = $opt{'base_field'} || $self_pkey;
- my %hash = $opt{'hashref'} || {};
- $hash{$base_field} = $self->$self_pkey();
+ my $hashref = $opt{'hashref'} || {};
+ $hashref->{$base_field} = $self->$self_pkey();
my $link_table = $self->_load_table($opt{'link_table'});
@@ -99,7 +105,7 @@
&& ! $opt{'params'}->{"$target_field$targetnum"}
);
}
- qsearch( $link_table, \%hash )
+ qsearch( $link_table, $hashref )
) {
my $error = $del_obj->delete;
if ( $error ) {
@@ -109,7 +115,7 @@
}
foreach my $add_targetnum (
- grep { ! qsearchs( $link_table, { %hash, $target_field => $_ } ) }
+ grep { ! qsearchs( $link_table, { %$hashref, $target_field => $_ } ) }
map { /^($target_field)?(\d+)$/; $2; }
grep { /^($target_field)?(\d+)$/ }
grep { $opt{'params'}->{$_} }
@@ -117,7 +123,7 @@
) {
my $add_obj = "FS::$link_table"->new( {
- %hash,
+ %$hashref,
$target_field => $add_targetnum,
});
my $error = $add_obj->insert;
Index: part_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg.pm,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- part_pkg.pm 16 Apr 2008 00:29:18 -0000 1.66
+++ part_pkg.pm 16 Apr 2008 01:03:11 -0000 1.67
@@ -720,7 +720,7 @@
}
sub _part_pkg_link {
- my( $self, $type ) = shift;
+ my( $self, $type ) = @_;
qsearch('part_pkg_link', { 'src_pkgpart' => $self->pkgpart,
'link_type' => $type,
}
More information about the freeside-commits
mailing list