From fac89394dc48e92a86244bf385c84834deb217d4 Mon Sep 17 00:00:00 2001 From: Peter Rotich <peter@osticket.com> Date: Wed, 26 Feb 2014 23:26:56 +0000 Subject: [PATCH] Allow manager to be set even when a department has no members This is necessary to allow for creative department based access control and alerts. --- include/staff/department.inc.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/include/staff/department.inc.php b/include/staff/department.inc.php index 1031b3d97..c452cab26 100644 --- a/include/staff/department.inc.php +++ b/include/staff/department.inc.php @@ -119,8 +119,6 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); <span class="error">* <?php echo $errors['sla_id']; ?></span> </td> </tr> - <?php - if($dept && $dept->getNumUsers()){ ?> <tr> <td width="180" class="required"> Manager: @@ -128,12 +126,11 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); <td> <select name="manager_id"> <option value="0">— None —</option> - <option value="0" disabled="disabled">Select Department Manager (Optional)</option> <?php $sql='SELECT staff_id,CONCAT_WS(", ",lastname, firstname) as name ' .' FROM '.STAFF_TABLE.' staff ' .' ORDER by name'; - if(($res=db_query($sql)) && db_num_rows($res)){ + if(($res=db_query($sql)) && db_num_rows($res)) { while(list($id,$name)=db_fetch_row($res)){ $selected=($info['manager_id'] && $id==$info['manager_id'])?'selected="selected"':''; echo sprintf('<option value="%d" %s>%s</option>',$id,$selected,$name); @@ -144,9 +141,6 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); <span class="error"> <?php echo $errors['manager_id']; ?></span> </td> </tr> - <?php - } ?> - <tr> <td width="180"> Group Membership: -- GitLab