At first we should check if we're in the GUI scope, because processing callbacks are called always - even from scripts. However using location should not affect scripts like cron etc, but it's better to check.
To do this:
if (Utils_RecordBrowser::$rb_obj instanceof Utils_RecordBrowser) { .. }
Then create location href
location(Utils_RecordBrowserCommon::get_record_href_array('contact', 1));
To sum up
public static function submit_values($values, $mode) {
switch ($mode) {
case 'add':
if ($some_record_exists) {
Utils_RecordBrowserCommon::update_record($tab, $existing_record_id, $values);
if (Utils_RecordBrowser::$rb_obj instanceof Utils_RecordBrowser) {
location(Utils_RecordBrowserCommon::get_record_href_array('contact', 1));
}
return false;
}
}
}
Regards,
Adam