diff --git a/assets/default/css/theme.css b/assets/default/css/theme.css index e50724e19283d088aceb3acfd64cf4feb51acc8a..ebc3ca69bce36037b444a304597575f4a7d202cc 100644 --- a/assets/default/css/theme.css +++ b/assets/default/css/theme.css @@ -749,6 +749,7 @@ label.required { border: 1px solid #aaa; border-left: none; border-bottom: none; + table-layout: fixed; } #ticketTable caption { padding: 5px; @@ -766,12 +767,13 @@ label.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; @@ -935,3 +937,11 @@ img.sign-in-image { .flush-left { text-align: left; } +.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 6b8e9df1af38ee40b56dcc831ad260c156d5e235..190cefa8e56a0840cbb87ce7e871cb7ef18d2b67 100644 --- a/include/client/tickets.inc.php +++ b/include/client/tickets.inc.php @@ -162,9 +162,9 @@ $negorder=$order=='DESC'?'ASC':'DESC'; //Negate the sorting $defaultDept=Dept::getDefaultDeptName(); //Default public dept. while ($row = db_fetch_array($res)) { $dept= $row['ispublic']? $row['dept_name'] : $defaultDept; - $subject = Format::truncate($subject_field->display( + $subject = $subject_field->display( $subject_field->to_php($row['subject']) ?: $row['subject'] - ), 40); + ); if($row['attachments']) $subject.=' <span class="Icon file"></span>'; @@ -182,9 +182,9 @@ $negorder=$order=='DESC'?'ASC':'DESC'; //Negate the sorting <td> <?php echo Format::db_date($row['created']); ?></td> <td> <?php echo $row['status']; ?></td> <td> - <a href="tickets.php?id=<?php echo $row['ticket_id']; ?>"><?php echo $subject; ?></a> + <a class="truncate" href="tickets.php?id=<?php echo $row['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 ea0aae0b7e3b28be02252f2d245100b4b73cbddc..d56bc5c70709c4c2762e593f510a520fcfe41702 100644 --- a/include/staff/templates/tickets.tmpl.php +++ b/include/staff/templates/tickets.tmpl.php @@ -116,15 +116,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']; ?>"> @@ -142,7 +142,8 @@ if ($results) { ?> href="tickets.php?id=<?php echo $row['ticket_id']; ?>"><?php echo $tid; ?></a></td> <td align="center" nowrap><?php echo Format::db_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) @@ -156,7 +157,7 @@ if ($results) { ?> </td> <?php if ($user) { ?> - <td><?php echo Format::truncate($row['dept_name'], 40); ?></td> + <td><span class="truncate"><?php echo $row['dept_name']; ?></span></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 078af3a0a268bf45bed22653fcbecfdaef703ba2..83a425dbfa5f99caa8af736e7daf4a486e2c6920 100644 --- a/include/staff/ticket-view.inc.php +++ b/include/staff/ticket-view.inc.php @@ -392,8 +392,8 @@ $tcount+= $ticket->getNumNotes(); <span class="pull-left"> <span style="display:inline-block"><?php echo Format::db_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="padding:0 1em; max-width: 500px" class="faded title truncate"><?php + echo $entry['title']; ?></span> </span> <span class="pull-right" style="white-space:no-wrap;display:inline-block"> <span style="vertical-align:middle;" class="textra"></span> diff --git a/include/staff/tickets.inc.php b/include/staff/tickets.inc.php index 70acec9195642decac3530a7be2267fb00a176b2..a1eb406fcd1818b3071027697f121e37bd16f139 100644 --- a/include/staff/tickets.inc.php +++ b/include/staff/tickets.inc.php @@ -352,11 +352,11 @@ if ($results) { <input type="hidden" name="a" value="mass_process" > <input type="hidden" name="do" id="action" value="" > <input type="hidden" name="status" value="<?php echo Format::htmlchars($_REQUEST['status']); ?>" > - <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="12"> </th> <?php } ?> <th width="70"> <a <?php echo $id_sort; ?> href="tickets.php?sort=ID&order=<?php echo $negorder; ?><?php echo $qstr; ?>" @@ -423,19 +423,19 @@ if ($results) { $lc=''; if($showassigned) { if($row['staff_id']) - $lc=sprintf('<span class="Icon staffAssigned">%s</span>',Format::truncate($row['staff'],40)); + $lc=sprintf('<span class="truncate Icon staffAssigned">%s</span>',$row['staff'],40); elseif($row['team_id']) - $lc=sprintf('<span class="Icon teamAssigned">%s</span>',Format::truncate($row['team'],40)); + $lc=sprintf('<span class="truncate Icon teamAssigned">%s</span>',$row['team'],40); else $lc=' '; }else{ - $lc=Format::truncate($row['dept_name'],40); + $lc=$row['dept_name']; } $tid=$row['number']; - $subject = Format::truncate($subject_field->display( + $subject = $subject_field->display( $subject_field->to_php($row['subject']) ?: $row['subject'] - ), 40); + ); $threadcount=$row['thread_count']; if(!strcasecmp($row['state'],'open') && !$row['isanswered'] && !$row['lock_id']) { $tid=sprintf('<b>%s</b>',$tid); @@ -458,7 +458,9 @@ if ($results) { href="tickets.php?id=<?php echo $row['ticket_id']; ?>"><?php echo $tid; ?></a></td> <td align="center" nowrap><?php echo Format::db_datetime($row['effective_date']); ?></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 $row['ticket_id']; ?>"><?php echo $subject; ?></a> + style="max-width: 80%; max-width: calc(100% - 86px);" + href="tickets.php?id=<?php echo $row['ticket_id']; ?>"><span class="truncate" + ><?php echo $subject; ?></span></a> <?php if ($threadcount>1) echo "<small>($threadcount)</small> ".'<i @@ -469,8 +471,7 @@ if ($results) { echo '<i class="icon-fixed-width icon-paperclip"></i> '; ?> </td> - <td nowrap> <?php echo Format::htmlchars( - Format::truncate($row['name'], 22, strpos($row['name'], '@'))); ?> </td> + <td nowrap><span class="truncate"><?php echo Format::htmlchars($row['name']); ?></span></td> <?php if($search && !$status){ $displaystatus=ucfirst($row['status']); diff --git a/scp/css/scp.css b/scp/css/scp.css index 2fe63818d17da1f6514482d6b93a69b27c96791b..eb132a809949b280874aaddd829e9244d114bb97 100644 --- a/scp/css/scp.css +++ b/scp/css/scp.css @@ -1956,3 +1956,11 @@ table.custom-info td { .required { font-weight: bold; } +.truncate { + display: inline-block; + width: auto; + max-width: 100%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +}