Merged changes from mai trunk up to 2.3.1
[fa-stable.git] / admin / db / company_db.inc
index fffd3cb318efd711993ce832dc9b4e701d5fafc7..0a01a7c493c7048fae374606ea6d520b11ee9b4b 100644 (file)
@@ -76,6 +76,13 @@ function get_company_prefs($tbpref = TB_PREF)
        return get_company_pref(null, $tbpref);
 }
 
+function set_company_pref($pref, $category, $type, $length, $value)
+{
+       $sql = "REPLACE `0_sys_prefs` SET `name`=".db_escape($pref).", `category`=".db_escape($category)
+               .", `type`=".db_escape($type).", `length`=".db_escape($length).", `value`=".db_escape($value);
+       return db_query($sql, "cannot set company pref");
+}
+
 function refresh_sys_prefs()
 {
        flush_dir(company_path().'/js_cache'); // clear cache