N°3648 - Fix "Configure this list..."

This commit is contained in:
Eric
2021-03-04 15:37:13 +01:00
parent 88e502ad7a
commit 5ccd229092
5 changed files with 80 additions and 60 deletions

View File

@@ -196,26 +196,27 @@ class DataTableSettings implements Serializable
*/
static public function GetTableSettings($aClassAliases, $sTableId = null, $bOnlyOnTable = false)
{
$pref = null;
$oSettings = new DataTableSettings($aClassAliases, $sTableId);
$pref = null;
$oSettings = new DataTableSettings($aClassAliases, $sTableId);
if ($sTableId != null) {
// An identified table, let's fetch its own settings (if any)
$pref = appUserPreferences::GetPref($oSettings->GetPrefsKey($sTableId), null);
}
if ($sTableId != null) {
// An identified table, let's fetch its own settings (if any)
$pref = appUserPreferences::GetPref($oSettings->GetPrefsKey($sTableId), null);
}
if ($pref == null) {
if (!$bOnlyOnTable) {
// Try the global preferred values for this class / set of classes
$pref = appUserPreferences::GetPref($oSettings->GetPrefsKey(null), null);
}
if ($pref == null) {
// no such settings, use the default values provided by the data model
return null;
}
}
if ($pref == null) {
if (!$bOnlyOnTable) {
// Try the global preferred values for this class / set of classes
$pref = appUserPreferences::GetPref($oSettings->GetPrefsKey(null), null);
}
if ($pref == null) {
// no such settings, use the default values provided by the data model
return null;
}
}
$oSettings->unserialize($pref);
return $oSettings;
return $oSettings;
}
/**