From c2d42ce0239c8da0cb9acea922f6dea183196225 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sun, 21 Oct 2018 23:07:10 -0400 Subject: agent: Add function isAssignedTo() --- app/class/agent.class.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'app/class/agent.class.php') 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 @@ -74,6 +74,21 @@ abstract class agent extends obj return false; } + /* + * 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 -- cgit v1.2.3