From 5ca9a06004fa94a1882e117da712bcbb6902291d Mon Sep 17 00:00:00 2001
From: Malfurious <m@lfurio.us>
Date: Wed, 20 Oct 2021 02:28:18 -0400
Subject: Recognize self-assignment within the issue UI

As a special case, self-assignment is refered to as claiming assignment
of an issue.  The assignee list on the issue sidebar will now properly
identify users which have assigned themselves, and the issue event log
will now contain "Bob claimed" instead of "Bob assigned Bob" when such
an event occurs in the future.

Signed-off-by: Malfurious <m@lfurio.us>
---
 app/view/issue.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'app/view/issue.php')

diff --git a/app/view/issue.php b/app/view/issue.php
index fbd180a..9c4d77c 100644
--- a/app/view/issue.php
+++ b/app/view/issue.php
@@ -198,7 +198,8 @@ require_once "class/issue.class.php";
                                 <?php if ($assign->signedoff != "") { ?>
                                     <?=userPanel($assign->assignee, "alert alert-success", "signed off", $assign->signedoff)?>
                                 <?php } else { ?>
-                                    <?=userPanel($assign->assignee, "alert alert-warning", "assigned", $assign->assigned)?>
+                                    <?php $verb = ($assign->assignee == $assign->assigner ? "claimed" : "assigned"); ?>
+                                    <?=userPanel($assign->assignee, "alert alert-warning", $verb, $assign->assigned)?>
                                 <?php } ?>
                             <?php } ?>
 
-- 
cgit v1.2.3