Skip to content

Commit

Permalink
Merge pull request #6 from DreamSpawn/import-activity
Browse files Browse the repository at this point in the history
Import activity
  • Loading branch information
DreamSpawn authored Nov 24, 2019
2 parents 7ed1ce8 + 244eb4a commit 5efc19d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions include/controllers/activity_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,11 @@ private function saveActivities($data, $replace = false) {
$this->errorMessage('Kan ikke udskifte aktiviteter efter der er oprettet afviklinger');
} else {
$this->errorMessage('Kunne ikke importere aktiviteter.');
error_log($e->getMessage());
}
} catch (Exception $e) {
$this->errorMessage('Kunne ikke importere aktiviteter.');
error_log($e->getMessage());
}
}

Expand Down
4 changes: 2 additions & 2 deletions include/models/activity_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public static function parseActivityRow($row){
}

$result_row = [];
$result_row['id'] = $row[26];
$result_row['id'] = is_numeric($row[26]) ? intval($row[26]) : null;
$result_row['navn'] = $row[1];
$result_row['kan_tilmeldes'] = preg_match("/nej/", strtolower($row[24])) == 1 ? 'nej' : 'ja';;
$result_row['note'] = $row[22];
Expand All @@ -210,7 +210,7 @@ public static function parseActivityRow($row){
preg_match("/\d+/", $row[9], $matches);
$result_row['pris'] = isset($matches[0]) ? $matches[0] : 0;
$result_row['lokale_eksklusiv'] = preg_match("/nej/", strtolower($row[19])) == 1 ? 'nej' : 'ja';
$result_row['wp_link'] = $row[25];
$result_row['wp_link'] = is_numeric($row[26]) ? intval($row[26]) : 0;
$result_row['teaser_dk'] = $row[13];
$result_row['teaser_en'] = $row[14];
$result_row['title_en'] = $row[2];;
Expand Down

0 comments on commit 5efc19d

Please sign in to comment.