-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Organize meeting data by event_id as well as date
This adds another level of organization to the meeting data feed. Meetings are now organized by date and event_id. Meetings that are not in Google Calendar will have an event_id of zero. This means if there are multiple meetings on the same day that are not in a calendar, they will still be lumped together. We do not have time information in the database for meetingFiles. However, for meetings that are in Google Calendar, we can display the start time of the event. Ultimately, we need to do a database schema change to change the meetingFiles.date column to be a datetime. Then we'll need to run through all the Google Calendar events and populate the datetime information. Until then, the only place we do not have the time information is on the MeetingFiles/Index controller. That is purely reading from the database. Updates #310
- Loading branch information
Showing
6 changed files
with
49 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,9 @@ | ||
<?php | ||
/** | ||
* @copyright 2017 City of Bloomington, Indiana | ||
* @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE.txt | ||
* @copyright 2017-2022 City of Bloomington, Indiana | ||
* @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE | ||
* @param Committee $htis->committee | ||
* @param array $this->meetings | ||
* @param int $this->year | ||
*/ | ||
use Application\Models\MeetingFile; | ||
|
||
use Web\Block; | ||
use Web\Url; | ||
|
||
|
||
$out = []; | ||
foreach ($this->meetings as $date=>$meeting) { | ||
|
||
$out[$date]['eventId' ] = !empty($meeting['eventId' ]) ? $meeting['eventId' ] : ''; | ||
$out[$date]['summary' ] = !empty($meeting['summary' ]) ? $meeting['summary' ] : ''; | ||
$out[$date]['location'] = !empty($meeting['location']) ? $meeting['location'] : ''; | ||
$out[$date]['start' ] = !empty($meeting['start' ]) ? $meeting['start' ] : ''; | ||
$out[$date]['end' ] = !empty($meeting['end' ]) ? $meeting['end' ] : ''; | ||
$out[$date]['htmlLink'] = !empty($meeting['htmlLink']) ? $meeting['htmlLink'] : ''; | ||
|
||
foreach (MeetingFile::$types as $type) { | ||
if (!empty( $meeting['files'][$type])) { | ||
foreach ($meeting['files'][$type] as $file) { | ||
$out[$date]['files'][$type][] = $file->getData(); | ||
} | ||
} | ||
} | ||
} | ||
echo json_encode($out, JSON_PRETTY_PRINT); | ||
echo json_encode($this->meetings, JSON_PRETTY_PRINT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters