Commit 17cf75de authored by Richard Mansfield's avatar Richard Mansfield
Browse files

When copying profileinfo/contactinfo, set email to something sensible when...

When copying profileinfo/contactinfo, set email to something sensible when show email is set on the block being copied
parent 80c1d7bd
......@@ -156,6 +156,14 @@ class PluginBlocktypeContactinfo extends PluginBlocktype {
SELECT id FROM {artefact}
WHERE owner = ? AND artefacttype IN (' . join(',', array_map('db_quote', $artefacttypes)) . ')', array($view->get('owner')));
$configdata['artefactids'] = $artefactids;
if (isset($configdata['email'])) {
if ($newemail = get_field('artefact_internal_profile_email', 'artefact', 'principal', 1, 'owner', $view->get('owner'))) {
$configdata['email'] = $newemail;
}
else {
unset($configdata['email']);
}
}
}
else {
$configdata['artefactids'] = array();
......
......@@ -216,6 +216,14 @@ class PluginBlocktypeProfileinfo extends PluginBlocktype {
SELECT id FROM {artefact}
WHERE owner = ? AND artefacttype IN (' . join(',', array_map('db_quote', $artefacttypes)) . ')', array($view->get('owner')));
$configdata['artefactids'] = $artefactids;
if (isset($configdata['email'])) {
if ($newemail = get_field('artefact_internal_profile_email', 'artefact', 'principal', 1, 'owner', $view->get('owner'))) {
$configdata['email'] = $newemail;
}
else {
unset($configdata['email']);
}
}
}
else {
$configdata['artefactids'] = array();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment