Skip to content

Commit

Permalink
OParl: Add a link to people in paper object.
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdragon-001 committed Sep 20, 2022
1 parent 5a18735 commit 1c1ea89
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions protected/components/OParl10Object.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,20 +388,30 @@ private static function paper($id) {
$antrag = Antrag::model()->findByPk($id);

$data = [
'id' => OParl10Controller::getOparlObjectUrl('paper', $antrag->id),
'type' => self::TYPE_PAPER,
'body' => OParl10Controller::getOparlObjectUrl('body', ($antrag->ba_nr != null ? $antrag->ba_nr : 0)),
'name' => $antrag->getName(),
'reference' => $antrag->antrags_nr,
'paperType' => $antrag->getTypName(),
'auxiliaryFile' => [],
'underDirectionOf' => [OParl10Controller::getOparlObjectUrl('organization', $antrag->referat_id, 'referat')],
'keyword' => [],
'web' => SITE_BASE_URL . $antrag->getLink(),
'created' => OParl10Controller::mysqlToOparlDateTime($antrag->created),
'modified' => OParl10Controller::mysqlToOparlDateTime($antrag->modified),
'id' => OParl10Controller::getOparlObjectUrl('paper', $antrag->id),
'type' => self::TYPE_PAPER,
'body' => OParl10Controller::getOparlObjectUrl('body', ($antrag->ba_nr != null ? $antrag->ba_nr : 0)),
'name' => $antrag->getName(),
'reference' => $antrag->antrags_nr,
'paperType' => $antrag->getTypName(),
'auxiliaryFile' => [],
'originatorPerson' => [],
'underDirectionOf' => [OParl10Controller::getOparlObjectUrl('organization', $antrag->referat_id, 'referat')],
'keyword' => [],
'web' => SITE_BASE_URL . $antrag->getLink(),
'created' => OParl10Controller::mysqlToOparlDateTime($antrag->created),
'modified' => OParl10Controller::mysqlToOparlDateTime($antrag->modified),
];

foreach ($antrag->antraegePersonen as $ap) {
if ($ap->typ == AntragPerson::$TYP_GESTELLT_VON) {
// TODO this should not be a Person but an Organization ("Fraktion")
//$data['originatorOrganization'][] = OParl10Controller::getOparlObjectUrl('organization', $ap->person->id)
} else if ($ap->typ == AntragPerson::$TYP_INITIATORIN) {
$data['originatorPerson'][] = OParl10Controller::getOparlObjectUrl('person', $ap->person->id)
}
}

foreach ($antrag->dokumente as $dokument)
$data['auxiliaryFile'][] = self::file($dokument->id);

Expand Down

0 comments on commit 1c1ea89

Please sign in to comment.