Skip to content
Snippets Groups Projects
Commit 7ed57113 authored by Jared Hancock's avatar Jared Hancock
Browse files

Fix subject display when a ChoiceField is used

parent 8bd0ccbd
No related branches found
No related tags found
No related merge requests found
......@@ -157,11 +157,14 @@ $negorder=$order=='DESC'?'ASC':'DESC'; //Negate the sorting
</thead>
<tbody>
<?php
$subject_field = TicketForm::objects()->one()->getField('subject');
if($res && ($num=db_num_rows($res))) {
$defaultDept=Dept::getDefaultDeptName(); //Default public dept.
while ($row = db_fetch_array($res)) {
$dept= $row['ispublic']? $row['dept_name'] : $defaultDept;
$subject=Format::htmlchars(Format::truncate($row['subject'],40));
$subject = Format::truncate($subject_field->display(
$subject_field->to_php($row['subject']) ?: $row['subject']
), 40);
if($row['attachments'])
$subject.=' &nbsp;&nbsp;<span class="Icon file"></span>';
......
......@@ -406,6 +406,8 @@ if ($results) {
</thead>
<tbody>
<?php
// Setup Subject field for display
$subject_field = TicketForm::objects()->one()->getField('subject');
$class = "row1";
$total=0;
if($res && ($num=count($results))):
......@@ -430,7 +432,10 @@ if ($results) {
$lc=Format::truncate($row['dept_name'],40);
}
$tid=$row['number'];
$subject = Format::htmlchars(Format::truncate($row['subject'],40));
$subject = Format::truncate($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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment