This will make it so that users can only see canned responses that are assigned to either their department or to "All departments"
include/staff/premade.inc.php
Change:
//List premade answers.
$select='SELECT premade.*,dept_name ';
$from='FROM '.KB_PREMADE_TABLE.' premade LEFT JOIN '.DEPT_TABLE.' USING(dept_id) ';
To:
//List premade answers.
$deptID=$thisuser->getDeptID();
$select='SELECT premade.*,dept_name ';
if($thisuser->isAdmin())
{
$from='FROM '.KB_PREMADE_TABLE.' premade LEFT JOIN '.DEPT_TABLE.' USING(dept_id) ';
}
else
{
$from='FROM '.KB_PREMADE_TABLE.' premade LEFT JOIN '.DEPT_TABLE.' USING(dept_id) WHERE dept_id='.$deptID.' OR dept_id=0 ';
}
Pretty simple MOD and now that your departments can't change/delete each others canned responses, they have one less reason to hate each other. ;)