OParl: Add a links to originator in paper object.#161
OParl: Add a links to originator in paper object.#161darkdragon-001 wants to merge 2 commits intocodeformunich:mainfrom
Conversation
1c1ea89 to
1ac80bb
Compare
|
|
||
| foreach ($antrag->antraegePersonen as $ap) { | ||
| if ($ap->typ == AntragPerson::$TYP_GESTELLT_VON) { | ||
| $organization = Gremium::model()->findByName($ap->person->name); |
There was a problem hiding this comment.
Does a findByName() method exist in the model?
There was a problem hiding this comment.
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.
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.
| $data['originatorOrganization'][] = OParl10Controller::getOparlObjectUrl('organization', $organization->id) | ||
| } | ||
| } else if ($ap->typ == AntragPerson::$TYP_INITIATORIN) { | ||
| $data['originatorPerson'][] = OParl10Controller::getOparlObjectUrl('person', $ap->person->id) |
There was a problem hiding this comment.
Is $ap->person-id the right property or do we want to use $ap->person->stadtraetIn->id?
There was a problem hiding this comment.
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)
| 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.
Mind the trailing semicolon at the end of the line is (unfortunately) not optional here
There was a problem hiding this comment.
@CatoTH Also I missed the necessary sub-id fraktion for organizations.
I don't know how to test this, but it should work something like this.
Fixes #160