<table width="100%" class="ticket-summary">
<tr>
  <td valign="top" class="boxcontainer">
% $m->callback( %ARGS, CallbackName => 'LeftColumnTop' );

%# Oeris::HideWidgets - Basics
% my $OerisHideWidgetBasics = 0;
% $OerisHideWidgetBasics = 1 if $session{'CurrentUser'}->HasRight(Object => $RT::System, Right => 'OerisHideWidgetBasics');
% my $groups = RT::Groups->new($session{'CurrentUser'});
% $groups->LimitToUserDefinedGroups;
% $groups->ForWhichCurrentUserHasRight(
%     Right             => 'OerisHideWidgetBasics',
%     IncludeSuperusers => 0,
% );
% $OerisHideWidgetBasics = 1 if $groups->Count;

% $RT::Logger->debug("Oeris::HideWidgets - Basics : Current User Has Right ? ".$OerisHideWidgetBasics);
% if ( !$OerisHideWidgetBasics ) {
    <&| /Widgets/TitleBox, title => loc('The Basics'),
        (($can_modify || $can_modify_cf) ? (title_href => RT->Config->Get('WebPath')."/Ticket/Modify.html?id=".$Ticket->Id) : ()),
        class => 'ticket-info-basics',
    &><& /Ticket/Elements/ShowBasics, Ticket => $Ticket &></&>
% }

    <& /Elements/ShowCustomFieldCustomGroupings,
        Object       => $Ticket,
        title_href   => ($can_modify || $can_modify_cf) ? RT->Config->Get('WebPath')."/Ticket/Modify.html" : "",
        &>

%# Oeris::HideWidgets - People
% my $OerisHideWidgetPeople = 0;
% $OerisHideWidgetPeople = 1 if $session{'CurrentUser'}->HasRight(Object => $RT::System, Right => 'OerisHideWidgetPeople');
% $groups = RT::Groups->new($session{'CurrentUser'});
% $groups->LimitToUserDefinedGroups;
% $groups->ForWhichCurrentUserHasRight(
%     Right             => 'OerisHideWidgetPeople',
%     IncludeSuperusers => 0,
% );
% $OerisHideWidgetPeople = 1 if $groups->Count;

% $RT::Logger->debug("Oeris::HideWidgets - People : Current User Has Right ? ".$OerisHideWidgetPeople);
% if ( !$OerisHideWidgetPeople ) {
    <&| /Widgets/TitleBox, title => loc('People'),
        (($can_modify || $can_modify_owner || $can_modify_people) ? (title_href => RT->Config->Get('WebPath')."/Ticket/ModifyPeople.html?id=".$Ticket->Id) : ()),
        class => 'ticket-info-people',
    &><& /Ticket/Elements/ShowPeople, Ticket => $Ticket &></&>
% }

%# Oeris::HideWidgets - Attachments
% my $OerisHideWidgetAttach = 0;
% $OerisHideWidgetAttach = 1 if $session{'CurrentUser'}->HasRight(Object => $RT::System, Right => 'OerisHideWidgetAttach');
% $groups = RT::Groups->new($session{'CurrentUser'});
% $groups->LimitToUserDefinedGroups;
% $groups->ForWhichCurrentUserHasRight(
%     Right             => 'OerisHideWidgetAttach',
%     IncludeSuperusers => 0,
% );
% $OerisHideWidgetAttach = 1 if $groups->Count;

% $RT::Logger->debug("Oeris::HideWidgets - Attachments : Current User Has Right ? ".$OerisHideWidgetAttach);
% if ( !$OerisHideWidgetAttach ) {
    <& /Ticket/Elements/ShowAttachments, Ticket => $Ticket, Attachments => $Attachments &>
% }
% $m->callback( %ARGS, CallbackName => 'AfterAttachments' );

%# Oeris::HideWidgets - Requestor
% my $OerisHideWidgetRequestor = 0;
% $OerisHideWidgetRequestor = 1 if $session{'CurrentUser'}->HasRight(Object => $RT::System, Right => 'OerisHideWidgetRequestor');
% $groups = RT::Groups->new($session{'CurrentUser'});
% $groups->LimitToUserDefinedGroups;
% $groups->ForWhichCurrentUserHasRight(
%     Right             => 'OerisHideWidgetRequestor',
%     IncludeSuperusers => 0,
% );
% $OerisHideWidgetRequestor = 1 if $groups->Count;

% $RT::Logger->debug("Oeris::HideWidgets - Requestor : Current User Has Right ? ".$OerisHideWidgetRequestor);
% if ( !$OerisHideWidgetRequestor ) {
    <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket &>
% }
% $m->callback( %ARGS, CallbackName => 'LeftColumn' );
  </td>
  <td valign="top" class="boxcontainer">
% $m->callback( %ARGS, CallbackName => 'RightColumnTop' );
%# Oeris::HideWidgets - Reminders
% my $OerisHideWidgetReminders = 0;
% $OerisHideWidgetReminders = 1 if $session{'CurrentUser'}->HasRight(Object => $RT::System, Right => 'OerisHideWidgetReminders');
% $groups = RT::Groups->new($session{'CurrentUser'});
% $groups->LimitToUserDefinedGroups;
% $groups->ForWhichCurrentUserHasRight(
%     Right             => 'OerisHideWidgetReminders',
%     IncludeSuperusers => 0,
% );
% $OerisHideWidgetReminders = 1 if $groups->Count;

% $RT::Logger->debug("Oeris::HideWidgets - Reminders : Current User Has Right ? ".$OerisHideWidgetReminders);
% if ( !$OerisHideWidgetReminders ) {
% if ( RT->Config->Get('EnableReminders') ) {
    <&|/Widgets/TitleBox, title => loc("Reminders"),
        title_href => RT->Config->Get('WebPath')."/Ticket/Reminders.html?id=".$Ticket->Id,
        class => 'ticket-info-reminders',
    &>
        <table><tr><td>
            <form action="<%RT->Config->Get('WebPath')%>/Ticket/Display.html" name="UpdateReminders" id="UpdateReminders" method="post">
                <& /Ticket/Elements/Reminders, Ticket => $Ticket, ShowCompleted => 0 &>
            </form>
        </td></tr></table>
    </&>
% }
% }

%# Oeris::HideWidgets - Dates
% my $OerisHideWidgetDates = 0;
% $OerisHideWidgetDates = 1 if $session{'CurrentUser'}->HasRight(Object => $RT::System, Right => 'OerisHideWidgetDates');
% $groups = RT::Groups->new($session{'CurrentUser'});
% $groups->LimitToUserDefinedGroups;
% $groups->ForWhichCurrentUserHasRight(
%     Right             => 'OerisHideWidgetDates',
%     IncludeSuperusers => 0,
% );
% $OerisHideWidgetDates = 1 if $groups->Count;

% $RT::Logger->debug("Oeris::HideWidgets - Dates : Current User Has Right ? ".$OerisHideWidgetDates);
% if ( !$OerisHideWidgetDates ) {
    <&| /Widgets/TitleBox, title => loc("Dates"),
        ($can_modify ? (title_href => RT->Config->Get('WebPath')."/Ticket/ModifyDates.html?id=".$Ticket->Id) : ()),
        class => 'ticket-info-dates',
    &><& /Ticket/Elements/ShowDates, Ticket => $Ticket &></&>
% }
% my (@extra);
% push @extra, titleright_raw => '<a href="'. RT->Config->Get('WebPath'). '/Ticket/Graphs/index.html?id='.$Ticket->id.'">'.loc('Graph').'</a>' unless RT->Config->Get('DisableGraphViz');
% $m->callback( %ARGS, CallbackName => 'LinksExtra', extra => \@extra );

%# Oeris::HideWidgets - Links
% my $OerisHideWidgetLinks = 0;
% $OerisHideWidgetLinks = 1 if $session{'CurrentUser'}->HasRight(Object => $RT::System, Right => 'OerisHideWidgetLinks');
% $groups = RT::Groups->new($session{'CurrentUser'});
% $groups->LimitToUserDefinedGroups;
% $groups->ForWhichCurrentUserHasRight(
%     Right             => 'OerisHideWidgetLinks',
%     IncludeSuperusers => 0,
% );
% $OerisHideWidgetLinks = 1 if $groups->Count;

% $RT::Logger->debug("Oeris::HideWidgets - Links : Current User Has Right ? ".$OerisHideWidgetLinks);
% if ( !$OerisHideWidgetLinks ) {
    <&| /Widgets/TitleBox, title => loc('Links'),
        ($can_modify ? (title_href => RT->Config->Get('WebPath')."/Ticket/ModifyLinks.html?id=".$Ticket->Id) : ()),
        class => 'ticket-info-links',
        @extra,
    &><& /Elements/ShowLinks, Object => $Ticket &></&>
% }
% $m->callback( %ARGS, CallbackName => 'RightColumn' );
  </td>
</tr>
</table>
<%ARGS>
$Ticket => undef
$Attachments => undef
</%ARGS>
<%INIT>
my $can_modify = $Ticket->CurrentUserHasRight('ModifyTicket');
my $can_modify_cf = $Ticket->CurrentUserHasRight('ModifyCustomField');
my $can_modify_owner = $Ticket->CurrentUserCanSetOwner();
my $can_modify_people = $Ticket->CurrentUserHasRight('Watch')
                     || $Ticket->CurrentUserHasRight('WatchAsAdminCc');
</%INIT>
