summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/class/agent.class.php7
-rw-r--r--app/class/group.class.php11
-rw-r--r--app/class/user.class.php9
-rw-r--r--app/view/issue.php8
4 files changed, 32 insertions, 3 deletions
diff --git a/app/class/agent.class.php b/app/class/agent.class.php
index 4c75f0b..4651a10 100644
--- a/app/class/agent.class.php
+++ b/app/class/agent.class.php
@@ -90,6 +90,13 @@ abstract class agent extends obj
}
/*
+ * Get all contained users. For users, this is an array containing
+ * only $this. For groups, this is an array containing the owner
+ * and all members.
+ */
+ public abstract function getContainedUsers() : array;
+
+ /*
* Send an email message to this agent using stored configuration
* parameters. If config is not established, delivery is not
* attempted. Return status.
diff --git a/app/class/group.class.php b/app/class/group.class.php
index 1191d71..600fb6d 100644
--- a/app/class/group.class.php
+++ b/app/class/group.class.php
@@ -64,6 +64,17 @@ class group extends agent
}
/*
+ * Get all contained users. This is an array of all members and
+ * the group owner.
+ */
+ public function getContainedUsers() : array
+ {
+ $cus = $this->getMembers();
+ $cus[] = $this->getOwner();
+ return $cus;
+ }
+
+ /*
* Send an email message to this group using stored configuration
* parameters. If config is not established, delivery is not
* attempted. Return status. If any delivery attempts fail, the
diff --git a/app/class/user.class.php b/app/class/user.class.php
index 90aac44..231111d 100644
--- a/app/class/user.class.php
+++ b/app/class/user.class.php
@@ -294,6 +294,15 @@ class user extends agent
}
/*
+ * Get all contained users. This is just an array containing
+ * the user object.
+ */
+ public function getContainedUsers() : array
+ {
+ return array($this);
+ }
+
+ /*
* Send an email message to this user using stored configuration
* parameters. If config is not established, delivery is not
* attempted. Return status.
diff --git a/app/view/issue.php b/app/view/issue.php
index 6edf7cf..01a9f5f 100644
--- a/app/view/issue.php
+++ b/app/view/issue.php
@@ -138,9 +138,11 @@ require_once "class/issue.class.php";
<label>Select assignee</label>
<select name="input[assignee]" class="form-control selectpicker">
- <option data-icon="glyphicon-user" value="<?=$i->getParent()->getParent()->getOwner()->guid?>">
- <?=$i->getParent()->getParent()->getOwner()->getDisplayName()?>
- </option>
+ <?php foreach ($i->getParent()->getParent()->getOwner()->getContainedUsers() as $memb) { ?>
+ <option data-icon="glyphicon-user" value="<?=$memb->guid?>">
+ <?=$memb->getDisplayName()?>
+ </option>
+ <?php } ?>
<?php foreach ($i->getParent()->getParent()->getMembers() as $memb) { ?>
<option data-icon="glyphicon-user" value="<?=$memb->guid?>">