|
72 | 72 | @if ($u->currentLevel() > 1) |
73 | 73 | <div class="jquery_level2_show"> |
74 | 74 | <div class="form-group row"> |
75 | | - <label class="col-lg-3 col-form-label tooltip-info" title="{{ trans('panichd::lang.create-ticket-visible-help') }}">{{ trans('panichd::lang.create-ticket-visible') . trans('panichd::lang.colon') }} <span class="fa fa-question-circle" style="color: #bbb"></span></label> |
| 75 | + <label class="col-lg-3 tooltip-info" title="{{ trans('panichd::lang.create-ticket-visible-help') }}">{{ trans('panichd::lang.create-ticket-visible') . trans('panichd::lang.colon') }} <span class="fa fa-question-circle" style="color: #bbb"></span></label> |
76 | 76 |
|
77 | | - <div class="col-lg-9" style="padding-top: 7px;"> |
| 77 | + <div class="col-lg-9" style="xpadding-top: 7px;"> |
78 | 78 | <label><input type="radio" name="hidden" value="false" {{ (!isset($ticket) || (isset($ticket) && !$ticket->hidden)) ? 'checked' : '' }}> {{ trans('panichd::lang.yes') }}</label><label style="margin: 0em 0em 0em 1em;"><input type="radio" name="hidden" value="true" {{ (isset($ticket) && $ticket->hidden) ? 'checked' : ''}}> {{ trans('panichd::lang.no') }}</label> |
79 | 79 | </div> |
80 | 80 |
|
81 | 81 | </div> |
82 | 82 |
|
83 | 83 | <div class="form-group row" style="margin-bottom: 3em"><!-- TICKET LIST --> |
84 | | - {!! CollectiveForm::label('status_id', trans('panichd::lang.list') . trans('panichd::lang.colon'), [ |
85 | | - 'class' => 'col-lg-3 col-form-label' |
| 84 | + {!! CollectiveForm::label('complete', trans('panichd::lang.list') . trans('panichd::lang.colon'), [ |
| 85 | + 'class' => 'col-lg-3', |
| 86 | + 'title' => trans('panichd::lang.create-ticket-change-list'), |
| 87 | + 'id' => 'last_list', |
| 88 | + 'data-last_list_default_status_id' => $a_current['status_id'] |
86 | 89 | ]) !!} |
87 | 90 | <div class="col-lg-9"> |
88 | | - <button type="button" id="complete_no" class="btn btn-light btn-default text-warning" data-value="no" data-click-status="{{$setting->grab('default_close_status_id')}}" title="{{ trans('panichd::lang.create-ticket-change-list') }}" {!! $a_current['complete'] == "yes" ? 'style="display:none"' : ''!!}><span class="fa fa-file"></span> {{ trans('panichd::lang.active-tickets-adjective') }}</button> |
89 | | - <button type="button" id="complete_yes" class="btn btn-light btn-default text-success" data-value="yes" data-click-status="{{$setting->grab('default_reopen_status_id')}}" title="{{ trans('panichd::lang.create-ticket-change-list') }}" {!! $a_current['complete'] == "yes" ? '' : 'style="display:none"'!!}><span class="fa fa-check-circle"></span> {{ trans('panichd::lang.complete-tickets-adjective') }}</button> |
| 91 | + <?php |
| 92 | + $a_lists = [ |
| 93 | + 'newest' => [ |
| 94 | + 'complete' => 'no', |
| 95 | + 'default_status_id' => $setting->grab('default_status_id') |
| 96 | + ], |
| 97 | + 'active' => [ |
| 98 | + 'complete' => 'no', |
| 99 | + 'default_status_id' => $setting->grab('default_reopen_status_id') |
| 100 | + ], |
| 101 | + 'complete' => [ |
| 102 | + 'complete' => 'yes', |
| 103 | + 'default_status_id' => $setting->grab('default_close_status_id') |
| 104 | + ] |
| 105 | + ]; |
| 106 | +
|
| 107 | + if ($a_current['complete'] == "yes"){ |
| 108 | + $checked_list = 'complete'; |
| 109 | + }elseif($a_current['status_id'] == $setting->grab('default_status_id')){ |
| 110 | + $checked_list = 'newest'; |
| 111 | + }else{ |
| 112 | + $checked_list = 'active'; |
| 113 | + } |
| 114 | + ?> |
| 115 | + |
| 116 | + @foreach ($a_lists as $list => $a_list) |
| 117 | + <div class="form-check form-check-inline"> |
| 118 | + <label class="form-check-label"> |
| 119 | + <input type="radio" class="jquery_ticket_list form-check-input" name="complete" value="{{ $a_list['complete'] }}" @if($list == $checked_list) {!! 'checked="checked"' !!}@endif data-list="{{ $list }}" data-default_status_id="{{ $a_list['default_status_id'] }}">{{ trans('panichd::lang.' . $list . '-tickets-adjective') }} |
| 120 | + </label> |
| 121 | + </div> |
| 122 | + @endforeach |
| 123 | + |
90 | 124 | </div> |
91 | | - {!! CollectiveForm::hidden('complete', isset($ticket) ? ($ticket->completed_at == '' ? 'no' : 'yes') : 'no',['id' => 'value_complete']) !!} |
92 | 125 | </div> |
93 | 126 |
|
94 | 127 | <div class="form-group row"><!-- STATUS --> |
|
269 | 302 | var category_id=<?=$a_current['cat_id'];?>; |
270 | 303 |
|
271 | 304 | $(function(){ |
272 | | - // Category select with $u->maxLevel() > 1 only |
| 305 | + // Change in List affects current status |
| 306 | + $('.jquery_ticket_list').click(function(){ |
| 307 | + var new_status = ""; |
| 308 | +
|
| 309 | + if ($(this).data('default_status_id') != ""){ |
| 310 | + if ($(this).data('list') == 'newest'){ |
| 311 | + new_status = $(this).data('default_status_id'); |
| 312 | + }else if($('#last_list').data('last_list_default_status_id') == $('#select_status').val()){ |
| 313 | + new_status = $(this).data('default_status_id'); |
| 314 | + } |
| 315 | +
|
| 316 | + if (new_status != ""){ |
| 317 | + $('#select_status').val(new_status).effect('highlight'); |
| 318 | + } |
| 319 | +
|
| 320 | + $('#last_list').data('last_list_default_status_id', $(this).data('default_status_id')); |
| 321 | + } |
| 322 | + }); |
| 323 | +
|
| 324 | +
|
| 325 | + // Category select with $u->maxLevel() > 1 only |
273 | 326 | $('#category_change').change(function(){ |
274 | 327 | // Update agent list |
275 | 328 | $('#agent_id').prop('disabled',true); |
|
308 | 361 | $('#jquery_tag_category_'+$(this).val()).next().show(); |
309 | 362 | }); |
310 | 363 | |
311 | | - $('#complete_no, #complete_yes').click(function(){ |
312 | | - $(this).hide(); |
313 | | - var other = $(this).attr('data-value') == 'yes' ? 'no' : 'yes'; |
314 | | - $('#value_complete').val(other); |
315 | | - $('#complete_'+other).show(); |
316 | | - $('#select_status').val($(this).attr('data-click-status')); |
317 | | - }); |
318 | | - |
319 | 364 | $('#start_date input[name="start_date"]').val(''); |
320 | 365 | $('#start_date').datetimepicker({ |
321 | 366 | locale: '{{App::getLocale()}}', |
|
0 commit comments