From 74fb7c0e54cc2d38dddefca5f9025db02bb86a36 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Fri, 17 Jul 2015 08:35:28 -0500
Subject: [PATCH] team: Show current members in lead dropdown

---
 include/staff/team.inc.php | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/staff/team.inc.php b/include/staff/team.inc.php
index e7a9a95bd..4fb127ec5 100644
--- a/include/staff/team.inc.php
+++ b/include/staff/team.inc.php
@@ -82,7 +82,13 @@ $info = $team->getInfo();
                 <span>
                 <select id="team-lead-select" name="lead_id" data-quick-add="staff">
                     <option value="0">&mdash; <?php echo __('None');?> &mdash;</option>
-                  <option value="0" data-quick-add>&mdash; <?php echo __('Add New');?> &mdash;</option>
+<?php               if ($members) {
+                        foreach($members as $k=>$staff){
+                            $selected=($team->lead_id && $staff->getId()==$team->lead_id)?'selected="selected"':'';
+                            echo sprintf('<option value="%d" %s>%s</option>',$staff->getId(),$selected,$staff->getName());
+                        }
+                    } ?>
+                    <option value="0" data-quick-add>&mdash; <?php echo __('Add New');?> &mdash;</option>
                 </select>
                 &nbsp;<span class="error"><?php echo $errors['lead_id']; ?></span>
                 <i class="help-tip icon-question-sign" href="#lead"></i>
-- 
GitLab