From eac17c0469a8e2b84b58f33b8f8aeb2f2addc2a9 Mon Sep 17 00:00:00 2001 From: "cyeh%bluemartini.com" <> Date: Thu, 22 Jun 2000 02:03:45 +0000 Subject: Checkin for Bug 42851 'Use listbox with input for CC management on bug form' contributed by dave@intrec.com (Dave Miller) --- Bugzilla/RelationSet.pm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'Bugzilla') diff --git a/Bugzilla/RelationSet.pm b/Bugzilla/RelationSet.pm index 92e2158f2..b5cae289c 100644 --- a/Bugzilla/RelationSet.pm +++ b/Bugzilla/RelationSet.pm @@ -18,6 +18,7 @@ # # Contributor(s): Dan Mosedale # Terry Weissman +# Dave Miller # This object models a set of relations between one item and a group # of other items. An example is the set of relations between one bug @@ -179,6 +180,42 @@ sub mergeFromString { } } +# remove a set in string form from this set +# +sub removeItemsInString { + ($#_ == 1) || confess("invalid number of arguments"); + my $self = shift(); + + # do the merge + # + foreach my $person (split(/[ ,]/, shift())) { + if ($person ne "") { + my $dbid = &::DBNameToIdAndCheck($person); + if (exists $$self{$dbid}) { + delete $$self{$dbid}; + } + } + } +} + +# remove a set in array form from this set +# +sub removeItemsInArray { + ($#_ > 0) || confess("invalid number of arguments"); + my $self = shift(); + + # do the merge + # + while (my $person = shift()) { + if ($person ne "") { + my $dbid = &::DBNameToIdAndCheck($person); + if (exists $$self{$dbid}) { + delete $$self{$dbid}; + } + } + } +} + # return the number of elements in this set # sub size { -- cgit v1.2.3-24-g4f1b