i made a litle mod that will allow given department mods to recieve pms about new tickets that submitted to their dep.
note
this mod will add a few queries .
run this query to add option to the CP:
Code:
INSERT INTO setting (varname, grouptitle, value, defaultvalue, optioncode, displayorder, advanced, volatile) VALUES ('helpdesk_pm_notify', 'helpdesk', '1', '0', '<select name=\\\"setting[$setting[varname]]\\\" tabindex=\\\"1\\\" class=\\\"bginput\\\">
<option value=\\\"0\\\" \" . iif($setting[\'value\']==0,\'selected=\"selected\"\') . \">$vbphrase[none]</option>
<option value=\\\"1\\\" \" . iif($setting[\'value\']==1,\'selected=\"selected\"\') . \">$vbphrase[private_message]</option>
<option value=\\\"2\\\" \" . iif($setting[\'value\']==2,\'selected=\"selected\"\') . \">$vbphrase[email]</option>
</select>'
,'51', '0', '0')
open helpdesk.php
find
Code:
// lets send an email instead
$vboptions['helpdesk_auto_repsonse'] = 2;
}
}
add below it
Code:
if ($vboptions['helpdesk_pm_notify'] == 1)
{ // send PM to department group
if ($bbuserinfo['permissions']['pmquota'] != 0)
{
$toemail = $bbuserinfo['email'];
eval(fetch_email_phrases('helpdesk_auto_pm', iif(isset($newpost_lang["$toemail"]), $newpost_lang["$toemail"], 0)));
sendprivatemessage_group($vboptions['helpdesk_department_access'], $message, $subject);
}
}
find
Code:
$DB_site->shutdown_query("UPDATE ".TABLE_PREFIX."user SET pmtotal = pmtotal + 1, pmunread = pmunread + 1, pmpopup = " . $userinfo['pmpopup'] . " WHERE userid = '" . $userinfo['userid'] . "'");
}
add below it
Code:
function sendprivatemessage_group ($group_ids, $message, $subject)
{
global $DB_site;
$groups_ids = split(',', $group_ids);
foreach($groups_ids as $group_id)
{
$users_ret= $DB_site->query("SELECT username,userid,pmpopup FROM " . TABLE_PREFIX . "user where usergroupid='$group_id'");
while($users_arr=mysql_fetch_array($users_ret))
sendprivatemessage ($users_arr, $message, $subject); //send pm to each user in the give group_id
}
}
find
Code:
function sendprivatemessage_group ($group_ids, $message, $subject)
{
global $DB_site;
$groups_ids = split(',', $group_ids);
foreach($groups_ids as $group_id)
{
$users_ret= $DB_site->query("SELECT username,userid,pmpopup FROM " . TABLE_PREFIX . "user where usergroupid='$group_id'");
while($users_arr=mysql_fetch_array($users_ret))
sendprivatemessage ($users_arr, $message, $subject); //send pm to each user in the give group_id
}
}
add below it
Code:
$bbuserinfo[m_subj]=addslashes(htmlspecialchars_uni($_REQUEST['title']));
$bbuserinfo[messa]=addslashes($message);
$bbuserinfo[tick_id]=$ticketid;
also create attached phrases .
enjoy