@@ -901,7 +901,7 @@ protected function validation_common($request, $new_ticket = true)
901901
902902 $ fields ['priority_id ' ] = 'required|exists:panichd_priorities,id ' ;
903903
904- if ($ request ->has ('start_date ' )){
904+ if ($ request ->input ('start_date ' ) != "" ){
905905 \Datetime::createFromFormat (trans ('panichd::lang.datetime-format ' ), $ request ->input ('start_date ' ));
906906 $ errors = \DateTime::getLastErrors ();
907907 if (isset ($ errors ['warnings ' ]) and isset ($ errors ['errors ' ]) and ($ errors ['warnings ' ] or $ errors ['errors ' ])){
@@ -926,7 +926,7 @@ protected function validation_common($request, $new_ticket = true)
926926 }
927927 }
928928
929- if ($ request ->has ('limit_date ' )){
929+ if ($ request ->input ('limit_date ' ) != "" ){
930930 \Datetime::createFromFormat (trans ('panichd::lang.datetime-format ' ), $ request ->input ('limit_date ' ));
931931 $ errors = \DateTime::getLastErrors ();
932932
@@ -1004,7 +1004,7 @@ protected function validation_common($request, $new_ticket = true)
10041004
10051005
10061006 // Date diff validation
1007- if ($ request ->has ('start_date ' ) and isset ($ start_date ) and $ request ->has ('limit_date ' ) and isset ($ limit_date )
1007+ if ($ request ->input ('start_date ' ) != "" and isset ($ start_date ) and $ request ->input ('limit_date ' ) != "" and isset ($ limit_date )
10081008 and (!$ a_result_errors or ($ a_result_errors and !isset ($ a_result_errors ['fields ' ]['limit_date ' ])))){
10091009
10101010 if ($ start_date ->diffInSeconds ($ limit_date , false ) < 0 ){
@@ -1139,15 +1139,15 @@ public function add_embedded_comments($request, $ticket, $a_result_errors)
11391139 {
11401140 $ a_new_comments = [];
11411141
1142- if ($ request ->has ('form_comments ' )){
1142+ if ($ request ->input ('form_comments ' ) != "" ){
11431143 $ custom_messages = [
11441144 'content.required ' => trans ('panichd::lang.validate-comment-required ' ),
11451145 'content.min ' => trans ('panichd::lang.validate-comment-min ' ),
11461146 ];
11471147
11481148 foreach ($ request ->form_comments as $ i ){
11491149
1150- if (!$ request ->has ('response_ ' . $ i )) continue ;
1150+ if (!$ request ->input ('response_ ' . $ i ) != "" ) continue ;
11511151
11521152 $ response_type = in_array ($ request ->{'response_ ' . $ i }, ['note ' ,'reply ' ]) ? $ request ->{'response_ ' . $ i } : 'note ' ;
11531153
@@ -1168,10 +1168,10 @@ public function add_embedded_comments($request, $ticket, $a_result_errors)
11681168 $ comment ->save ();
11691169
11701170 // Comment recipients
1171- if ($ request ->has ('comment_ ' . $ i . '_recipients ' )) $ comment ->a_recipients = $ request ->{'comment_ ' . $ i . '_recipients ' };
1171+ if ($ request ->input ('comment_ ' . $ i . '_recipients ' ) != "" ) $ comment ->a_recipients = $ request ->{'comment_ ' . $ i . '_recipients ' };
11721172
11731173 // Adds this as a $comment property to check it in NotificationsController
1174- if ($ request ->has ('comment_ ' . $ i . '_notification_text ' )) $ comment ->add_in_user_notification_text = 'yes ' ;
1174+ if ($ request ->input ('comment_ ' . $ i . '_notification_text ' ) != "" ) $ comment ->add_in_user_notification_text = 'yes ' ;
11751175
11761176 $ a_new_comments [] = $ comment ;
11771177 }
@@ -1446,7 +1446,7 @@ public function update(Request $request, $id)
14461446
14471447 if (!$ a_result_errors ){
14481448 // 3 - destroy checked attachments
1449- if ($ request ->has ('delete_files ' )){
1449+ if ($ request ->input ('delete_files ' ) != "" ){
14501450 $ destroy_error = $ this ->destroyAttachmentIds ($ request ->delete_files );
14511451
14521452 if ($ destroy_error ) $ a_result_errors ['messages ' ][] = $ destroy_error ;
@@ -1766,12 +1766,12 @@ public function changeAgent(Request $request)
17661766 $ original_ticket = Ticket::findOrFail ($ request ->input ('ticket_id ' ));
17671767 $ ticket = clone $ original_ticket ;
17681768 $ old_agent = $ ticket ->agent ()->first ();
1769- if ($ request ->has ('agent_id ' )){
1769+ if ($ request ->input ('agent_id ' ) != "" ){
17701770 $ new_agent = \PanicHDMember::find ($ request ->input ('agent_id ' ));
17711771 }else
17721772 $ new_agent = clone $ old_agent ;
17731773
1774- if (!$ request ->has ('status_checkbox ' ) and (is_null ($ new_agent ) || $ ticket ->agent_id == $ request ->input ('agent_id ' ))){
1774+ if (!$ request ->input ('status_checkbox ' ) != "" and (is_null ($ new_agent ) || $ ticket ->agent_id == $ request ->input ('agent_id ' ))){
17751775 return redirect ()->back ()->with ('warning ' , trans ('panichd::lang.update-agent-same ' , [
17761776 'name ' => '# ' .$ ticket ->id .' ' .$ ticket ->subject ,
17771777 'link ' => route (Setting::grab ('main_route ' ).'.show ' , $ ticket ->id ),
@@ -1782,7 +1782,7 @@ public function changeAgent(Request $request)
17821782 $ ticket ->agent_id = $ new_agent ->id ;
17831783
17841784 $ old_status_id = $ ticket ->status_id ;
1785- if ($ request ->has ('status_checkbox ' ) || !Setting::grab ('use_default_status_id ' )){
1785+ if ($ request ->input ('status_checkbox ' ) != "" || !Setting::grab ('use_default_status_id ' )){
17861786 $ ticket ->status_id = Setting::grab ('default_reopen_status_id ' );
17871787 }
17881788 $ ticket ->save ();
0 commit comments