In my view.php I have a close ticket button. When I select that button it will automatically get the system time and the status will be change into ‘Done’, thanks to the help of a guy here I forgot his username.
What I want to try is that when I click the close button if the ticket has already been done, the time_end won’t be changed and it will display a popup message similar to the delete button.
My problem is that it does not display a message and it still gets the system time even though the ticket status is already ‘Done’. I think I’m also wrong here at this part
(['data' => ['prompt' => 'Ticket has already been closed!']]);
problem is your if condition, your second check will always be false
if ($model->status == 'Done' && $model->time_end == date('y-m-d h-i-s')) {
date(‘y-m-d h-i-s’) will return current time and your $model->time_end is date in the past which will never be equal perhaps you should stick with only status something like
Thank you for help, I also did that I deleted the $model->time_end and it worked without even knowing why but since you explained it to me I finally know now.
I’m currently reading the docu I’m still having a problem on how am I going to display a pop up message similar to the delete button.