FAQ Item

« Return to FAQ database

Cannot set department list

Open the file:

wp-content/plugins/wpetss/includes/ticket.php and go to about line 1000 where you see this code:

public static function get_types($only_public=false){
$sql = "SELECT * FROM `"._DB_PREFIX."ticket_type` tt";
if($only_public){
$sql.=" WHERE tt.`public` = 1 ";
}
$sql .= " ORDER BY tt.`name`";
$statuses = array();
foreach(wpetss_qa($sql) as $r){
$statuses[$r['ticket_type_id']] = $r['name'];
}
return $statuses;
}

DELETE these above lines of code. Just underneath this code is a "commented out" block of code looking like this:

/*public static function get_types(){
global $wpdb;
$sql = "SELECT `type` FROM `".$wpdb->prefix."wpetss_ticket` GROUP BY `type` ORDER BY `type`";
$statuses = array();
foreach($wpdb->get_results($sql) as $r){
$r=(array)$r;
$statuses[$r['type']] = $r['type'];
}
// find any defaults.
$defaults = get_site_option('ticket_default_types','Website Problem,Billing Enquiry,Sales,General Support,Other');
foreach(explode(',',$defaults) as $default){
$default = trim($default);
if(!$default)continue;
if(!isset($statuses[$default])){
$statuses[$default] = $default;
}
}
ksort($statuses);
return $statuses;
}*/

Please uncomment this block of code by changing it to this (ie: remove the /* and the */ )

public static function get_types(){
global $wpdb;
$sql = "SELECT `type` FROM `".$wpdb->prefix."wpetss_ticket` GROUP BY `type` ORDER BY `type`";
$statuses = array();
foreach($wpdb->get_results($sql) as $r){
$r=(array)$r;
$statuses[$r['type']] = $r['type'];
}
// find any defaults.
$defaults = get_site_option('ticket_default_types','Website Problem,Billing Enquiry,Sales,General Support,Other');
foreach(explode(',',$defaults) as $default){
$default = trim($default);
if(!$default)continue;
if(!isset($statuses[$default])){
$statuses[$default] = $default;
}
}
ksort($statuses);
return $statuses;
}

If you have troubles doing this please send us a support ticket and we can assist further.