-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OParl: Add a links to originator in paper object. #161
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -388,20 +388,33 @@ 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' => [], | ||
'originatorOrganization' => [], | ||
'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) { | ||
$organization = Gremium::model()->findByName($ap->person->name); | ||
if ($organization) { | ||
$data['originatorOrganization'][] = OParl10Controller::getOparlObjectUrl('organization', $organization->id) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mind the trailing semicolon at the end of the line is (unfortunately) not optional here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @CatoTH Also I missed the necessary sub-id |
||
} | ||
} else if ($ap->typ == AntragPerson::$TYP_INITIATORIN) { | ||
$data['originatorPerson'][] = OParl10Controller::getOparlObjectUrl('person', $ap->person->id) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The latter is probably more relevant, as that is the ID used by the original RIS (the number in the URL https://www.muenchen-transparent.de/personen/5963817_Andreas+Schuster) |
||
} | ||
} | ||
|
||
foreach ($antrag->dokumente as $dokument) | ||
$data['auxiliaryFile'][] = self::file($dokument->id); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does a
findByName()
method exist in the model?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No that might be rather
->findByAttributes(["name" => ...])
. Though sure you want to find a "Gremium" by a person's name? Which information (in the UI) do you actually want to retrieve?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the UI (e.g. here) the field "Gestellt von" which seems to be rendered by
muenchen-transparent/protected/views/antraege/anzeige.php
Lines 167 to 175 in 25e1a32
If you could fix the data model / parser, this would of course be preferable.