Skip to content

Commit 8d85f24

Browse files
committed
group ticket show files
1 parent a1bec48 commit 8d85f24

12 files changed

Lines changed: 180 additions & 180 deletions

src/Translations/ca/lang.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@
276276
'comment-note-title' => 'Nota oculta per a l\'usuari',
277277
'comment-note-from-agent' => 'Nota de <b>:agent</b>',
278278

279-
'comment-complete-title' => 'Tiquet tancat',
279+
'comment-completetx-title' => 'Tiquet tancat',
280280
'comment-complete-by' => 'Tancat per <b>:owner</b>',
281281

282282
'comment-reopen-title' => 'Tiquet reobert',

src/Translations/en/lang.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@
278278
'comment-note-title' => 'User hidden note',
279279
'comment-note-from-agent' => 'Note from <b>:agent</b>',
280280

281-
'comment-complete-title' => 'Ticket complete',
281+
'comment-completetx-title' => 'Ticket complete',
282282
'comment-complete-by' => 'Tancat per <b>:owner</b>',
283283

284284
'comment-reopen-title' => 'Ticket reopened',

src/Views/tickets/show.blade.php

Lines changed: 12 additions & 168 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
@include('panichd::shared.common')
66

77
@section('content')
8-
@include('panichd::tickets.partials.ticket_body')
9-
@include('panichd::tickets.partials.modal_complete')
8+
@include('panichd::tickets.show.body')
9+
@if($u->isAdmin())
10+
@include('panichd::tickets.show.modal_delete')
11+
@endif
12+
@include('panichd::tickets.show.modal_complete')
1013

1114
@if($u->canCommentTicket($ticket->id) || ( !$comments->isEmpty() && $ticket->comments->forLevel(1)->count() ) )
1215
<div style="margin-top: 2em;">
@@ -17,9 +20,11 @@
1720
</h2>
1821
</div>
1922
@endif
20-
@include('panichd::tickets.partials.comments')
21-
{!! $comments->render() !!}
22-
@include('panichd::tickets.partials.modal_comment_new')
23+
@if(!$comments->isEmpty())
24+
@include('panichd::tickets.show.comments')
25+
@endif
26+
{!! $comments->render() !!}
27+
@include('panichd::tickets.show.modal_comment_new')
2328
@if ($setting->grab('ticket_attachments_feature'))
2429
@include('panichd::shared.attach_files_script')
2530
@endif
@@ -29,168 +34,7 @@
2934
@include('panichd::shared.jcrop_files')
3035

3136
@section('footer')
32-
<script>
33-
// PhotoSwipe items array (load before jQuery .pwsp_gallery_link click selector)
34-
var pswpItems = [
35-
@foreach($ticket->allAttachments()->images()->get() as $attachment)
36-
@if($attachment->image_sizes != "")
37-
<?php
38-
$sizes = explode('x', $attachment->image_sizes);
39-
?>
40-
{
41-
src: '{{ URL::route($setting->grab('main_route').'.view-attachment', [$attachment->id]) }}',
42-
w: {{ $sizes[0] }},
43-
h: {{ $sizes[1] }},
44-
pid: {{ $attachment->id }},
45-
title: '{{ $attachment->new_filename . ($attachment->description == "" ? '' : trans('panichd::lang.colon').$attachment->description) }}'
46-
},
47-
@endif
48-
@endforeach
49-
];
50-
51-
var category_id=<?=$ticket->category_id;?>;
52-
$(document).ready(function() {
53-
$( ".deleteit" ).click(function( event ) {
54-
event.preventDefault();
55-
if (confirm("{!! trans('panichd::lang.show-ticket-js-delete') !!}" + $(this).attr("node") + " ?"))
56-
{
57-
var form = $(this).attr("form");
58-
$("#" + form).submit();
59-
}
60-
61-
});
62-
$('#category_id').change(function(){
63-
// Update agent list
64-
var loadpage = "{!! route($setting->grab('main_route').'agentselectlist') !!}/" + $(this).val() + "/{{ $ticket->id }}";
65-
$('#agent_id').load(loadpage);
66-
67-
// Update tag list
68-
$('#jquery_select2_container .select2-container').hide();
69-
$('#jquery_tag_category_'+$(this).val()).next().show();
70-
});
71-
72-
$('#agent_id').change(function(){
73-
if ($('#status_id').val()=="{!! $setting->grab('default_status_id') !!}"){
74-
$('#status_id').val("{!! $setting->grab('default_reopen_status_id') !!}")
75-
}
76-
});
77-
$('#confirmDelete').on('show.bs.modal', function (e) {
78-
$message = $(e.relatedTarget).attr('data-message');
79-
$(this).find('.modal-body p').text($message);
80-
$title = $(e.relatedTarget).attr('data-title');
81-
$(this).find('.modal-title').text($title);
82-
83-
// Pass form reference to modal for submission on yes/ok
84-
var form = $(e.relatedTarget).closest('form');
85-
$(this).find('.modal-footer #confirm').data('form', form);
86-
});
87-
88-
<!-- Form confirm (yes/ok) handler, submits form -->
89-
$('#confirmDelete').find('.modal-footer #confirm').on('click', function(){
90-
$(this).data('form').submit();
91-
});
92-
93-
// Complete modal submit button
94-
$('#complete_form_submit').click(function(e){
95-
@if ($u->currentLevel() > 1 && $u->canManageTicket($ticket->id))
96-
// Agent / Admin
97-
@if (!$ticket->intervention_html)
98-
if (!$('#blank_intervention_check').prop('checked')){
99-
alert('{{ trans('panichd::lang.show-ticket-complete-blank-intervention-alert') }}');
100-
return false;
101-
}
102-
@endif
103-
@else
104-
// User Level
105-
if (!$("#complete-ticket-form input[name='reason_id']:checked").val()) {
106-
alert('{{ trans('panichd::lang.show-ticket-modal-complete-blank-reason-alert') }}');
107-
return false;
108-
}
109-
@endif
110-
$('#complete-ticket-form').submit();
111-
});
112-
113-
// When opening a comment modal,
114-
$('.comment-modal').on('show.bs.modal', function (e) {
115-
$('.comment-modal .alert-danger').hide();
116-
$(this).find('.fieldset-for-comment').show();
117-
$(this).find('.fieldset-for-attachment').hide();
118-
});
119-
120-
$('#modal-comment-new').on('show.bs.modal', function (e) {
121-
$(this).find('.modal-title').text($(e.relatedTarget).text());
122-
if ($(e.relatedTarget).data('add-comment') == 'no') $(this).find('#comment-type-buttons').hide();
123-
});
124-
125-
// Comment form: Click on response type buttons (reply or note)
126-
$('.response_type').click(function(){
127-
var type = $(this).attr('data-type');
128-
$('#modal-comment-new #response_type').val(type);
129-
$(this).addClass($(this).attr('data-active-class'));
130-
131-
if (type == 'reply'){
132-
$('#add_to_intervention').prop('disabled', false);
133-
$('#add_to_intervention').closest('div').show();
134-
}else{
135-
$('#add_to_intervention').prop('disabled', true);
136-
$('#add_to_intervention').closest('div').hide();
137-
}
138-
139-
var alt = type == 'note' ? 'reply' : 'note';
140-
$('#popup_comment_btn_'+alt).removeClass($('#popup_comment_btn_'+alt).attr('data-active-class'));
141-
});
142-
143-
// Highlight related comment when showing related modal
144-
$('.jquery_panel_hightlight').on('show.bs.modal', function (e) {
145-
$(e.relatedTarget).closest('div.panel').addClass('panel-highlight');
146-
});
147-
148-
$('.jquery_panel_hightlight').on('hidden.bs.modal', function (e) {
149-
$('div.panel').removeClass('panel-highlight');
150-
});
151-
152-
$('#new_comment_submit').click(function(e){
153-
e.preventDefault();
154-
155-
@if($u->currentLevel() > 1 && !$ticket->intervention_html != "")
156-
if ($(this).closest('form').find('input[name="add_to_intervention"]').is(':checked') == false && $(this).closest('form').find('input[name="complete_ticket"]').is(':checked')){
157-
if(!confirm('{!! trans('panichd::lang.add-comment-confirm-blank-intervention') !!}')) return false;
158-
}
159-
@endif
160-
161-
ajax_form_submit($(this));
162-
});
163-
164-
// Click "X" to delete comment
165-
$('#modal-comment-delete').on('show.bs.modal', function (e) {
166-
if ($('#delete-comment-form').attr('data-default-action') == ''){
167-
$('#delete-comment-form').attr('data-default-action',$('#delete-comment-form').attr('action'));
168-
}
169-
170-
// Add value to form
171-
$('#delete-comment-form').attr('action',$('#delete-comment-form').attr('action').replace('action_comment_id',$(e.relatedTarget).attr('data-id')));
172-
});
173-
174-
// Dismiss comment deletion
175-
$('#modal-comment-delete').on('hidden.bs.modal', function (e) {
176-
$('#delete-comment-form').attr('action',$('#delete-comment-form').attr('data-default-action'));
177-
});
178-
179-
// Comment confirm delete
180-
$( "#delete-comment-submit" ).click(function( event ) {
181-
event.preventDefault();
182-
$("#delete-comment-form").submit();
183-
});
184-
185-
186-
// Comment (reply) notifications resend modal
187-
$( "#email-resend-modal" ).on('show.bs.modal', function (e) {
188-
var button = $(e.relatedTarget);
189-
$(this).find('#owner').text($(button).attr('data-owner'));
190-
$(this).find('#comment_id').val($(button).attr('data-id'))
191-
});
192-
});
193-
</script>
37+
@include('panichd::tickets.show.script')
19438
@include('panichd::tickets.partials.summernote')
19539
@include('panichd::tickets.partials.tags_footer_script')
196-
@append
40+
@append

src/Views/tickets/partials/ticket_body.blade.php renamed to src/Views/tickets/show/body.blade.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,4 @@ class="btn btn-default"
224224
!!}
225225
{!! CollectiveForm::close() !!}
226226
</div>
227-
</div>
228-
229-
{{-- // OR; Modal Window: 2/2 --}}
230-
@if($u->isAdmin())
231-
@include('panichd::tickets.partials.modal-delete-confirm')
232-
@endif
233-
{{-- // END Modal Window: 2/2 --}}
227+
</div>

src/Views/tickets/partials/comments.blade.php renamed to src/Views/tickets/show/comments.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<div class="row">
7474
<div class="{{ $setting->grab('ticket_attachments_feature') && $comment->attachments->count() > 0 ? 'col-sm-7' : 'col-sm-12' }}"><div id="jquery_comment_edit_{{$comment->id}}" class="summernote-text-wrapper"> {!! $comment->html !!} </div>
7575
@if ($u->currentLevel() > 1 && $u->canManageTicket($ticket->id))
76-
@include('panichd::tickets.partials.modal_comment_edit')
76+
@include('panichd::tickets.show.modal_comment_edit')
7777
@endif
7878
</div>
7979
@if($setting->grab('ticket_attachments_feature') && $comment->attachments->count() > 0)
@@ -109,6 +109,6 @@
109109
])
110110
!!}
111111
{!! CollectiveForm::close() !!}
112-
@include('panichd::tickets.partials.email_resend')
113-
@include('panichd::tickets.partials.modal_comment_delete')
112+
@include('panichd::tickets.show.modal_resend_emails')
113+
@include('panichd::tickets.show.modal_comment_delete')
114114
@endif

src/Views/tickets/partials/modal_comment_delete.blade.php renamed to src/Views/tickets/show/modal_comment_delete.blade.php

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)