diff options
-rw-r--r-- | app/model/issue.php | 15 | ||||
-rw-r--r-- | app/view/issue.php | 3 |
2 files changed, 12 insertions, 6 deletions
diff --git a/app/model/issue.php b/app/model/issue.php index c3423f7..76ae9a9 100644 --- a/app/model/issue.php +++ b/app/model/issue.php @@ -85,12 +85,17 @@ if (isAction("iss-mesg-add")) } $assignee = new user($form->assignee); - $stat = $issue->addAssignee($assignee, $user); - if (!$stat) - logError(ERROR, "Failed to assign issue"); - else - $log = mesg::initNewLog("%s assigned " . $assignee->getDisplayName(), $user, $issue); + if (!$assignee->isAssignedTo($issue)) + { + $stat = $issue->addAssignee($assignee, $user); + $mesg = ($assignee->guid == $user->guid ? "%s claimed" : "%s assigned " . $assignee->getDisplayName()); + + if (!$stat) + logError(ERROR, "Failed to assign issue"); + else + $log = mesg::initNewLog($mesg, $user, $issue); + } } else if (isset(input()['closeIssue'])) 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 } ?> |