[freeside-commits] freeside/rt/lib/RT/Interface Web_Vendor.pm, 1.1, 1.1.4.1
Ivan,,,
ivan at wavetail.420.am
Sun Mar 23 16:39:17 PDT 2008
Update of /home/cvs/cvsroot/freeside/rt/lib/RT/Interface
In directory wavetail.420.am:/tmp/cvs-serv27452/lib/RT/Interface
Modified Files:
Tag: FREESIDE_1_7_BRANCH
Web_Vendor.pm
Log Message:
part 1 of #1160: associate users w/customers, manual editing
Index: Web_Vendor.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/rt/lib/RT/Interface/Web_Vendor.pm,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- Web_Vendor.pm 2 Dec 2004 09:59:48 -0000 1.1
+++ Web_Vendor.pm 23 Mar 2008 23:39:15 -0000 1.1.4.1
@@ -1,4 +1,5 @@
# Copyright (c) 2004 Ivan Kohler <ivan-rt at 420.am>
+# Copyright (c) 2008 Freeside Internet Services, Inc.
#
# This work is made available to you under the terms of Version 2 of
# the GNU General Public License. A copy of that license should have
@@ -91,5 +92,59 @@
}
+#false laziness w/above... eventually it should go away in favor of this
+sub ProcessObjectCustomers {
+ my %args = (
+ Object => undef,
+ ARGSRef => undef,
+ @_
+ );
+ my @results = ();
+
+ my $Object = $args{'Object'};
+ my $ARGSRef = $args{'ARGSRef'};
+
+ ### false laziness w/RT::Interface::Web::ProcessTicketLinks
+ # Delete links that are gone gone gone.
+ foreach my $arg ( keys %$ARGSRef ) {
+ if ( $arg =~ /DeleteLink-(.*?)-(DependsOn|MemberOf|RefersTo)-(.*)$/ ) {
+ my $base = $1;
+ my $type = $2;
+ my $target = $3;
+
+ push @results,
+ "Trying to delete: Base: $base Target: $target Type $type";
+ my ( $val, $msg ) = $Object->DeleteLink( Base => $base,
+ Type => $type,
+ Target => $target );
+
+ push @results, $msg;
+
+ }
+
+ }
+ ###
+
+ my @delete_custnums =
+ map { /^Object-AddCustomer-(\d+)$/; $1 }
+ grep { /^Object-AddCustomer-(\d+)$/ && $ARGSRef->{$_} }
+ keys %$ARGSRef;
+
+ my @custnums = map { /^Object-AddCustomer-(\d+)$/; $1 }
+ grep { /^Object-AddCustomer-(\d+)$/ && $ARGSRef->{$_} }
+ keys %$ARGSRef;
+
+ foreach my $custnum ( @custnums ) {
+ my( $val, $msg ) =
+ $Object->AddLink( 'Type' => 'MemberOf',
+ 'Target' => "freeside://freeside/cust_main/$custnum",
+ );
+ push @results, $msg;
+ }
+
+ return @results;
+
+}
+
1;
More information about the freeside-commits
mailing list