Skip to content

Commit

Permalink
add item_type color as bg color to scheduler events. Fix #1672
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasCARPi committed Dec 15, 2019
1 parent 8d84b33 commit aa7f5b8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/models/Scheduler.php
Expand Up @@ -77,9 +77,11 @@ public function readAllFromTeam(): array
// the title of the event is title + Firstname Lastname of the user who booked it
$sql = "SELECT team_events.title, team_events.id, team_events.start, team_events.end, team_events.userid,
CONCAT('[', items.title, '] ', team_events.title, ' (', u.firstname, ' ', u.lastname, ')') AS title,
items.title AS item_title
items.title AS item_title,
CONCAT('#', items_types.color) AS color
FROM team_events
LEFT JOIN items ON team_events.item = items.id
LEFT JOIN items_types ON items.category = items_types.id
LEFT JOIN users AS u ON team_events.userid = u.userid
WHERE team_events.team = :team";
$req = $this->Db->prepare($sql);
Expand All @@ -104,9 +106,12 @@ public function read(): array
{
// the title of the event is title + Firstname Lastname of the user who booked it
$sql = "SELECT team_events.*,
CONCAT(team_events.title, ' (', u.firstname, ' ', u.lastname, ') ', COALESCE(experiments.title, '')) AS title
CONCAT(team_events.title, ' (', u.firstname, ' ', u.lastname, ') ', COALESCE(experiments.title, '')) AS title,
CONCAT('#', items_types.color) AS color
FROM team_events
LEFT JOIN items ON team_events.item = items.id
LEFT JOIN experiments ON (experiments.id = team_events.experiment)
LEFT JOIN items_types ON items.category = items_types.id
LEFT JOIN users AS u ON team_events.userid = u.userid
WHERE team_events.team = :team AND team_events.item = :item";
$req = $this->Db->prepare($sql);
Expand Down

0 comments on commit aa7f5b8

Please sign in to comment.