fix selection of owner

This commit is contained in:
Uwe Steinmann 2020-09-14 16:35:17 +02:00
parent 0ebd044cac
commit 904eef7816

View File

@ -158,16 +158,13 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
<tr>
<td><?php printMLText("owner");?>:</td>
<td>
<?php
$ownerids = array_map(function($n) {return $n->getId();}, $owner);
?>
<select class="chzn-select" name="owner[]" data-allow-clear="true" data-placeholder="<?php printMLText('select_users'); ?>" data-no_results_text="<?php printMLText('unknown_owner'); ?>">
<option value=""></option>
<?php
foreach ($allUsers as $userObj) {
if ($userObj->isGuest() || ($userObj->isHidden() && $userObj->getID() != $user->getID() && !$user->isAdmin()))
continue;
print "<option value=\"".$userObj->getLogin()."\" ".(in_array($userObj->getId(), $ownerids) ? "selected" : "").">" . htmlspecialchars($userObj->getLogin()." - ".$userObj->getFullName()) . "</option>\n";
print "<option value=\"".$userObj->getLogin()."\" ".(in_array($userObj->getLogin(), $owner) ? "selected" : "").">" . htmlspecialchars($userObj->getLogin()." - ".$userObj->getFullName()) . "</option>\n";
}
?>
</select>