1111 w: {{ $sizes [0 ] } } ,
1212 h: {{ $sizes [1 ] } } ,
1313 pid: {{ $attachment -> id } } ,
14- title: ' {{ $attachment -> new_filename . ($attachment -> description == " " ? ' ' : trans (' panichd::lang.colon' ). $attachment -> description ) } }'
14+ title: ' {{ $attachment -> new_filename . ($attachment -> description == " " ? ' ' : trans (' panichd::lang.colon' ). $attachment -> description ) } }'
1515 },
1616 @endif
1717 @endforeach
3232 // Update agent list
3333 var loadpage = " {!! route ($setting -> grab (' main_route' ). ' agentselectlist' ) ! !} /" + $ (this ).val () + " /{{ $ticket -> id } }" ;
3434 $ (' #agent_id' ).load (loadpage);
35-
36- // Update tag list
35+
36+ // Update tag list
3737 $ (' #jquery_select2_container .select2-container' ).hide ();
3838 $ (' #jquery_tag_category_' + $ (this ).val ()).next ().show ();
3939 });
40-
40+
4141 $ (' #agent_id' ).change (function (){
4242 if ($ (' #status_id' ).val ()== " {!! $setting -> grab (' default_status_id' ) ! !}" ){
4343 $ (' #status_id' ).val (" {!! $setting -> grab (' default_reopen_status_id' ) ! !}" )
6161
6262 // Complete modal status_id change
6363 $ (' #ticket-complete-modal #status_id' ).change (function (){
64- var url = ' {{ route ($setting -> grab (' main_route' ). ' .edit-with-values ' , [' id' => $ticket -> id , ' parameters' => ' complete/yes/status_id/' ]) } }' ;
64+ var url = ' {{ route ($setting -> grab (' main_route' ). ' .edit' , [' id' => $ticket -> id , ' parameters' => ' complete/yes/status_id/' ]) } }' ;
6565 $ (' #ticket-complete-modal #edit-with-values' )
6666 .prop (' href' , url + ' /' + $ (this ).val ());
6767 });
6868
6969 // Complete modal submit button
70- $ (' #complete_form_submit' ).click (function (e ){
70+ $ (' #complete_form_submit' ).click (function (e ){
7171 @if ($u -> currentLevel () > 1 && $u -> canManageTicket ($ticket -> id ) )
7272 // Agent / Admin
7373 @if (! $ticket -> intervention_html )
8383 return false ;
8484 }
8585 @endif
86- $ (' #complete-ticket-form' ).submit ();
87- });
88-
89- // When opening a comment modal,
86+ $ (' #complete-ticket-form' ).submit ();
87+ });
88+
89+ // When opening a comment modal,
9090 $ (' .comment-modal' ).on (' show.bs.modal' , function (e ) {
9191 $ (' .comment-modal .alert-danger' ).hide ();
9292 $ (this ).find (' .fieldset-for-comment' ).show ();
9393 $ (this ).find (' .fieldset-for-attachment' ).hide ();
9494 });
95-
95+
9696 $ (' .comment-modal' ).on (' shown.bs.modal' , function (e ) {
9797 $ (this ).find (' .modal-title' ).text ($ (e .relatedTarget ).text ());
9898 if ($ (e .relatedTarget ).data (' add-comment' ) == ' no' ) $ (this ).find (' #comment-type-buttons' ).hide ();
103103 $ (' .comment-modal' ).on (' hidden.bs.modal' , function (e ) {
104104 $ (this ).find (" textarea.modal-summernote-editor" ).summernote (' destroy' );
105105 });
106-
106+
107107 // Comment form: Click on response type buttons (reply or note)
108108 $ (' .response_type' ).click (function (){
109- var type = $ (this ).attr (' data-type' );
109+ var type = $ (this ).attr (' data-type' );
110110 $ (' #modal-comment-new #response_type' ).val (type);
111111 $ (this ).addClass ($ (this ).attr (' data-active-class' ));
112-
112+
113113 if (type == ' reply' ){
114114 $ (' #add_in_user_notification_text, #add_to_intervention' ).prop (' disabled' , false );
115115 $ (' #add_in_user_notification_text, #add_to_intervention' ).closest (' div' ).show ();
116116 }else {
117117 $ (' #add_in_user_notification_text, #add_to_intervention' ).prop (' disabled' , true );
118118 $ (' #add_in_user_notification_text, #add_to_intervention' ).closest (' div' ).hide ();
119119 }
120-
120+
121121 var alt = type == ' note' ? ' reply' : ' note' ;
122122 $ (' #popup_comment_btn_' + alt).removeClass ($ (' #popup_comment_btn_' + alt).attr (' data-active-class' ));
123123 });
126126 $ (' .jquery_panel_hightlight' ).on (' show.bs.modal' , function (e ) {
127127 $ (e .relatedTarget ).closest (' div.card' ).addClass (' card-highlight' );
128128 });
129-
129+
130130 $ (' .jquery_panel_hightlight' ).on (' hidden.bs.modal' , function (e ) {
131131 $ (' div.card' ).removeClass (' card-highlight' );
132132 });
133-
133+
134134 $ (' #new_comment_submit' ).click (function (e ){
135135 e .preventDefault ();
136-
136+
137137 @if ($u -> currentLevel () > 1 && ! $ticket -> intervention_html != " " )
138138 if ($ (this ).closest (' form' ).find (' input[name="add_to_intervention"]' ).is (' :checked' ) == false && $ (this ).closest (' form' ).find (' input[name="complete_ticket"]' ).is (' :checked' )){
139139 if (! confirm (' {!! trans (' panichd::lang.add-comment-confirm-blank-intervention' ) ! !}' )) return false ;
140- }
140+ }
141141 @endif
142-
142+
143143 ajax_form_submit ($ (this ));
144144 });
145-
145+
146146 // Click "X" to delete comment
147147 $ (' #modal-comment-delete' ).on (' show.bs.modal' , function (e ) {
148148 if ($ (' #delete-comment-form' ).attr (' data-default-action' ) == ' ' ){
149149 $ (' #delete-comment-form' ).attr (' data-default-action' ,$ (' #delete-comment-form' ).attr (' action' ));
150150 }
151-
151+
152152 // Add value to form
153153 $ (' #delete-comment-form' ).attr (' action' ,$ (' #delete-comment-form' ).attr (' action' ).replace (' action_comment_id' ,$ (e .relatedTarget ).attr (' data-id' )));
154154 });
155-
155+
156156 // Dismiss comment deletion
157157 $ (' #modal-comment-delete' ).on (' hidden.bs.modal' , function (e ) {
158158 $ (' #delete-comment-form' ).attr (' action' ,$ (' #delete-comment-form' ).attr (' data-default-action' ));
159159 });
160-
160+
161161 // Comment confirm delete
162162 $ ( " #delete-comment-submit" ).click (function ( event ) {
163163 event .preventDefault ();
164164 $ (" #delete-comment-form" ).submit ();
165- });
166-
167-
165+ });
166+
167+
168168 // Comment (reply) notifications resend modal
169169 $ ( " #email-resend-modal" ).on (' show.bs.modal' , function (e ) {
170170 var button = $ (e .relatedTarget );
171171 $ (this ).find (' #owner' ).text ($ (button).attr (' data-owner' ));
172172 $ (this ).find (' #comment_id' ).val ($ (button).attr (' data-id' ))
173- });
173+ });
174174 });
175- </script >
175+ </script >
0 commit comments