summaryrefslogtreecommitdiffstats
path: root/includes/concert.php
Commit message (Collapse)AuthorAgeFilesLines
* css small fixed for table displayAndreaChirulescu2022-02-091-4/+17
| | | | added pagination to concert list
* Clean up, fix and rename db tables.Harald Eilertsen2021-09-161-35/+38
| | | | | | | | | | | | | | | | | This patch got a bit more involved than what was originally planned, but since we're messing with the tables I decided to do it all right away. - Moves the constraint definition to the CREATE TABLE statement for the concerts table. This replaces the existing KEY definition that it had. - Make sure the venues table is created before the concerts table so that the above mentioned constraint definition works. - Rename the tables. Use the wpdb-prefix and make the name a bit prettier. This caused some changes in the Concert and Venue classes, and for slightly silly reasons some test classes. The code actually turned out better (for the most part), but some refactoring can still be done. The column names remains unchanged for now.
* Fix show only own concerts again.Harald Eilertsen2021-09-061-1/+1
| | | | Missed quitation marks around search term.
* Refactor Concert::find_concerts.Harald Eilertsen2021-09-061-23/+28
| | | | | Make it a bit more compact and fix use of $wpdb->prepare for `currentuser` filter.
* Throw instead of log error from Concert class.Harald Eilertsen2021-09-061-14/+9
| | | | | Should get rid of most of the annoying output during testing, and allow moving error handling and logging to the presentation layer.
* Use find_concerts to check for duplicates on create.Harald Eilertsen2021-09-061-5/+24
| | | | This also adds a number of new filters to find_concerts.
* Remove obsolete function Concert::findHarald Eilertsen2021-09-061-13/+0
|
* Use wpdb::get_row in Concert::get()Harald Eilertsen2021-09-061-4/+4
| | | | | Makes it clearer that we're just fetching _one_ row from the database. Also updated doc comment to hopefully be a bit clearer.
* Remove unneccesary code to sort single concert by date.Harald Eilertsen2021-09-061-1/+0
|
* Merge branch 'dev' of ↵AndreaChirulescu2021-09-051-1/+1
|\ | | | | | | | | | | | | https://code.volse.net/wordpress/plugins/gigologadmin.git into andreaschanges # Conflicts: # includes/admin/views/giglog_admin_page.php
| * Drop extra query for venue_id in concert queries.Harald Eilertsen2021-09-041-1/+1
| | | | | | | | | | It's not required since the id is in the concerts table too. That's what links them together.
* | Fixed filter by your concertsAndreaChirulescu2021-09-051-0/+4
| | | | | | | | Added CSS and extra fromatting to table
* | Fixed a call to city() method in concert.php It needed ->venue->cityAndreaChirulescu2021-09-041-0/+2
|/ | | | Added order by concert date in concert list
* Fix so concert id is not overwritten by venue id.Harald Eilertsen2021-09-041-5/+8
| | | | | | | | | | | | | | | | | | | | | | | We originally had a more specified query, but simplified it to: SELECT * FROM wpg_concerts LEFT JOIN wpg_venues ON ...; But since both the concerts table and the venues table has a column id, the concert id would be overwritten with the venue id. MySQL/MariaDB does not allow columns with the same name in multiple tables when using unqualified column names in the query. So we need to be more explicit again. I was hoping that the following would work: SELECT wpg_concerts.*, wpg_venues.* FROM .... ; I think MySQL/MariaDB would handle that, but now since php turns the result into an array, where each key must be unique, this again overwrites the concert id with the venue id. So thus a more verbose specification of the columns was necessary.
* Mark recently added concerts as new again.Harald Eilertsen2021-09-041-4/+14
|
* Make click to unassign from concert work again.Harald Eilertsen2021-09-041-0/+5
| | | | | | As a user can only be assigned to one role at the time, we remove the current user from any role that they may have when clearing the assignment.
* Editing concerts now work again.Harald Eilertsen2021-09-031-16/+39
|
* Shift value of Concert statuses to be 0-based.Harald Eilertsen2021-09-031-7/+7
| | | | | This will trip up any existing records in the db, but that should not matter, since we're changing how this entire stuff works now.
* emove dependency on ConcertLogs in gig import code.Harald Eilertsen2021-09-031-11/+0
|
* Allow empty concerts to be created.Harald Eilertsen2021-09-031-5/+5
|
* Fix more type issues in Concert and Venue classesHarald Eilertsen2021-09-021-1/+1
|
* psalm: Add type info to attrs and constructor for Concert.Harald Eilertsen2021-09-021-8/+18
| | | | Also make sure we explicitly set the venue attribute in the constructor.
* Fix saving and fetching roles from Concerts table.Harald Eilertsen2021-09-011-22/+20
|
* Begin move roles and status field to concerts table.Harald Eilertsen2021-06-271-0/+5
|
* Remove some debug output.Harald Eilertsen2021-06-271-1/+0
|
* Begin move roles and status field to concerts table.Harald Eilertsen2021-06-141-11/+57
| | | | There's no need to have a separate table (concertlogs) for these fields.
* Fix detecting error in update_concert method.Harald Eilertsen2021-06-131-1/+1
|
* Move method to update Concertlogs to Concertlogs class.Harald Eilertsen2021-06-131-23/+0
|
* Streamline Concert api.Harald Eilertsen2021-06-121-15/+22
| | | | | Reduce to one find_concerts function taking a filter to limit the selection.
* Fix misc Psalm issues.Harald Eilertsen2021-06-121-0/+2
|
* Make it possible to list all concerts.Harald Eilertsen2021-05-101-3/+6
|
* Method to find concerts at given venueHarald Eilertsen2021-05-091-0/+14
|
* Method to find concerts for a given city.Harald Eilertsen2021-05-091-0/+15
|
* Fix constructing concerts if only venue id passed.Harald Eilertsen2021-05-091-7/+12
| | | | | | | | | The previous changes required the full venue data to be included in the constructor. This patch ensures that we handle the old case, where only the venue id was passed in. We still should get the full concert object including the venue name and city back.
* Include info from venue in concerts.Harald Eilertsen2021-05-091-18/+25
| | | | | | | | | | | | | | | | | | | | This makes the concert a full object containing all relevant info, while we can still segment the data in the db. Instead of this: $concert = GiglogAdmin_Concert::get($concert_id); $venue = GiglogAdmin_Venue::get($concert->venue()); echo "{$concert->name()} @ {$venue->name()} : {$concert->cdate()}" You can now do: $concert = GiglogAdmin_Concert::get($concert_id); echo "{$concert->name()} @ {$concert->venue()->name()} : {$concert->cdate()}" And yeah, renamed Concert::find_cid() to Concert::get() and changed it's semantics somewhat. It now either returns the given concert if it exists, or NULL if it does not. Simpler function; simpler to use.
* Autofixes by PsalmHarald Eilertsen2021-05-081-1/+1
|
* Auto fixup missing return types by PsalmHarald Eilertsen2021-05-081-2/+5
|
* Added an uppercase in sql for venue and concert duplicate checkAndreaChirulescu2021-04-231-1/+1
| | | | Added test to create duplicate concert with varied cases in string
* Refactor Concert::createHarald Eilertsen2021-04-231-40/+27
| | | | | | | | | | Restructure the method a bit, drop the `c`prefix on variables, rename the variable to hold the created concert, and use object notation to pass the attributes to the constructor. Also rename the method `get` to `find`, the only call site was the `create` method. Drop the unnecessary method `check_duplicate`. Just use `find` instead.
* Concert::create return NULL if concert already exist.Harald Eilertsen2021-04-221-3/+5
| | | | | | We probably need some better error handling here. There's a myriad of reasons why this call could fail, and we might need to communicate the failure reason somewhere.
* Fix wrong property name in Concert::cname()Harald Eilertsen2021-04-221-1/+1
|
* Merge remote-tracking branch 'andrea/andreaschanges' into devHarald Eilertsen2021-04-221-16/+16
|\
| * Added column for concert title in databaseAndreaChirulescu2021-04-211-16/+16
| | | | | | | | Modified so that band is no longer in use
* | Typo in comment for Concert constructor.Harald Eilertsen2021-04-211-2/+2
|/
* Added form fields and functionality for admin to edit assigned usersAndreaChirulescu2021-04-191-0/+23
|
* Got rid of find or create for concert and bandAndreaChirulescu2021-04-141-37/+44
| | | | Refactored band
* Switch to Reuse for license handling.Harald Eilertsen2021-04-141-16/+5
| | | | Run `reuse lint` to verify that all material is licensed.
* Make Concert constructor public.Harald Eilertsen2021-04-141-4/+6
| | | | | Also allow it to default initialize when passing no args. Not entirely sure about making this interface public.
* Concert file wizardry to split create/createAndFind,Find functionsAndreaChirulescu2021-04-131-6/+40
| | | | Adjustments in admin page and import gigs to use the above adjustments
* Fixes of LF and extra spaces done by ATOMAndreaChirulescu2021-04-131-157/+157
|