summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | Render adminactions in concert list view.Harald Eilertsen2021-09-031-9/+9
| | | | | | | | | | | | | | | | | | | | Clicking the buttons don't work quite yet.
* | | | | Redo concert list to use the Concert class.Harald Eilertsen2021-09-031-38/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of directly accessing the database with a custom query, we now just use the Concert::find_concerts method to fetch the concerts that are to be displayed. This became much easier now that we don't rely on the extra concertlogs table. There's still stuff missing to be functionally equivalent to the old code, but this should be a lot easier to get in place now.
* | | | | emove dependency on ConcertLogs in gig import code.Harald Eilertsen2021-09-032-13/+0
| | | | |
* | | | | Allow empty concerts to be created.Harald Eilertsen2021-09-031-5/+5
| | | | |
* | | | | Make name and city required attributes for Venues.Harald Eilertsen2021-09-021-6/+21
| | | | | | | | | | | | | | | | | | | | It does not make sense to have anonymous venues nowhere.
* | | | | Fix more type issues in Concert and Venue classesHarald Eilertsen2021-09-022-6/+6
| | | | |
* | | | | 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.
* | | | | psalm: Ad types to attrs and constructor for VenueHarald Eilertsen2021-09-021-6/+6
| | | | |
* | | | | psalm: No need for null $opts param in select_field.Harald Eilertsen2021-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | It's initialized to an empty array if not specified, that should be good enough, and don't trip up iterating over it.
* | | | | Fix saving and fetching roles from Concerts table.Harald Eilertsen2021-09-012-41/+24
| | | | |
* | | | | Begin move roles and status field to concerts table.Harald Eilertsen2021-06-274-0/+43
| | | | |
* | | | | Remove Band class and tests.Harald Eilertsen2021-06-272-220/+0
| | | | |
* | | | | Remove some debug output.Harald Eilertsen2021-06-271-1/+0
| | | | |
* | | | | Refactor ConcertTest some more.Harald Eilertsen2021-06-271-58/+25
| | | | | | | | | | | | | | | | | | | | | | | | | Create more of the concerts used by tests into the wpSetupBeforeClass hook.
* | | | | Refactor ConcertTests and some cleanupHarald Eilertsen2021-06-271-68/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit changes the way we populate the database for the tests by creating more entries up front. This reduces the amount of duplicated code between the tests, but also introduce some challenges. As modifications to the database done in the wpSetUpBeforeClass hook are not cleaned up automatically by the WP_PHPUnit framework, we also have to add a wpTearDownAfterClass hook so anything we set up in this class does not disturb any other tests in other classes.
* | | | | Clean tests env before running testsHarald Eilertsen2021-06-272-0/+2
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | Since we're using our own database tables, these are not cleaned by the default WP_PHPUnit setup. To ensure that we start on a clean slate when running the tests, clean the env before the tests are run.
* | | | Begin move roles and status field to concerts table.Harald Eilertsen2021-06-143-13/+97
| | | | | | | | | | | | | | | | 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-133-24/+23
| | | |
* | | | Streamline Concert api.Harald Eilertsen2021-06-122-22/+29
| | | | | | | | | | | | | | | | | | | | Reduce to one find_concerts function taking a filter to limit the selection.
* | | | Fix misc Psalm issues.Harald Eilertsen2021-06-125-4/+8
| | | |
* | | | Drop obsolete line from AdminPage::get_concerts.Harald Eilertsen2021-06-121-1/+0
| | | | | | | | | | | | | | | | This must have been forgotten in the previous commit.
* | | | Get current users username in AdminPage constructor.Harald Eilertsen2021-05-291-19/+9
| | | |
* | | | Make AdminPage a proper object.Harald Eilertsen2021-05-291-23/+34
| | | |
* | | | Refactor and reformat AdminPage::returnuser.Harald Eilertsen2021-05-261-18/+31
| | | | | | | | | | | | | | | | | | | | Now use a Concertlog object to render the correct subform instead of messing with the db directly.
* | | | Add instance methods to Concertlogs.Harald Eilertsen2021-05-261-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | This allows us to instantiate a Concertlogs objects just as with Concert and Venue objects. Also add a few instance methods to get the assigned user for a given role, and get the role assigned to a given user.
* | | | Use select_field in AdminPage::get_userHarald Eilertsen2021-05-251-15/+4
| | | |
* | | | Remove debug log from concertlogsHarald Eilertsen2021-05-251-1/+0
| | | |
* | | | Simplify AdminPage::get_userHarald Eilertsen2021-05-251-14/+5
| | | | | | | | | | | | | | | | | | | | Now queries the user from the concertlogs table instead of going by generating a form that is thrown away.
* | | | Add method to get assigned user for concertlogsHarald Eilertsen2021-05-251-0/+20
| | | |
* | | | Refactor the AdminPage::get_user method.Harald Eilertsen2021-05-251-11/+23
| | | | | | | | | | | | | | | | No functional change, just trying to make sense of it.
* | | | Use select_field in adminactions form.Harald Eilertsen2021-05-252-11/+17
| | | | | | | | | | | | | | | | | | | | Also add a `get_status` method to the Concertlogs class, returning the press status for a given concert_id.
* | | | Use select_field helper for city/venue filter.Harald Eilertsen2021-05-251-33/+16
| | | |
* | | | Use select_field for venue selector in new/edit formHarald Eilertsen2021-05-241-13/+4
| | | |
* | | | Allow custom text for no selection in select_fields.Harald Eilertsen2021-05-242-2/+25
| | | |
* | | | Add function to generate selection boxes.Harald Eilertsen2021-05-243-0/+80
| | | |
* | | | Make it possible to list all concerts.Harald Eilertsen2021-05-102-3/+29
| |_|/ |/| |
* | | Method to find concerts at given venueHarald Eilertsen2021-05-092-0/+54
| | |
* | | Method to find concerts for a given city.Harald Eilertsen2021-05-092-0/+56
| |/ |/|
* | Fix importing gigs after changes to the concert class.Harald Eilertsen2021-05-091-20/+10
| |
* | 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.
* | New method Venue::get to get venue by idHarald Eilertsen2021-05-091-0/+16
| |
* | Rename strangely named function.Harald Eilertsen2021-05-091-2/+2
| | | | | | | | | | | | GoglogAdmin_AdminPage::get_allvenues did not get all venues, but presented a selection control for selecting a venue. Renamed it as get_venue_selector instead.
* | Include info from venue in concerts.Harald Eilertsen2021-05-093-24/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Make venue constructor public.Harald Eilertsen2021-05-091-1/+1
| |
* | Merge remote-tracking branch 'andrea/andreaschanges' into devHarald Eilertsen2021-05-091-7/+8
|\|
| * Fixed venue by city filter. With a small exception: cna't get it to select ↵AndreaChirulescu2021-05-041-10/+11
| | | | | | | | in dropdown
* | Venue::venues_in_city wrong type annotationHarald Eilertsen2021-05-081-1/+1
| |
* | Add config for Psalm as well...Harald Eilertsen2021-05-081-0/+28
| |
* | Merge branch 'psalm' into devHarald Eilertsen2021-05-0818-64/+2274
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | This brings another tool in to help us keep the code in order - Psalm. (I thought the name was fitting! :) This will do fairly simple static analysis of the code, and report problems and suggest fixes. It can help fix some issues itself, but please double check that it does the right thing. More info: https://psalm.dev This merge also brings in fixes that was suggested by Paslm. Mostly this is typa annotations for functions, but also some bugfixes discovered by the tool.