diff --git a/assets/default/css/theme.css b/assets/default/css/theme.css index 5b98eaee93d60bc9f6732c12cd2e3e39d24ca10d..73a76e4aa4e4089bda6264ea9d4fd07ab65448cc 100644 --- a/assets/default/css/theme.css +++ b/assets/default/css/theme.css @@ -794,6 +794,7 @@ label.required, span.required { border: 1px solid #aaa; border-left: none; border-bottom: none; + table-layout: fixed; } #ticketTable caption { padding: 5px; @@ -811,12 +812,13 @@ label.required, span.required { border: 1px solid #aaa; border-right: none; border-top: none; + padding: 0 5px; } #ticketTable th a { color: #000; } #ticketTable td { - padding: 2px; + padding: 3px 5px; border: 1px solid #aaa; border-right: none; border-top: none; @@ -1037,3 +1039,11 @@ img.sign-in-image { margin: 0 1%; vertical-align: top; } +.truncate { + display: inline-block; + width: auto; + max-width: 100%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} diff --git a/include/client/tickets.inc.php b/include/client/tickets.inc.php index 76412f7e3b49e8921a432cc4f65369fcb46d1007..58d056a1786b624bb3ea0e63e5c10ae62cc24d80 100644 --- a/include/client/tickets.inc.php +++ b/include/client/tickets.inc.php @@ -141,9 +141,9 @@ $tickets->values( $dept = $T['dept__ispublic'] ? Dept::getLocalById($T['dept_id'], 'name', $T['dept__name']) : $defaultDept; - $subject = Format::truncate($subject_field->display( + $subject = $subject_field->display( $subject_field->to_php($T['cdata__subject']) ?: $T['cdata__subject'] - ), 40); + ); $status = TicketStatus::getLocalById($T['status_id'], 'value', $T['status__name']); if (false) // XXX: Reimplement attachment count support $subject.=' <span class="Icon file"></span>'; @@ -162,9 +162,9 @@ $tickets->values( <td> <?php echo Format::date($T['created']); ?></td> <td> <?php echo $status; ?></td> <td> - <a href="tickets.php?id=<?php echo $T['ticket_id']; ?>"><?php echo $subject; ?></a> + <a class="truncate" href="tickets.php?id=<?php echo $T['ticket_id']; ?>"><?php echo $subject; ?></a> </td> - <td> <?php echo Format::truncate($dept,30); ?></td> + <td> <span class="truncate"><?php echo $dept; ?></span></td> </tr> <?php } diff --git a/include/staff/templates/tickets.tmpl.php b/include/staff/templates/tickets.tmpl.php index ce48d471b659a6ae2b0cb2fb95bc9a646bd90066..e70d3e29cd537338d5feb20b6f5f070acdf60de9 100644 --- a/include/staff/templates/tickets.tmpl.php +++ b/include/staff/templates/tickets.tmpl.php @@ -85,7 +85,7 @@ if ($results) { ?> <?php csrf_token(); ?> <input type="hidden" name="a" value="mass_process" > <input type="hidden" name="do" id="action" value="" > - <table class="list" border="0" cellspacing="1" cellpadding="2" width="940"> + <table class="list fixed" border="0" cellspacing="1" cellpadding="2" width="940"> <thead> <tr> <?php @@ -99,11 +99,11 @@ if ($results) { ?> <th width="300"><?php echo __('Subject'); ?></th> <?php if ($user) { ?> - <th width="200"><?php echo __('Department'); ?></th> - <th width="200"><?php echo __('Assignee'); ?></th> + <th width="100"><?php echo __('Department'); ?></th> + <th width="100"><?php echo __('Assignee'); ?></th> <?php } else { ?> - <th width="400"><?php echo __('User'); ?></th> + <th width="200"><?php echo __('User'); ?></th> <?php } ?> </tr> @@ -119,15 +119,15 @@ if ($results) { ?> $assigned=''; if ($row['staff_id']) - $assigned=sprintf('<span class="Icon staffAssigned">%s</span>',Format::truncate($row['staff'],40)); + $assigned=sprintf('<span class="truncate Icon staffAssigned">%s</span>',$row['staff']); elseif ($row['team_id']) - $assigned=sprintf('<span class="Icon teamAssigned">%s</span>',Format::truncate($row['team'],40)); + $assigned=sprintf('<span class="truncate Icon teamAssigned">%s</span>',$row['team']); else $assigned=' '; $status = ucfirst($row['status']); $tid=$row['number']; - $subject = Format::htmlchars(Format::truncate($row['subject'],40)); + $subject = Format::htmlchars($row['subject']); $threadcount=$row['thread_count']; ?> <tr id="<?php echo $row['ticket_id']; ?>"> @@ -147,7 +147,8 @@ if ($results) { ?> data-preview="#tickets/<?php echo $row['ticket_id']; ?>/preview"><?php echo $tid; ?></a></td> <td align="center" nowrap><?php echo Format::datetime($row['effective_date']); ?></td> <td><?php echo $status; ?></td> - <td><a <?php if ($flag) { ?> class="Icon <?php echo $flag; ?>Ticket" title="<?php echo ucfirst($flag); ?> Ticket" <?php } ?> + <td><a class="truncate <?php if ($flag) { ?> Icon <?php echo $flag; ?>Ticket" title="<?php echo ucfirst($flag); ?> Ticket<?php } ?>" + style="max-width: 80%; max-width: calc(100% - 86px);" href="tickets.php?id=<?php echo $row['ticket_id']; ?>"><?php echo $subject; ?></a> <?php if ($threadcount>1) @@ -161,7 +162,7 @@ if ($results) { ?> </td> <?php if ($user) { ?> - <td><?php echo Format::truncate($row['department'], 40); ?></td> + <td><span class="truncate"><?php echo $row['department']; ?></td> <td> <?php echo $assigned; ?></td> <?php } else { ?> diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php index 0560eaf00ce70eacee1048f45dd9903a13368843..d16b43523050e3a12e75f73b472954880c42e209 100644 --- a/include/staff/ticket-view.inc.php +++ b/include/staff/ticket-view.inc.php @@ -403,8 +403,8 @@ $tcount = $ticket->getThreadEntries($types)->count(); <span class="pull-left"> <span style="display:inline-block"><?php echo Format::datetime($entry->created);?></span> - <span style="display:inline-block;padding:0 1em" class="faded title"><?php - echo Format::truncate($entry->title, 100); ?></span> + <span style="display:inline-block;padding:0 1em;max-width: 500px" class="faded title truncate"><?php + echo $entry->title; ?></span> </span> <div class="pull-right"> <?php if ($entry->hasActions()) { diff --git a/include/staff/tickets.inc.php b/include/staff/tickets.inc.php index 9f74d1cb1e56af233bda2eb89cbd8ac34af26728..0e1b346415c42707295a14928c995e5da4a5e8c3 100644 --- a/include/staff/tickets.inc.php +++ b/include/staff/tickets.inc.php @@ -223,15 +223,15 @@ $_SESSION[':Q:tickets'] = $tickets; <input type="hidden" name="do" id="action" value="" > <input type="hidden" name="status" value="<?php echo Format::htmlchars($_REQUEST['status'], true); ?>" > - <table class="list" border="0" cellspacing="1" cellpadding="2" width="940"> + <table class="list fixed" border="0" cellspacing="1" cellpadding="2" width="940"> <thead> <tr> <?php if ($thisstaff->canManageTickets()) { ?> - <th width="8px"> </th> + <th width="12px"> </th> <?php } ?> <th width="70"> <?php echo __('Ticket'); ?></th> - <th width="70"> + <th width="100"> <?php echo $date_header ?: __('Date'); ?></th> <th width="280"> <?php echo __('Subject'); ?></th> @@ -287,17 +287,17 @@ $_SESSION[':Q:tickets'] = $tickets; $dept = Dept::getLocalById($T['dept_id'], 'name', $T['dept__name']); if($showassigned) { if($T['staff_id']) - $lc=sprintf('<span class="Icon staffAssigned">%s</span>',Format::truncate((string) new PersonsName($T['staff__firstname'], $T['staff__lastname']),40)); + $lc=sprintf('<span class="Icon staffAssigned truncate">%s</span>',(string) new PersonsName($T['staff__firstname'], $T['staff__lastname'])); elseif($T['team_id']) $lc=sprintf('<span class="Icon teamAssigned">%s</span>', - Format::truncate(Team::getLocalById($T['team_id'], 'name', $T['team__name']),40)); + Team::getLocalById($T['team_id'], 'name', $T['team__name'])); else $lc=' '; }else{ - $lc=Format::truncate($dept,40); + $lc='<span class="truncate">'.Format::htmlchars($dept).'</span>'; } $tid=$T['number']; - $subject = Format::truncate($subject_field->display($subject_field->to_php($T['cdata__subject'])),40); + $subject = $subject_field->display($subject_field->to_php($T['cdata__subject'])); $threadcount=$T['thread_count']; if(!strcasecmp($T['status__state'],'open') && !$T['isanswered'] && !$T['lock__staff_id']) { $tid=sprintf('<b>%s</b>',$tid); @@ -323,7 +323,9 @@ $_SESSION[':Q:tickets'] = $tickets; ><?php echo $tid; ?></a></td> <td align="center" nowrap><?php echo Format::datetime($T[$date_col ?: 'lastupdate']); ?></td> <td><a <?php if ($flag) { ?> class="Icon <?php echo $flag; ?>Ticket" title="<?php echo ucfirst($flag); ?> Ticket" <?php } ?> - href="tickets.php?id=<?php echo $T['ticket_id']; ?>"><?php echo $subject; ?></a> + style="max-width: 80%; max-width: calc(100% - 86px);" + href="tickets.php?id=<?php echo $T['ticket_id']; ?>"><span + class="truncate"><?php echo $subject; ?></span></a> <?php if ($threadcount>1) echo "<small>($threadcount)</small> ".'<i @@ -334,8 +336,10 @@ $_SESSION[':Q:tickets'] = $tickets; echo '<i class="icon-fixed-width icon-paperclip"></i> '; ?> </td> - <td nowrap> <?php $un = new PersonsName($T['user__name']); echo Format::htmlchars( - Format::truncate($un, 22, strpos($un, '@'))); ?> </td> + <td nowrap><span class="truncate"><?php + $un = new PersonsName($T['user__name']); + echo Format::htmlchars($un); + ?></td> <?php if($search && !$status){ $displaystatus=TicketStatus::getLocalById($T['status_id'], 'value', $T['status__name']); diff --git a/scp/css/scp.css b/scp/css/scp.css index e687b82be86bc6700eb385246ce3f4118a182caa..68188bee7044962c36c077f62de59da1250092e1 100644 --- a/scp/css/scp.css +++ b/scp/css/scp.css @@ -641,19 +641,18 @@ a.print { table.fixed { table-layout: fixed; - border-collapse: collapse; width: 100%; } -table.fixed > thead > tr > th, -table.fixed > thead > tr > td, -table.fixed > tbody > tr > td, -table.fixed > tr > td { +table.fixed > thead > tr > th:not([width]), +table.fixed > thead > tr > td:not([width]), +table.fixed > tbody > tr > td:not([width]), +table.fixed > tr > td:not([width]) { width: 180px; } -table.fixed > thead > tr > th + th, -table.fixed > thead > tr > td + td, -table.fixed > tbody > tr > td + td, -table.fixed > tr > td + td { +table.fixed > thead > tr > th + th:not([width]), +table.fixed > thead > tr > td + td:not([width]), +table.fixed > tbody > tr > td + td:not([width]), +table.fixed > tr > td + td:not([width]) { width: auto; } @@ -2084,6 +2083,8 @@ button a:hover { } .truncate { width: auto; + display: inline-block; + max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;