How can I make "Owner" a required field if null on submit?

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
Lisaweb
Posts: 94
Joined: Sun Sep 25, 2011 3:23 pm

How can I make "Owner" a required field if null on submit?

Post by Lisaweb »

On vesion 4.3:

I was getting a lot of email bounce notices from the server from Hesk and realized that many of our users were responding to tickets without assigning an owner, so email notifications are going to no-one. How can I change the submit form so that nothing can be done to the ticket before assigning it an owner?

Thanks for any help! :-)
- Lisa
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: How can I make "Owner" a required field if null on submi

Post by Klemen »

You weren't getting bounces because no one was assigned - if no one is assigned notifications are sent to all users who have notifications to unassigned tickets enabled. For bounces, you should double-check email addresses of all users.

If bounces happen after staff replies, then the customer's email probably isn't correct. Check bounced messages for delivery errors/details.

Version 2.3, not 4.3, I presume :wink: I would enable auto-assign, that should automatically assign tickets to users.

One way of disabling posting before a ticket is assigned: in admin_ticket.php just after

Code: Select all

$ticket = hesk_dbFetchAssoc($result);
add

Code: Select all

if ( ! $ticket['owner'])
{
    $can_reply = 0;
}
But, again, the problem most likely lies elsewhere - with customer emails not being correct.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Lisaweb
Posts: 94
Joined: Sun Sep 25, 2011 3:23 pm

Re: How can I make "Owner" a required field if null on submi

Post by Lisaweb »

Thanks soo much Klemen! I really like the fix, because it makes the reply box completely dissapear - rather than allowing users to waste time trying to reply only to have it rejected.

Hmm, since I told users to stop replying unless they assign an owner, those email bounces have really decreased to almost nothing. And the server reports that the recipient address is null. But I'll take a look and see what else might be causing it. Here's the type of bounced headers I am receiving:

----------------------------------------------------------------------------------------------------
A message that you sent contained no recipient addresses, and therefore no
delivery could be attempted.

------ This is a copy of your message, including all the headers. ------

To:
Subject: RESPONSE REQUIRED: Ticket assigned to you
From: noreply@mysupportsite.com
Reply-To: noreply@mysupportsite.com
Return-Path: webdept@mysupportsite.com
Content-Type: text/plain; charset=iso-8859-1
Message-Id: <E1RJofG-0001OB-5W@portal.mysupportsite.com>
Date: Fri, 28 Oct 2011 08:48:14 -0700
----------------------------------------------------------------------------------------------------

Oops on the 4.3, LOL. Guess I think that your software will be successful for a
long ways to come. :-)
- Lisa
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: How can I make "Owner" a required field if null on submi

Post by Klemen »

Do these bounces by any chance happen when you move an unassigned ticket to a new category?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Lisaweb
Posts: 94
Joined: Sun Sep 25, 2011 3:23 pm

Re: How can I make "Owner" a required field if null on submi

Post by Lisaweb »

Hi Klemen,

It took me a while to figure it out, but it seems to occur when an assigned ticket gets moved to a category that that same user does not have access to. Oddly, afterwards, in the main ticket list view, the owner field says the ticket is still assigned to that user, but in the actual ticket view it says "unassigned".

Your thoughts?
- Lisa
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: How can I make "Owner" a required field if null on submi

Post by Klemen »

Yep, thought so, that was a problem found and fixed few weeks ago.

If you didn't modify file "admin/move_category.php" please download 2.3 again and upload just this file. If you did any customizations to this file let me know and I will tell you what code to change.

When I release 2.4 remind me to keep a list of all changes after official release :oops: :roll:
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Lisaweb
Posts: 94
Joined: Sun Sep 25, 2011 3:23 pm

Re: How can I make "Owner" a required field if null on submi

Post by Lisaweb »

Hi Klemen,

Yes, I have modified that file, so I will definitely take you up on your offer to give me the code.

Thanks much!
Lisa
- Lisa
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: How can I make "Owner" a required field if null on submi

Post by Klemen »

Find

Code: Select all

	if ($autoassign_owner)
	{
		$ticket['owner'] = $autoassign_owner['id'];
	    $history .= sprintf($hesklang['thist10'],hesk_date(),$autoassign_owner['name'].' ('.$autoassign_owner['user'].')');
	}
and just below add

Code: Select all

    else
    {
    	$ticket['owner'] = 0;
    }
Find

Code: Select all

/* --> From autoassign? */
if ($need_to_reassign)
and change it to

Code: Select all

/* --> From autoassign? */
if ($need_to_reassign && ! empty($autoassign_owner['email']) )
That should do the trick.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Lisaweb
Posts: 94
Joined: Sun Sep 25, 2011 3:23 pm

Re: How can I make "Owner" a required field if null on submi

Post by Lisaweb »

Yup, that seems to have fixed it.

Thanks Klemen! Image
- Lisa
Post Reply