function cleanProfile()
{
if ($this->fields["interface"] == "helpdesk") {
foreach ($this->fields as $key => $val) {
if (!in_array($key, self::$common_fields) && !in_array($key, self::$helpdesk_rights)) {
unset($this->fields[$key]);
}
}
}
// decode array
if (isset($this->fields["helpdesk_item_type"]) && !is_array($this->fields["helpdesk_item_type"])) {
$this->fields["helpdesk_item_type"] = importArrayFromDB($this->fields["helpdesk_item_type"]);
}
// Empty/NULL case
if (!isset($this->fields["helpdesk_item_type"]) || !is_array($this->fields["helpdesk_item_type"])) {
$this->fields["helpdesk_item_type"] = array();
}
// Decode status array
$fields_to_decode = array('ticket_status', 'problem_status', 'change_status');
foreach ($fields_to_decode as $val) {
if (isset($this->fields[$val]) && !is_array($this->fields[$val])) {
$this->fields[$val] = importArrayFromDB($this->fields[$val]);
// Need to be an array not a null value
if (is_null($this->fields[$val])) {
$this->fields[$val] = array();
}
}
}
}