EditTag: allow designating a tag owner

This commit is contained in:
Aaron van Geffen 2023-03-11 19:57:19 +01:00
parent 59b1fa7a72
commit ad816f10a3
2 changed files with 16 additions and 0 deletions

View File

@ -75,6 +75,11 @@ class EditTag extends HTMLController
'Person' => 'Person',
],
],
'id_user_owner' => [
'type' => 'select',
'label' => 'Owner',
'options' => [0 => '(nobody)'] + Member::getMemberMap(),
],
'tag' => [
'type' => 'text',
'label' => 'Tag title',

View File

@ -192,4 +192,15 @@ class Member extends User
// We should probably phase out the use of this function, or refactor the access levels of member properties...
return get_object_vars($this);
}
public static function getMemberMap()
{
return Registry::get('db')->queryPair('
SELECT id_user, CONCAT(first_name, {string:blank}, surname) AS full_name
FROM users
ORDER BY first_name, surname',
[
'blank' => ' ',
]);
}
}