Commit e0746f69 authored by arildb's avatar arildb

[FIX] Mail-in created pages are now linked to the correct structure node, i.e....

[FIX] Mail-in created pages are now linked to the correct structure node, i.e. page if specified, otherwise root.
[DOC] Some words about what "Structure routing" is on the admin tab
parent 878721b1
......@@ -93,11 +93,12 @@ class UserMailinLib extends TikiLib
function list_user_mailin_struct($user, $maxRecords = -1, $offset = 0)
{
$bindvars = array($user);
$query = "select mailin.*, p.pageName, s.page_ref_id, s.parent_id , p2.pageName as structName
from `tiki_user_mailin_struct` mailin
left outer join `tiki_pages` p on p.`page_id` = mailin.`page_id`
left outer join `tiki_structures` s on s.`structure_id` = mailin.`structure_id` and s.`parent_id` = 0
left outer join `tiki_pages` p2 on p2.`page_id` = s.`page_id`
$query = "select mailin.*, p.pageName, s2.page_ref_id as page_struct_refid, s2.parent_id as page_struct_parentid, s.page_ref_id, s.parent_id , p2.pageName as structName
from `tiki_user_mailin_struct` mailin
left outer join `tiki_pages` p on p.`page_id` = mailin.`page_id`
left outer join `tiki_structures` s on s.`structure_id` = mailin.`structure_id` and s.`parent_id` = 0
left outer join `tiki_pages` p2 on p2.`page_id` = s.`page_id`
left outer join `tiki_structures` s2 on s2.`structure_id` = mailin.`structure_id` and s2.`page_id` = mailin.`page_id`
where mailin.`username` = ? ";
$result = $this->query($query, $bindvars, $maxRecords, $offset);
......
......@@ -34,7 +34,8 @@ function confirm_delete()
{tabset name="user_mailin"}
{tab name="{tr}Structure Routing{/tr}"}
<p>
{tr}Structure routing will only affect newly created pages, using the mail-in wiki-put function.{/tr}
{tr}Structure routing will link mailed-in pages as a child to the specified structure node. Only email matching the filters are linked.{/tr}<br/>
{tr}Only newly created pages, using the mail-in wiki-put function, are affected.{/tr}
</p>
{if $prefs.feature_wiki_structure eq 'y'}
<form action="#" method="POST">
......
......@@ -664,7 +664,14 @@ foreach ($accs['data'] as $acc) {
// Check User structure routing
if (!empty($route)) {
// Structure routing is active. Create a structure node/page
$parent_id = $route['page_ref_id'];
// Use the page structure node, if specified, otherwise link to the rrot of the structure
if ($route['page_id'] > 0) {
$parent_id = $route['page_struct_refid']; // page_ref_id
} else {
$parent_id = $route['page_ref_id'];
}
$structure_id = $route['structure_id'];
$begin = true;
......
Markdown is supported
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