diff options
author | AndreaChirulescu <andrea.chirulescu@gmail.com> | 2021-04-12 23:34:32 +0200 |
---|---|---|
committer | AndreaChirulescu <andrea.chirulescu@gmail.com> | 2021-04-12 23:34:32 +0200 |
commit | 512511df29423fc943b566bc20d997cd20ee9e03 (patch) | |
tree | f5531d5ed96b965fb8d08ec4df74a61c9b0834b3 /includes/admin/views/giglog_import_gigs.php | |
parent | 58238e7325920be68f3468c81115c8ddcf01c2f4 (diff) | |
download | gigologadmin-512511df29423fc943b566bc20d997cd20ee9e03.tar.gz gigologadmin-512511df29423fc943b566bc20d997cd20ee9e03.tar.bz2 gigologadmin-512511df29423fc943b566bc20d997cd20ee9e03.zip |
Moved a lot of concert related logic from import/admin into the GiglogAdmin_Concert
Diffstat (limited to 'includes/admin/views/giglog_import_gigs.php')
-rw-r--r-- | includes/admin/views/giglog_import_gigs.php | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/includes/admin/views/giglog_import_gigs.php b/includes/admin/views/giglog_import_gigs.php index 04b2351..d0520e7 100644 --- a/includes/admin/views/giglog_import_gigs.php +++ b/includes/admin/views/giglog_import_gigs.php @@ -85,7 +85,7 @@ if ( !class_exists( 'GiglogAdmin_ImportGigsPage' ) ) { if (is_numeric($venue)) $newconcert[1] = $venue; else { - $v = GiglogAdmin_Venue::find_or_create($venue,'Oslo'); + $v = GiglogAdmin_Venue::find_or_create($venue,'Oslo'); //phase 666 of the project should maybe consider both city and band country when creating concerts/importing files $newconcert[1] = $v->id(); } @@ -98,22 +98,34 @@ if ( !class_exists( 'GiglogAdmin_ImportGigsPage' ) ) { . ', VENUE ' . $venue . ' with venue ID ' . $newconcert[1] . ', CONCERTDATE ' . $condate); } else { - $id = GiglogAdmin_Concert::create( + $id = GiglogAdmin_Concert::find_or_create( + '', $newconcert[0], $newconcert[1], $condate, $ticketlink, - $eventlink); - + $eventlink); + error_log( 'NEW CONCERT ADDED: ' - . ' ID: ' . $id + . ' ID: ' . $id->id() . ' BAND ' . $band . ' with band ID ' . $newconcert[0] . ', VENUE ' . $venue . ' with venue ID ' . $newconcert[1] . ', CONCERTDATE ' . $condate . ', Ticket LINK ' . $ticketlink . ', Event LINK ' . $eventlink); - GiglogAdmin_Concertlogs::add($id); + GiglogAdmin_Concertlogs::add($id->id()); + + /*the last line can be replaced by a trigger + CREATE TRIGGER `insertIntoPhotoLogs` AFTER INSERT ON `wpg_concerts` + FOR EACH ROW INSERT INTO wpg_concertlogs ( + wpg_concertlogs.id, + wpg_concertlogs.wpgcl_concertid, + wpg_concertlogs.wpgcl_status) + + VALUES + (null, new.id, 1) + */ } } } |