Link birth quick form to assets and logs created by it.

This commit is contained in:
Michael Stenta 2018-09-05 12:59:11 -04:00
parent 707295d2a8
commit 9895a39d89
1 changed files with 6 additions and 0 deletions

View File

@ -336,6 +336,9 @@ function farm_livestock_birth_form_submit($form, &$form_state) {
// Add it to the array.
$children[] = $child_asset;
// Link the asset to this quick form.
farm_quick_entity_link('farm_livestock_birth_form', 'farm_asset', $child_asset);
// Set a message.
$label = entity_label('farm_asset', $child_asset);
$uri = entity_uri('farm_asset', $child_asset);
@ -389,6 +392,9 @@ function farm_livestock_birth_form_submit($form, &$form_state) {
// Save the log.
$log_wrapper->save();
// Link the log to the quick form.
farm_quick_entity_link('farm_livestock_birth_form', 'log', $log);
// Set a message linking to the mother animal.
$label = entity_label('farm_asset', $parents['mother']);
$uri = entity_uri('farm_asset', $parents['mother']);