<%args>
$id => undef
</%args>
<%init>
my $ticket = RT::Ticket->new($session{'CurrentUser'});
$ticket->Load($id);

ProcessObjectCustomFieldUpdates(Object => $ticket, ARGSRef => \%ARGS);


my $whiteboard = $ticket->QueueObj->CustomField('Whiteboard');

my $Values = $ticket->CustomFieldValues($whiteboard->Id);
my $comp = "/Elements/ShowCustomField".$whiteboard->Type;

</%init>

% if ($whiteboard->CurrentUserHasRight('ModifyCustomField')) {
<a align="right" valign="bottom" href="<%$RT::WebPath%>/Ticket/EditWhiteboard.html?id=<%$ticket->id%>" onClick="ahah('<%$RT::WebPath%>/Ticket/EditWhiteboard.html?id=<%$ticket->id%>', 'whiteboard'); return false;" >[<&|/l&>Edit</&>]</a>
<span id="showall" ><a href="#" onClick="var wb = document.getElementById('whiteboardinner'); 
    wb.style.overflow = 'visible';  
    wb.style.height = 'auto'; 
    document.getElementById('showsome').style.display='inline';  
    document.getElementById('showall').style.display='none'; 
    return false;" >[<&|/l&>Expand</&>]</a></span>
<span id="showsome" style="display: none;"><a href="#" onClick="var wb = document.getElementById('whiteboardinner'); 
    wb.style.overflow = 'hidden';  
    wb.style.height = '6em'; 
    document.getElementById('showall').style.display='inline';  
    document.getElementById('showsome').style.display='none'; 
    return false;" >[<&|/l&>Collapse</&>]</a></span>
%}
% if ($whiteboard->id) {
<div id="whiteboardinner" style="overflow: hidden; height: 6em;">
% while (my $Value = $Values->Next()) {
% if ($m->comp_exists($comp)) {
<& $comp, Object => $Value &>
% } else {
<% $Value->Content %>
% }
% }
% } else {
<&|/l&>No "Whiteboard" field for this ticket.</&>
% }
</div>
%$m->abort();
