Hi there,
In case anyone would find this useful, this code displays the direct URL to the task in view, and a "copy" link which copies the path to the clipboard so it can be shared with other users (ie, pasted into an email)
Simply paste this code anywhere in application/views/task/task_list.php
<b>Task URL:</b>
<br>
<SCRIPT LANGUAGE="JavaScript">
function ClipBoard()
{
holdtext.innerText = copytext.innerText;
Copied = holdtext.createTextRange();
Copied.execCommand("RemoveFormat");
Copied.execCommand("Copy");
}
</SCRIPT>
<SPAN ID="copytext">
http://localhost/fengoffice/index.php?c=task&a=view_task&id=<?php echo ($task_list->getId()) ?>
</SPAN>
<TEXTAREA ID="holdtext" STYLE="display:none;">
</TEXTAREA>
<a href="#" onClick="ClipBoard();">(copy)</a>
Substitute "http://localhost/fengoffice" for the path you use to get to FengOffice
Ahh, thanks for pointing that out Murz.
I created a table and put the task Start/due dates on one side, and the URl on the other, right on top of the description, like this (See screenshot):
<table width=80%>
<tr>
<td>
<?php if ($task_list->getStartDate() instanceof DateTimeValue) { ?>
<?php if ($task_list->getStartDate()->getYear() > DateTimeValueLib::now()->getYear()) { ?>
<div class="startDate"><b><?php echo lang('start date') ?>: </b><?php echo format_date($task_list->getStartDate(), null, 0) ?></div>
<?php } else { ?>
<div class="startDate"><b><?php echo lang('start date') ?>: </b><?php echo format_descriptive_date($task_list->getStartDate(), 0) ?></div>
<?php } // if ?>
<?php } // if ?>
<?php if ($task_list->getDueDate() instanceof DateTimeValue) { ?>
<?php if ($task_list->getDueDate()->getYear() > DateTimeValueLib::now()->getYear()) { ?>
<div class="dueDate"><b><?php echo lang('due date') ?>: </b><?php echo format_date($task_list->getDueDate(), null, 0) ?></div>
<?php } else { ?>
<div class="dueDate"><b><?php echo lang('due date') ?>: </b><?php echo format_descriptive_date($task_list->getDueDate(), 0) ?></div>
<?php } // if ?>
<?php } // if ?>
</td>
<td>
<b>Task URL:</b>
<br>
<SCRIPT LANGUAGE="JavaScript">
function ClipBoard()
{
holdtext.innerText = copytext.innerText;
Copied = holdtext.createTextRange();
Copied.execCommand("RemoveFormat");
Copied.execCommand("Copy");
}
</SCRIPT>
<SPAN ID="copytext">
<?php echo($object->getViewUrl()) ?>
</SPAN>
<TEXTAREA ID="holdtext" STYLE="display:none;">
</TEXTAREA>
<a href="#" onClick="ClipBoard();">(copy)</a>
</td></tr></table>
<br>