summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2018-10-21 23:07:10 -0400
committerMalf Furious <m@lfurio.us>2018-10-21 23:07:10 -0400
commitc2d42ce0239c8da0cb9acea922f6dea183196225 (patch)
tree25de675749e54e144eda7d8be63d61e572c94dd4
parenta18205b9991f9e5d6ac0a86aa37f049bf53980f6 (diff)
downloadscrott-c2d42ce0239c8da0cb9acea922f6dea183196225.tar.gz
scrott-c2d42ce0239c8da0cb9acea922f6dea183196225.zip
agent: Add function isAssignedTo()
-rw-r--r--app/class/agent.class.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/class/agent.class.php b/app/class/agent.class.php
index c8e6436..4c75f0b 100644
--- a/app/class/agent.class.php
+++ b/app/class/agent.class.php
@@ -75,6 +75,21 @@ abstract class agent extends obj
}
/*
+ * Check whether this agent is assigned to the given issue
+ */
+ public function isAssignedTo(issue $issue) : bool
+ {
+ foreach ($issue->getAssignees() as $assign)
+ {
+ if ($assign->assignee->guid == $this->guid
+ && $assign->dismissed == "")
+ return true;
+ }
+
+ return false;
+ }
+
+ /*
* Send an email message to this agent using stored configuration
* parameters. If config is not established, delivery is not
* attempted. Return status.