Commit f662c4af authored by Robert Lyon's avatar Robert Lyon
Browse files

Updating notes page to show current block title (Bug #1194255)



Currently the page only shows the original title of a text box
- If you copy a view and rename the title of the blockinstance
this info is not displayed in any way on the notes page

I have added a column to show what the current title of the text
box is for the particular view

Change-Id: I2779c7b69df982395816ccf89a83d35195525c86
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 8673f20f
......@@ -134,7 +134,8 @@ $string['Note'] = 'Note';
$string['Notes'] = 'Notes';
$string['mynotes'] = 'My notes';
$string['notesfor'] = "Notes for %s";
$string['containedin'] = "Contained in:";
$string['containedin'] = "Contained in";
$string['currenttitle'] = "Titled";
$string['notesdescription'] = 'These are the html notes you have created inside text box blocks on your pages.';
$string['editnote'] = 'Edit note';
$string['confirmdeletenote'] = 'This note is used in %d blocks and %d pages. If you delete it, all the blocks which currently contain the text will appear empty.';
......
......@@ -100,7 +100,8 @@ if ($data) {
JOIN {view_artefact} va ON bi.id = va.block
JOIN {view} v ON va.view = v.id
WHERE
va.artefact IN (' . join(',', array_fill(0, count($data), '?')) . ')',
va.artefact IN (' . join(',', array_fill(0, count($data), '?')) . ')
ORDER BY va.view, bi.title',
array_keys($data)
);
if ($blocks) {
......@@ -157,7 +158,8 @@ if ($data) {
$data[$b->artefact]->blocks = array();
}
if (!isset($data[$b->artefact]->blocks[$b->block])) {
$data[$b->artefact]->blocks[$b->block] = $b;
$data[$b->artefact]->blocks[$b->block] = (array)$b;
(!isset($data[$b->artefact]->views[$b->view]['extrablocks'])) ? $data[$b->artefact]->views[$b->view]['extrablocks'] = 0 : $data[$b->artefact]->views[$b->view]['extrablocks'] ++;
}
if (!isset($data[$b->artefact]->tags)) {
$data[$b->artefact]->tags = ArtefactType::artefact_get_tags($b->artefact);
......
......@@ -4,6 +4,7 @@
<thead>
<tr>
<th>{str tag=Note section=artefact.internal}</th>
<th>{str tag=currenttitle section=artefact.internal}</th>
<th>{str tag=containedin section=artefact.internal}</th>
<th class="center"><img src="{theme_url filename="images/icon_attachment.png"}" title="{str tag=Attachments section=artefact.resume}" /></th>
<th></th>
......@@ -44,11 +45,23 @@
{/if}
</td>
<td>
{foreach from=$n->blocks item=b}
<div>
{$b.blocktitle|str_shorten_text:30:true}
</div>
{/foreach}
</td>
<td>
{foreach from=$n->views item=v}
<div>
<a href="{$v.fullurl}">{$v.viewtitle|str_shorten_text:30:true}</a>
{if $v.ownername} - {str tag=by section=view} {if $v.ownerurl}<a href="{$v.ownerurl}">{/if}{$v.ownername}{if $v.ownerurl}</a>{/if}{/if}
</div>
{if $v.extrablocks}
{for i 1 $v.extrablocks}
<div>&nbsp;</div>
{/for}
{/if}
{/foreach}
</td>
<td align="center">{$n->count}</td>
......
......@@ -2246,9 +2246,6 @@ tr.incomplete td {
background: #FEE7E7;
}
/* Content > My notes */
#notes td.notetitle {
width: 60%;
}
#notes td.notetitle .detail iframe {
overflow-x: hidden;
width: 100%!important;
......
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