The search is handled in /include/staff/tickets.inc.php
The part that handles how many characters are needed is in this statement. I haven't tried but maybe you can just change the '
if( ($_REQUEST && strlen($_REQUEST)<3)
|| (!$_REQUEST && isset($_REQUEST)) ){ //Why do I care about this crap...
$search=false; //Instead of an error page...default back to regular query..with no search.
$errors='Search term must be more than 3 chars';
$searchTerm='';
}
Further down, this part handles the search itself and what is being searched. You should be able to change what you are searching here.
//Search?? Somebody...get me some coffee
$deep_search=false;
if($search):
$qstr.='&a='.urlencode($_REQUEST);
$qstr.='&t='.urlencode($_REQUEST);
if(isset($_REQUEST)){ //advance search box!
$qstr.='&advance_search=Search';
}
//query
if($searchTerm){
$qstr.='&query='.urlencode($searchTerm);
$queryterm=db_real_escape($searchTerm,false); //escape the term ONLY...no quotes.
if(is_numeric($searchTerm)){
$qwhere.=" AND ticket.ticketID LIKE '$queryterm%'";
}elseif(strpos($searchTerm,'@') && Validator:($searchTerm)){ //pulling all tricks!
$qwhere.=" AND ticket.email='$queryterm'";
}else{//Deep search!
//This sucks..mass scan! search anything that moves!
$deep_search=true;
if($_REQUEST && $_REQUEST=='FT') { //Using full text on big fields.
$qwhere.=" AND ( ticket.email LIKE '%$queryterm%'".
" OR ticket.name LIKE '%$queryterm%'".
" OR ticket.subject LIKE '%$queryterm%'".
" OR note.title LIKE '%$queryterm%'".
" OR MATCH(message.message) AGAINST('$queryterm')".
" OR MATCH(response.response) AGAINST('$queryterm')".
" OR MATCH(note.note) AGAINST('$queryterm')".
' ) ';
}else{
$qwhere.=" AND ( ticket.email LIKE '%$queryterm%'".
" OR ticket.name LIKE '%$queryterm%'".
" OR ticket.subject LIKE '%$queryterm%'".
" OR message.message LIKE '%$queryterm%'".
" OR response.response LIKE '%$queryterm%'".
" OR note.note LIKE '%$queryterm%'".
" OR note.title LIKE '%$queryterm%'".
' ) ';
}
}
}
//department
if($_REQUEST && ($thisuser->isadmin() || in_array($_REQUEST,$thisuser->getDepts()))) {
//This is dept based search..perm taken care above..put the sucker in.
$qwhere.=' AND ticket.dept_id='.db_input($_REQUEST);
$qstr.='&dept='.urlencode($_REQUEST);
}
//dates
$startTime =($_REQUEST && (strlen($_REQUEST)>=8))?strtotime($_REQUEST);
$endTime =($_REQUEST && (strlen($_REQUEST)>=8))?strtotime($_REQUEST);
if( ($startTime && $startTime>time()) or ($startTime>$endTime && $endTime>0)){
$errors='Entered date span is invalid. Selection ignored.';
$startTime=$endTime=0;
}else{
//Have fun with dates.
if($startTime){
$qwhere.=' AND ticket.created>=FROM_UNIXTIME('.$startTime.')';
$qstr.='&startDate='.urlencode($_REQUEST);
}
if($endTime){
$qwhere.=' AND ticket.created<=FROM_UNIXTIME('.$endTime.')';
$qstr.='&endDate='.urlencode($_REQUEST);
}