mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-30 05:58:46 +02:00
The "Preferences" pages now allows a user to:
- change her/his favorite language - set a global default for the length of all lists, overriding the system-wide configuration. SVN:trunk[2138]
This commit is contained in:
@@ -761,7 +761,7 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
|
||||
|
||||
if ($bDisplayLimit)
|
||||
{
|
||||
$iDefaultPageSize = MetaModel::GetConfig()->GetMinDisplayLimit(); //TODO use user's prefs instead if any
|
||||
$iDefaultPageSize = appUserPreferences::GetPref('default_page_size', MetaModel::GetConfig()->GetMinDisplayLimit());
|
||||
$oSettings->iDefaultPageSize = $iDefaultPageSize;
|
||||
}
|
||||
|
||||
@@ -849,8 +849,6 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
|
||||
unset($aList[$sAlias][$index]);
|
||||
}
|
||||
}
|
||||
$iDefaultPageSize = MetaModel::GetConfig()->GetMinDisplayLimit();
|
||||
|
||||
}
|
||||
// Load only the requested columns
|
||||
$aAttToLoad = array(); // attributes to load
|
||||
@@ -863,8 +861,6 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
|
||||
}
|
||||
$oSet->OptimizeColumnLoad($aAttToLoad);
|
||||
|
||||
$iDefaultPageSize = MetaModel::GetConfig()->GetMinDisplayLimit();
|
||||
$iPageSize = MetaModel::GetConfig()->GetMinDisplayLimit();
|
||||
$sSelectMode = 'none';
|
||||
|
||||
$sClassAlias = $oSet->GetClassAlias();
|
||||
@@ -875,7 +871,7 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
|
||||
$bDisplayLimit = isset($aExtraParams['display_limit']) ? $aExtraParams['display_limit'] : true;
|
||||
if ($bDisplayLimit)
|
||||
{
|
||||
$iDefaultPageSize = MetaModel::GetConfig()->GetMinDisplayLimit(); //TODO use user's prefs instead if any
|
||||
$iDefaultPageSize = appUserPreferences::GetPref('default_page_size', MetaModel::GetConfig()->GetMinDisplayLimit());
|
||||
$oSettings->iDefaultPageSize = $iDefaultPageSize;
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ class DataTable
|
||||
$sHtml .= "<tr><td>$sPager</td><td class=\"menucontainer\">$sToolkitMenu</td></tr>\n";
|
||||
$sHtml .= "<tr><td class=\"datacontents\" colspan=\"2\">$sDataTable</td></tr>\n";
|
||||
$sHtml .= "</table>\n";
|
||||
$sHtml .= $sConfigDlg;
|
||||
$oPage->add_at_the_end($sConfigDlg);
|
||||
|
||||
$aOptions = array(
|
||||
'sPersistentId' => '',
|
||||
@@ -618,8 +618,7 @@ class DataTableSettings implements Serializable
|
||||
if ($aFieldData) $aColumns[$sAlias][$sAttCode] = $aFieldData;
|
||||
}
|
||||
}
|
||||
// TODO retrieve the user default page size or the system wide setting
|
||||
$iDefaultPageSize = MetaModel::GetConfig()->GetMinDisplayLimit();
|
||||
$iDefaultPageSize = appUserPreferences::GetPref('default_page_size', MetaModel::GetConfig()->GetMinDisplayLimit());
|
||||
$oSettings->Init($iDefaultPageSize, $aSortOrder, $aColumns);
|
||||
return $oSettings;
|
||||
}
|
||||
|
||||
@@ -647,6 +647,8 @@ EOF
|
||||
|
||||
if ($this->GetOutputFormat() == 'html')
|
||||
{
|
||||
$oAppContext = new ApplicationContext();
|
||||
|
||||
$sUserName = UserRights::GetUser();
|
||||
$sIsAdmin = UserRights::IsAdministrator() ? '(Administrator)' : '';
|
||||
if (UserRights::IsAdministrator())
|
||||
@@ -659,7 +661,7 @@ EOF
|
||||
}
|
||||
$sLogOffMenu = "<span id=\"logOffBtn\"><ul><li><img src=\"../images/onOffBtn.png\"><ul>";
|
||||
$sLogOffMenu .= "<li><span>$sLogonMessage</span></li>\n";
|
||||
$sLogOffMenu .= "<li><a href=\"".utils::GetAbsoluteUrlAppRoot()."pages/preferences.php\">".Dict::S('UI:Preferences')."</a></li>\n";
|
||||
$sLogOffMenu .= "<li><a href=\"".utils::GetAbsoluteUrlAppRoot()."pages/preferences.php?".$oAppContext->GetForLink()."\">".Dict::S('UI:Preferences')."</a></li>\n";
|
||||
|
||||
if (utils::CanLogOff())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user