Skip to content

Commit c7fd1f9

Browse files
committed
notices list calendar info: only date and time but not relative status
1 parent 17dd215 commit c7fd1f9

4 files changed

Lines changed: 16 additions & 9 deletions

File tree

src/Models/Ticket.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,14 +395,12 @@ public function getCalendarInfo($question_sign = false, $show = 'field')
395395
$color = "text-warning";
396396
}
397397

398-
$date_text = $this->getDateForHumans($date);
399-
400398
if ($show == 'description') {
401-
// Date description only
402-
return '<span class="glyphicon '.$icon.'"></span> '.$title;
399+
// Date description
400+
return $title;
403401
}else{
404402
// Full field
405-
return "<span class=\"tooltip-info $color\" title=\"$title\" data-toggle=\"tooltip\" data-placement=\"auto bottom\"><span class=\"glyphicon $icon\"></span> $date_text ".($question_sign ? "<span class=\"glyphicon glyphicon-question-sign\"></span>" : "")."</span>";
403+
return "<span class=\"tooltip-info $color\" title=\"$title\" data-toggle=\"tooltip\" data-placement=\"auto bottom\"><span class=\"glyphicon $icon\"></span> ".$this->getDateForHumans($date)." ".($question_sign ? "<span class=\"glyphicon glyphicon-question-sign\"></span>" : "")."</span>";
406404
}
407405
}
408406

src/PanicHDServiceProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ public function boot()
201201
->select('panichd_tickets.*')
202202
->with('owner.personDepts.department')
203203
->with('status')->with('tags')
204+
->withCount('allAttachments')
204205
->orderByRaw('CASE when status_id="'.Setting::grab('default_close_status_id').'" then 2 else 1 end')
205206
->orderByRaw('date(start_date)')
206207
->orderBy('panichd_priorities.magnitude', 'desc')

src/Views/notices/index.blade.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,13 @@
3838
<tr>
3939
<td>{{ $notice->id }}</td>
4040
<td style="color: {{ $notice->status->color }}">{{ $notice->status->name }}</td>
41-
<td style="width: 14em;">{!! $notice->getCalendarInfo(false, 'description') !!}</td>
41+
<td style="width: 14em;">{!! $notice->getDateForHumans($notice->limit_date) !!}</td>
4242
<td>{{ link_to_route($setting->grab('main_route').'.show', $notice->subject, $notice->id) }}</td>
43-
<td>{{ $notice->content }}</td>
43+
<td>{{ $notice->content }}
44+
@if ($notice->all_attachments_count>0)
45+
<br />{{ $notice->all_attachments_count }} <span class="glyphicons glyphicon glyphicon-paperclip tooltip-info attachment" title="{{ trans('panichd::lang.table-info-attachments-total', ['num' => $notice->all_attachments_count]) }}"></span>
46+
@endif
47+
</td>
4448
<td>{{ $notice->intervention }}</td>
4549
@if($u->currentLevel() > 1)
4650
<td><span title="{{ $u->currentLevel() > 2 ? trans('panichd::lang.show-ticket-creator') . trans('panichd::lang.colon') . $notice->owner->name : '' }}">{{ $notice->owner->ticketit_department == 0 ? trans('panichd::lang.all-depts') : $notice->owner->userDepartment->resume(true) }}</span></td>

src/Views/notices/widget.blade.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@
1111
@foreach ($a_notices as $notice)
1212
<tr>
1313
<td style="width: 14em;">{{ $notice->id }}<br /><span style="font-weight: bold">{{ $notice->status->name }}</span>
14-
<div style="margin: 1em 0em 0em 0em; font-weight: bold;">{!! $notice->getCalendarInfo(false, 'description') !!}</div>
14+
<div style="margin: 1em 0em 0em 0em; font-weight: bold;"><span class="glyphicon glyphicon-calendar"></span> {!! $notice->getDateForHumans($notice->limit_date) !!}</div>
1515

1616
</td>
1717
<td><div style="margin: 0em 0em 1em 0em;">{{ link_to_route($setting->grab('main_route').'.show', $notice->subject, $notice->id) }}</div>
18-
<p>{{ $notice->content }}{{ $notice->intervention }}</p>
18+
<p>{{ $notice->content }}
19+
@if ($notice->all_attachments_count>0)
20+
<br />{{ $notice->all_attachments_count }} <span class="glyphicons glyphicon glyphicon-paperclip tooltip-info attachment" title="{{ trans('panichd::lang.table-info-attachments-total', ['num' => $notice->all_attachments_count]) }}"></span>
21+
@endif
22+
{{ $notice->intervention }}</p>
1923
@foreach ($notice->tags as $tag)
2024
<button class="btn btn-default btn-tag" style="pointer-events: none; background-color: {{ $tag->bg_color }}; color: {{ $tag->text_color }}">{{ $tag->name }}</button>
2125
@endforeach

0 commit comments

Comments
 (0)