I was working on the code a little and I think there might be a couple bugs still...
When a new Ticket is entered by one of my members, I get a PM that says:
Quote:
Support Ticket Updated: Another test
--------------------------------------------------------------------------------
The support ticket has been replied to by testaccount.
Please click here to view the ticket
All the best,
Timeshare Forums
|
Shouldn't this PM have a subject or "NEW Support Ticket" with the text inside the PM saying "A new support ticket has been entered by ..."
I looked and there are no such phrases! I also checked the vBsupport.php file and in fact in the notify staff area it does use these "Update" phrases as opposed to a "New"!
So, I created two new phrases:
Phrase 1:
Phrase Type: vb_Support Phrases
Product: vbSupport
Varname: vbsupport_pm_new_message
Text (Note spacing matters below - ask me how I found out:
PHP Code:
A new support ticket has been submitted by {1}.
[url={2}]Please click here to view the ticket[/url]
All the best,
{3}
Phrase 2:
Phrase Type: vb_Support Phrases
Product: vbSupport
Varname: vbsupport_pm_new_title
Text: New {1} {2} Added: {3}
Next, find:
PHP Code:
{
// send a private message to the user
$pmtitle = construct_phrase($vbphrase['vbsupport_pm_update_title'], $vbphrase['vbsupport_title'], $vbphrase['vbsupport_ticket'], $newpost['title']);
$pmtext = construct_phrase($vbphrase['vbsupport_pm_update_message'], $vbulletin->userinfo['username'], $vbulletin->options['bburl'] . $linkurl, $vbulletin->options['bbtitle']);
vbsupport_send_pm(0, $touser, $pmtitle, $pmtext);
}
Replace with:
PHP Code:
// check if it should send a pm
if (in_array($userid, $pmids))
{
// send a private message to the Site Staff
$pmtitle = construct_phrase($vbphrase['vbsupport_pm_new_title'], $vbphrase['vbsupport_title'], $vbphrase['vbsupport_ticket'], $newpost['title']);
$pmtext = construct_phrase($vbphrase['vbsupport_pm_new_message'], $vbulletin->userinfo['username'], $vbulletin->options['bburl'] . $linkurl, $vbulletin->options['bbtitle']);
vbsupport_send_pm(0, $touser, $pmtitle, $pmtext);
}
This is what the above generated for me!!!
New Support Ticket Added: Another trouble ticket test
--------------------------------------------------------------------------------
A new support ticket has been submitted by Site Staff.
Please click here to view the ticket
All the best,
Quarterbore
-------------------------------------------------------------------------------------------------
//////////// Next Issue \\\\\\\\\
-------------------------------------------------------------------------------------------------
Also, when an Admin or Mod does reply to a ticket the member that started the ticket is not getting a PM. I looked at the code and it looks like the code is written to do this...
See following in vbsupport.php:
PHP Code:
// check if it should send a private message
if (($threadinfo['postuserid'] != $vbulletin->userinfo['userid']) && $threadinfo['replynotice'])
{
// fetch the $userinfo for this user
$touser = fetch_userinfo($threadinfo['postuserid']);
// build the $linkurl
$touser['repliedby'] = $vbulletin->userinfo['username'];
$linkurl = "/vbsupport.php?do=viewthread&tid=" . $threadinfo['threadid'];
// check if it should send a pm
if ($threadinfo['replynotice'] & 1)
{
// send a private message to the user
$pmtitle = construct_phrase($vbphrase['vbsupport_pm_update_title'], $vbphrase['vbsupport_title'], $vbphrase['vbsupport_ticket'], $threadinfo['title']);
$pmtext = construct_phrase($vbphrase['vbsupport_pm_update_message'], $vbulletin->userinfo['username'], $vbulletin->options['bburl'] . $linkurl, $vbulletin->options['bbtitle']);
vbsupport_send_pm(0, $touser, $pmtitle, $pmtext);
}
// check if it should send an email
if ($threadinfo['replynotice'] & 2)
{
// set the $title used in the email subject
$emailtitle = $threadinfo['title'];
// send an email to the user
eval(fetch_email_phrases('ticketreplied', $touser['languageid']));
vbmail($touser['email'], $subject, $message, true);
}
}
Now, when I change the above to as follows, the person that posts the trouble ticket gets a PM when a reply is posted!
PHP Code:
// check if it should send a private message
if ($threadinfo['postuserid'] != $vbulletin->userinfo['userid'])
// if (($threadinfo['postuserid'] != $vbulletin->userinfo['userid']) && $threadinfo['replynotice'])
{
// fetch the $userinfo for this user
$touser = fetch_userinfo($threadinfo['postuserid']);
// build the $linkurl
$touser['repliedby'] = $vbulletin->userinfo['username'];
$linkurl = "/vbsupport.php?do=viewthread&tid=" . $threadinfo['threadid'];
// check if it should send a pm
// if ($threadinfo['replynotice'] & 1)
// {
// send a private message to the user
$pmtitle = construct_phrase($vbphrase['vbsupport_pm_update_title'], $vbphrase['vbsupport_title'], $vbphrase['vbsupport_ticket'], $threadinfo['title']);
$pmtext = construct_phrase($vbphrase['vbsupport_pm_update_message'], $vbulletin->userinfo['username'], $vbulletin->options['bburl'] . $linkurl, $vbulletin->options['bbtitle']);
vbsupport_send_pm(0, $touser, $pmtitle, $pmtext);
// }
// check if it should send an email
if ($threadinfo['replynotice'] & 2)
{
// set the $title used in the email subject
$emailtitle = $threadinfo['title'];
// send an email to the user
eval(fetch_email_phrases('ticketreplied', $touser['languageid']));
vbmail($touser['email'], $subject, $message, true);
}
}
So, this tells me that in vB 3.6 that the value of $threadinfo['replynotice'] is not "1" but I have no idea where that is set.... I want members to get a PM when their ticket is updated anyways so this works but I guess I should conditional out unregistered guests "userid = "0"" as I am not sure what that will cause... But, given unregistereds can not use the system yet I will waite on an update...
-------------------------------------------------------------------------------------------------
//////////// Next Issue \\\\\\\\\
-------------------------------------------------------------------------------------------------
There is no code in the script that will notify the staff when a member comes back and updates their ticket (or if it is there it doesn't work on my site and I don't see the code to do this).
EDIT - I did the code as in the following post!
Thanks!