-
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?
OParl: Add a links to originator in paper object. #161
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.
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
zeile_anzeigen($personen[AntragPerson::$TYP_GESTELLT_VON], "Gestellt von:", "gestellt_von", function ($person) use ($antrag) { | |
/** @var Person $person */ | |
if ($person->stadtraetIn) { | |
echo CHtml::link($person->stadtraetIn->name, $person->stadtraetIn->getLink()); | |
echo " (" . CHtml::encode($person->ratePartei($antrag->gestellt_am)) . ")"; | |
} else { | |
echo CHtml::encode($person->name); | |
} | |
}); |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is $ap->person-id
the right property or do we want to use $ap->person->stadtraetIn->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.
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.
Choose a reason for hiding this comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
@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