Fix setting of prefs for default cat, remove phpversion check

This commit is contained in:
Miles Lott 2001-03-29 11:12:03 +00:00
parent 1e1b56cc8b
commit f6636247c7
2 changed files with 10 additions and 11 deletions

View File

@ -359,10 +359,10 @@
//echo '<br>first total="'.$total.'"';
// Now, remove duplicate rows
if (floor(phpversion()) == 4) {
$tmp = array_unique($ldap_fields);
$ldap_fields = $tmp;
} else {
//if (floor(phpversion()) == 4) {
// $tmp = array_unique($ldap_fields);
// $ldap_fields = $tmp;
// } else {
$ldap_fields = $this->asortbyindex($ldap_fields,'uidnumber');
reset($ldap_fields);
if (count($ldap_fields) > 0) {
@ -380,7 +380,7 @@
}
$ldap_fields = $uniquearray;
}
} // end version check
// } // end version check
$this->total_records = count($ldap_fields);
//echo '<br>total="'.$this->total_records.'"';

View File

@ -41,18 +41,17 @@
}
}
if ($cat_id=='') {
$cat_id = $phpgw_info["user"]["preferences"]["addressbook"]["default_category"];
}
if($ncat_id || ($ncat_id==0)) {
$cat_id = $ncat_id;
}
if ($cat_id=='') {
$cat_id = $phpgw_info["user"]["preferences"]["addressbook"]["default_category"];
}
if ($phpgw_info["user"]["preferences"]["addressbook"]["autosave_category"]) {
$phpgw->preferences->delete("addressbook","default_category");
$phpgw->preferences->add("addressbook","default_category",$cat_id);
$phpgw->preferences->save_repository();
$phpgw->preferences->add("addressbook","default_category",$ncat_id);
}
$phpgw->preferences->save_repository();
$extrafields = array(
"ophone" => "ophone",