Skip to content

Commit 159b6dc

Browse files
committed
optional link to user route
1 parent fd12740 commit 159b6dc

4 files changed

Lines changed: 21 additions & 3 deletions

File tree

src/Controllers/ConfigurationsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function index()
2828
'email.google_plus_link', 'email.facebook_link', 'email.twitter_link', 'email.footer', 'email.footer_link',
2929
'email.color_body_bg', 'email.color_header_bg', 'email.color_content_bg', 'email.color_footer_bg',
3030
'email.color_button_bg', 'email.account.name', 'email.account.mailbox' ];
31-
$tickets_section = ['default_status_id', 'default_close_status_id', 'default_reopen_status_id', 'subject_content_column', 'paginate_items', 'attachments_ticket_max_size', 'attachments_ticket_max_files_num', 'attachments_mimes', 'attachments_path', 'thumbnails_path'];
31+
$tickets_section = ['default_status_id', 'default_close_status_id', 'default_reopen_status_id', 'subject_content_column', 'paginate_items', 'attachments_ticket_max_size', 'attachments_ticket_max_files_num', 'attachments_mimes', 'attachments_path', 'thumbnails_path', 'user_route'];
3232
$perms_section = ['agent_restrict', 'close_ticket_perm', 'reopen_ticket_perm'];
3333
$editor_section = ['editor_enabled', 'include_font_awesome', 'editor_html_highlighter', 'codemirror_theme',
3434
'summernote_locale', 'summernote_options_json_file', 'summernote_options_user', 'purifier_config', ];

src/Controllers/TicketsController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,9 @@ public function renderTicketTable($collection)
284284

285285
$collection->editColumn('owner_name', function ($ticket) {
286286
$return = str_replace (" ", " ", $ticket->owner_name);
287+
if (Setting::grab('user_route') != 'disabled'){
288+
$return = '<a href="'.route(Setting::grab('user_route'), ['id' => $ticket->user_id]).'">'.$return.'</a>';
289+
}
287290
if ($ticket->user_id != $ticket->creator_id){
288291
$return .="&nbsp;<span class=\"glyphicon glyphicon-user tooltip-info\" title=\"".trans('panichd::lang.show-ticket-creator').trans('panichd::lang.colon').$ticket->creator->name."\" data-toggle=\"tooltip\" data-placement=\"auto bottom\" style=\"color: #aaa;\"></span>";
289292
}

src/Seeds/SettingsTableSeeder.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,13 @@ public function getDefaults()
369369
* Max number of agent specific buttons in filter panel. If agent count is bigger, select2 will be shown
370370
*/
371371
'max_agent_buttons' => '4',
372+
373+
/**
374+
* User card route name if it exists in your app. Configuring it makes Owner name link to it's card by passing user id.
375+
*
376+
* Default: 'disabled'
377+
*/
378+
'user_route' => 'disabled',
372379
];
373380
}
374381
}

src/Views/tickets/show/body.blade.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,19 @@ class="btn btn-default"
6767
@endif
6868

6969
<br /><strong>{{ trans('panichd::lang.owner') }}</strong>{{ trans('panichd::lang.colon') }}
70+
<?php
71+
if ($setting->grab('user_route') != 'disabled'){
72+
$owner_name = '<a href="' . route($setting->grab('user_route'), ['id'=> $ticket->user_id]) . '">' . $ticket->owner->name . '</a>';
73+
}else{
74+
$owner_name = $ticket->owner->name;
75+
}
76+
?>
77+
7078
@if ($ticket->owner->email == "")
71-
<span class="text-warning">{{ $ticket->owner->name . ' ' . trans('panichd::lang.ticket-owner-no-email')}}
79+
<span class="text-warning">{!! $owner_name . ' ' . trans('panichd::lang.ticket-owner-no-email') !!}
7280
<br /><span class="glyphicon glyphicon-warning-sign"></span> {{ trans('panichd::lang.ticket-owner-no-email-warning') }}</span>
7381
@else
74-
<span class="tooltip-info" data-toggle="tooltip" data-placement="auto bottom" title="{{ $ticket->owner->email }}">{{ $ticket->owner->name }} <span class="glyphicon glyphicon-question-sign"></span></span>
82+
<span id="user_{{ $ticket->user_id }}_name" class="tooltip-info" data-toggle="tooltip" data-placement="auto bottom" title="{{ $ticket->owner->email }}">{!! $owner_name !!} <span class="glyphicon glyphicon-question-sign"></span></span>
7583
@endif
7684

7785
@if ($setting->grab('departments_feature'))

0 commit comments

Comments
 (0)