summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.lock8
-rw-r--r--includes/admin/views/_concerts_table.php25
-rw-r--r--includes/concert.php6
-rw-r--r--includes/css/main.css13
-rw-r--r--includes/venue.php3
-rw-r--r--package-lock.json12
-rw-r--r--psalm.xml1
7 files changed, 50 insertions, 18 deletions
diff --git a/composer.lock b/composer.lock
index 9a24a89..9329d8e 100644
--- a/composer.lock
+++ b/composer.lock
@@ -5,6 +5,7 @@
"This file is @generated automatically"
],
"content-hash": "da8593c79fc71116e3079512611bb8ec",
+
"packages": [],
"packages-dev": [
{
@@ -329,6 +330,7 @@
},
{
"name": "composer/xdebug-handler",
+
"version": "2.0.0",
"source": {
"type": "git",
@@ -373,7 +375,9 @@
"support": {
"irc": "irc://irc.freenode.org/composer",
"issues": "https://github.com/composer/xdebug-handler/issues",
+
"source": "https://github.com/composer/xdebug-handler/tree/2.0.0"
+
},
"funding": [
{
@@ -389,7 +393,9 @@
"type": "tidelift"
}
],
+
"time": "2021-04-09T19:40:06+00:00"
+
},
{
"name": "dnoegel/php-xdg-base-dir",
@@ -530,6 +536,7 @@
"time": "2021-02-22T14:02:09+00:00"
},
{
+
"name": "humanmade/psalm-plugin-wordpress",
"version": "2.0.4",
"source": {
@@ -809,6 +816,7 @@
"time": "2019-03-29T20:06:56+00:00"
},
{
+
"name": "php-stubs/wordpress-stubs",
"version": "v5.7.0",
"source": {
diff --git a/includes/admin/views/_concerts_table.php b/includes/admin/views/_concerts_table.php
index d92c729..685ee07 100644
--- a/includes/admin/views/_concerts_table.php
+++ b/includes/admin/views/_concerts_table.php
@@ -51,6 +51,9 @@ if (!class_exists("GiglogAdmin_ConcertsTable"))
$venue = filter_input( INPUT_POST, 'selectvenue', FILTER_SANITIZE_SPECIAL_CHARS );
if ($venue) $filter['venue_id'] = $venue;
+ if(isset($_POST['ownconcerts']) && $_POST['ownconcerts'] == '1')
+ $filter['currentuser'] = wp_get_current_user()->user_login;
+
$concerts = GiglogAdmin_Concert::find_concerts($filter);
$lastType = '';
@@ -59,15 +62,15 @@ if (!class_exists("GiglogAdmin_ConcertsTable"))
$content .= '<tr class="assignitr">';
if ($lastType != '' && $lastType != $concert->venue()->city()) {
- $content .= '<td>' . $concert->venue()->city() . '</td></tr><tr>';
+ $content .= '<td>' . $concert->venue()->city() . '</td></tr><tr class="assignitr">';
}
if ($lastType == '' ) {
- $content .= '<td>' . $concert->venue()->city() . '</td></tr><tr>';
+ $content .= '<td>' . $concert->venue()->city() . '</td></tr><tr class="assignitr">';
}
// Modify these to match the database structure
// $content .= '<td>' . $row->id. '</td>';
- $content .= '<td></td>';
+ $content .= '<td></br></br></td>';
$content .= '<td>' . $concert->cname() . '</td>';
$content .= '<td>' . $concert->venue()->name() . '</td>';
$fdate = strtotime($concert->cdate());
@@ -75,12 +78,12 @@ if (!class_exists("GiglogAdmin_ConcertsTable"))
//$content .= DATE_FORMAT($fdate,'%d.%b.%Y');
$content .= '<td>' . $newformat . '</td>';
- $content .= '<td>' . $this->mark_new_concert($concert) . '</td>';
+ $content .= '<td class="publishstatus">' . $this->mark_new_concert($concert) . '</td>';
- $content .= '<td>' . $this->assign_role_for_user_form('photo1', $concert) . '</td>';
- $content .= '<td>' . $this->assign_role_for_user_form('photo2', $concert) . '</td>';
- $content .= '<td>' . $this->assign_role_for_user_form('rev1', $concert) . '</td>';
- $content .= '<td>' . $this->assign_role_for_user_form('rev2', $concert) . '</td>';
+ $content .= '<td class="assigneduser">' . $this->assign_role_for_user_form('photo1', $concert) . '</td>';
+ $content .= '<td> class="assigneduser">' . $this->assign_role_for_user_form('photo2', $concert) . '</td>';
+ $content .= '<td class="assigneduser">' . $this->assign_role_for_user_form('rev1', $concert) . '</td>';
+ $content .= '<td class="assigneduser">' . $this->assign_role_for_user_form('rev2', $concert) . '</td>';
$content .= '<td>' . self::STATUS_LABELS[$concert->status()] . '</td>';
@@ -124,8 +127,8 @@ if (!class_exists("GiglogAdmin_ConcertsTable"))
}
//option to select own concerts only
$select .= '<input class="ownconc" type="checkbox" value="1"';
- if(isset($_POST['my_checkbox'])) $select .=' checked="checked" ';
- $select.=' name="my_checkbox">Show own concerts only</input>';
+ if(isset($_POST['ownconcerts'])) $select .=' checked="checked" ';
+ $select.=' name="ownconcerts">Show own concerts only</input>';
$select .= '<input type="submit" value="APPLY"></form>';
@@ -174,7 +177,7 @@ if (!class_exists("GiglogAdmin_ConcertsTable"))
$f = '<form class="unassignit" method="POST" action="">'
. ' <input type="hidden" name="cid" value="' . $concert->id() . '" />'
. ' <input type="hidden" name="pid" value="' . $role . '" />'
- . ' <input type="submit" name="unassignitem" value="Your"/>'
+ . ' <input type="submit" name="unassignitem" value=""/>'
. '</form>';
}
elseif ( $assigned_user ) { //check if slot is taken by another user
diff --git a/includes/concert.php b/includes/concert.php
index 29de015..66f9c1f 100644
--- a/includes/concert.php
+++ b/includes/concert.php
@@ -85,6 +85,7 @@ if ( !class_exists('GiglogAdmin_Concert') ) {
$query = self::BASE_QUERY
. 'WHERE ' . $wpdb->prepare('wpg_concerts.id = %d', $id);
+ $query.= ' ORDER BY wpgconcert_date';
$results = $wpdb->get_results($query);
@@ -216,9 +217,14 @@ if ( !class_exists('GiglogAdmin_Concert') ) {
array_push($where, 'wpg_venues.id = ' . $wpdb->prepare('%s', $filter["venue_id"]));
}
+ if ( isset( $filter["currentuser"] ) ) {
+ array_push($where , 'wpgconcert_roles like "%'.$filter["currentuser"].'%"');
+ }
+
if ( ! empty( $where ) ) {
$query .= 'WHERE ' . implode(' and ', $where);
}
+ $query.= ' ORDER BY wpgconcert_date';
$results = $wpdb->get_results($query);
diff --git a/includes/css/main.css b/includes/css/main.css
index 1cbc906..a984018 100644
--- a/includes/css/main.css
+++ b/includes/css/main.css
@@ -77,6 +77,7 @@ span.takenbyself
padding: none !important;
font-size: small;
vertical-align: center;
+ border-collapse:collapse;
}
table.assignit
@@ -84,6 +85,7 @@ table.assignit
{
white-space: nowrap;
overflow: hidden;
+ border-collapse:collapse;
}
input[name="unassignitem"]
@@ -162,3 +164,14 @@ input[name="unassignitem"]
{
height: auto;
}
+
+ tr.assignitr:nth-child(even){
+ background: #CCC
+ }
+
+
+ .assigneduser, .publishstatus
+ {
+ text-align: center;
+
+ }
diff --git a/includes/venue.php b/includes/venue.php
index 3ad0f06..444fd29 100644
--- a/includes/venue.php
+++ b/includes/venue.php
@@ -110,7 +110,7 @@ if ( !class_exists('GiglogAdmin_Venue') ) {
{
global $wpdb;
- $results = $wpdb->get_results("select * from wpg_venues");
+ $results = $wpdb->get_results("select * from wpg_venues ORDER BY wpgvenue_name");
return array_map(function ($r) { return new GiglogAdmin_Venue($r); }, $results);
}
@@ -125,6 +125,7 @@ if ( !class_exists('GiglogAdmin_Venue') ) {
{
global $wpdb;
$q = $wpdb->prepare("select * from wpg_venues where wpgvenue_city=%s", $city);
+ $q .=" ORDER BY wpgvenue_name";
$results = $wpdb->get_results($q);
return array_map(function ($r) { return new GiglogAdmin_Venue($r); }, $results);
diff --git a/package-lock.json b/package-lock.json
index ed63f0b..0dbfd36 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -665,9 +665,9 @@
}
},
"lodash": {
- "version": "4.17.20",
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
- "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==",
+ "version": "4.17.21",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
+ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
"log-symbols": {
@@ -786,9 +786,9 @@
"dev": true
},
"normalize-url": {
- "version": "4.5.0",
- "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz",
- "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==",
+ "version": "4.5.1",
+ "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz",
+ "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==",
"dev": true
},
"once": {
diff --git a/psalm.xml b/psalm.xml
index 8121858..6b0f00f 100644
--- a/psalm.xml
+++ b/psalm.xml
@@ -1,4 +1,5 @@
<?xml version="1.0"?>
+
<!--
SPDX-FileCopyrightText: 2021 Andrea Chirulescu <andrea.chirulescu@gmail.com>
SPDX-FileCopyrightText: 2021 Harald Eilertsen <haraldei@anduin.net>