summaryrefslogtreecommitdiffstats
path: root/includes/admin/views/giglog_admin_page.php
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-09-03 14:37:37 +0200
committerHarald Eilertsen <haraldei@anduin.net>2021-09-03 14:37:37 +0200
commit2ca81303a9b892e179a790dc9e4ed14c08307610 (patch)
tree6bf0697bf9c258062db9e32944279ab0ec457bf9 /includes/admin/views/giglog_admin_page.php
parentc09de43860ac6d57c6af31c971424e9c957e75c2 (diff)
downloadgigologadmin-2ca81303a9b892e179a790dc9e4ed14c08307610.tar.gz
gigologadmin-2ca81303a9b892e179a790dc9e4ed14c08307610.tar.bz2
gigologadmin-2ca81303a9b892e179a790dc9e4ed14c08307610.zip
Drop ref to ConcertLogs in AdminPage::get_user method.
Diffstat (limited to 'includes/admin/views/giglog_admin_page.php')
-rw-r--r--includes/admin/views/giglog_admin_page.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php
index 7490122..0db72b2 100644
--- a/includes/admin/views/giglog_admin_page.php
+++ b/includes/admin/views/giglog_admin_page.php
@@ -68,16 +68,18 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
}
- private function get_user( ?int $cid, string $ctype): string
+ private function get_user( GiglogAdmin_Concert $concert, string $role): string
{
$users = array_map(
fn($usr) => $usr->user_login,
get_users( array( 'fields' => array( 'user_login' ) ) ) );
- $current_user = $cid ? GiglogAdmin_Concertlogs::get_assigned_user( $cid, $ctype ) : null;
+ $roles = $concert->roles();
+
+ $current_user = array_key_exists($role, $roles) ? $roles[$role] : NULL;
return \EternalTerror\ViewHelpers\select_field(
- $ctype,
+ $role,
array_map( fn($user) => [ $user, $user ], $users ),
$current_user);
}
@@ -143,11 +145,12 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
$content.='<p><input type="submit" name="newconcert" value="Create New Concert"></p>';
$content.='</div>';
+
$content.='<div class="useritems"><strong>ASSIGNMENT DETAILS</strong><br><br><fieldset>'
- .'<label for="photo1">Photo1:</label>'.$this->get_user($c->id(),'photo1').'<br>'
- .'<label for="photo2">Photo2:</label>'.$this->get_user($c->id(),'photo2').'<br>'
- .'<label for="rev1">Text1:</label>'.$this->get_user($c->id(),'rev1').'<br>'
- .'<label for="rev2">Text2:</label>'.$this->get_user($c->id(),'rev2').'<br>';
+ .'<label for="photo1">Photo1:</label>'.$this->get_user($c,'photo1').'<br>'
+ .'<label for="photo2">Photo2:</label>'.$this->get_user($c,'photo2').'<br>'
+ .'<label for="rev1">Text1:</label>'.$this->get_user($c,'rev1').'<br>'
+ .'<label for="rev2">Text2:</label>'.$this->get_user($c,'rev2').'<br>';
$content.='<fieldset></div></form></div>';
$content.='<div class="venueform"><form method="POST" action="" class="venue" ><strong>VENUE DETAILS</strong><br><br>'