if (get_post('restore')) {
if (db_import($backup_path, $conn))
display_notification(_("Restore backup completed."));
+ refresh_sys_prefs(); // re-read system setup
}
if (get_post('deldump')) {
return get_company_pref(null, $tbpref);
}
+function refresh_sys_prefs()
+{
+ flush_dir(company_path().'/js_cache'); // clear cache
+ unset($_SESSION['SysPrefs']);
+ get_company_prefs();
+}
+
function get_base_sales_type()
{
return get_company_pref('base_sales');
$_SESSION["wa_current_user"]->prefs = new user_prefs($user);
display_notification(_('All companies data has been successfully updated'));
}
- unset($_SESSION['SysPrefs']); // re-read system setup
- $_SESSION['SysPrefs'] = new sys_prefs();
+ refresh_sys_prefs(); // re-read system setup
$Ajax->activate('_page_body');
}