summaryrefslogtreecommitdiffstats
path: root/RelationSet.pm
diff options
context:
space:
mode:
authorcyeh%bluemartini.com <>2000-06-22 04:03:45 +0200
committercyeh%bluemartini.com <>2000-06-22 04:03:45 +0200
commiteac17c0469a8e2b84b58f33b8f8aeb2f2addc2a9 (patch)
treec352433fa36b956b16b96c46b67dabcd627112ab /RelationSet.pm
parentf64f22341d04df2c877507245ba79c1aa1a37e85 (diff)
downloadbugzilla-eac17c0469a8e2b84b58f33b8f8aeb2f2addc2a9.tar.gz
bugzilla-eac17c0469a8e2b84b58f33b8f8aeb2f2addc2a9.tar.xz
Checkin for Bug 42851 'Use listbox with input for CC management on bug form'
contributed by dave@intrec.com (Dave Miller)
Diffstat (limited to 'RelationSet.pm')
-rw-r--r--RelationSet.pm37
1 files changed, 37 insertions, 0 deletions
diff --git a/RelationSet.pm b/RelationSet.pm
index 92e2158f2..b5cae289c 100644
--- a/RelationSet.pm
+++ b/RelationSet.pm
@@ -18,6 +18,7 @@
#
# Contributor(s): Dan Mosedale <dmose@mozilla.org>
# Terry Weissman <terry@mozilla.org>
+# Dave Miller <dave@intrec.com>
# 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 {