summaryrefslogtreecommitdiffstats
path: root/includes/admin/views/giglog_admin_page.php
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-09-03 11:40:59 +0200
committerHarald Eilertsen <haraldei@anduin.net>2021-09-03 11:40:59 +0200
commitce7584bd6362d4eed9160c361498e624aede6a06 (patch)
tree514420939dd1167547c8c2508314f32817859b09 /includes/admin/views/giglog_admin_page.php
parent74b06505888d69602b32d792ba4a815cd604ae41 (diff)
downloadgigologadmin-ce7584bd6362d4eed9160c361498e624aede6a06.tar.gz
gigologadmin-ce7584bd6362d4eed9160c361498e624aede6a06.tar.bz2
gigologadmin-ce7584bd6362d4eed9160c361498e624aede6a06.zip
Render adminactions in concert list view.
Clicking the buttons don't work quite yet.
Diffstat (limited to 'includes/admin/views/giglog_admin_page.php')
-rw-r--r--includes/admin/views/giglog_admin_page.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php
index 5a16b66..3fe3237 100644
--- a/includes/admin/views/giglog_admin_page.php
+++ b/includes/admin/views/giglog_admin_page.php
@@ -150,7 +150,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
return $content;
}
- private function adminactions( int $concert_id ) : string
+ private function adminactions( GiglogAdmin_Concert $concert ) : string
{
global $wpdb;
$query = "SELECT id,wpgs_name from wpg_pressstatus" ;
@@ -158,11 +158,11 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
return
'<form method="POST" action="">'
- . '<input type="hidden" name="cid" value="' . $concert_id . '" />'
+ . '<input type="hidden" name="cid" value="' . $concert->id() . '" />'
. \EternalTerror\ViewHelpers\select_field(
'selectstatus',
array_map(fn($status) => [ $status->id, $status->wpgs_name ], $statuses),
- GiglogAdmin_Concertlogs::get_status($concert_id))
+ $concert->status())
. '<input type="submit" value="SetStatus">'
. '<input type="submit" name ="edit" value="EDIT">'
. '</form>';
@@ -248,12 +248,12 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
$content .= '<td>' . $concert->status() . '</td>';
- // if (current_user_can('administrator')) {
- // $content .=
- // '<td class="adminbuttons">'
- // . $this->adminactions($row->id)
- // . '</td>';
- // }
+ if (current_user_can('administrator')) {
+ $content .=
+ '<td class="adminbuttons">'
+ . $this->adminactions($concert)
+ . '</td>';
+ }
$content .= '</tr>';
$lastType = $concert->venue()->city();
}