Thread: HelpDesk v1.63
View Single Post
  #312  
Old 03-15-2005, 12:24 PM
red_baron2000's Avatar
red_baron2000 red_baron2000 is offline
 
Join Date: Jul 2002
Location: EU
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01189 seconds
  • Memory Usage 1,779KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete