Cosmetics: the refresh button is now displayed as part of the "actions" at the top-right of the "details".

SVN:trunk[3756]
This commit is contained in:
Denis Flaven
2015-09-12 14:38:06 +00:00
parent d2e78d0292
commit 7f64982fc0
5 changed files with 32 additions and 6 deletions

View File

@@ -179,13 +179,10 @@ EOF
} }
$oPage->add("<div class=\"page_header\"><h1>".$this->GetIcon()."&nbsp;\n"); $oPage->add("<div class=\"page_header\"><h1>".$this->GetIcon()."&nbsp;\n");
if (!$oPage->IsPrintableVersion() && ($_SERVER['REQUEST_METHOD'] == 'GET'))
{
$aIcons[] = '<img src="../images/reload.png" style="cursor:pointer;vertical-align:middle;margin-left:1em;" onclick="window.location.reload();" title="'.htmlentities(Dict::S('UI:Button:Refresh'), ENT_QUOTES, 'UTF-8').'"/>';
}
// Master data sources // Master data sources
$bSynchronized = false; $bSynchronized = false;
$aIcons = array();
if (!$oPage->IsPrintableVersion()) if (!$oPage->IsPrintableVersion())
{ {
$oCreatorTask = null; $oCreatorTask = null;

View File

@@ -1382,6 +1382,7 @@ class MenuBlock extends DisplayBlock
} }
} }
$bIsCreationAllowed = (UserRights::IsActionAllowed($sClass, UR_ACTION_CREATE) == UR_ALLOWED_YES) && ($oReflectionClass->IsSubclassOf('cmdbAbstractObject')); $bIsCreationAllowed = (UserRights::IsActionAllowed($sClass, UR_ACTION_CREATE) == UR_ALLOWED_YES) && ($oReflectionClass->IsSubclassOf('cmdbAbstractObject'));
$sRefreshAction = '';
switch($oSet->Count()) switch($oSet->Count())
{ {
case 0: case 0:
@@ -1401,6 +1402,15 @@ class MenuBlock extends DisplayBlock
else else
{ {
$id = $oObj->GetKey(); $id = $oObj->GetKey();
if ($_SERVER['REQUEST_METHOD'] == 'GET')
{
$sRefreshAction = "window.location.reload();";
}
else
{
$sRefreshAction = "window.location.href='".ApplicationContext::MakeObjectUrl(get_class($oObj), $id)."';";
}
$bLocked = false; $bLocked = false;
if (MetaModel::GetConfig()->Get('concurrent_lock_enabled')) if (MetaModel::GetConfig()->Get('concurrent_lock_enabled'))
{ {
@@ -1673,6 +1683,10 @@ class MenuBlock extends DisplayBlock
} }
$sHtml .= $oPage->RenderPopupMenuItems($aActions, $aFavoriteActions); $sHtml .= $oPage->RenderPopupMenuItems($aActions, $aFavoriteActions);
if (!$oPage->IsPrintableVersion() && ($sRefreshAction!=''))
{
$sHtml .= "<div class=\"actions_button\" title=\"".htmlentities(Dict::S('UI:Button:Refresh'), ENT_QUOTES, 'UTF-8')."\"><span class=\"refresh-button\" onclick=\"$sRefreshAction\"></span></div>";
}
} }
static $bPopupScript = false; static $bPopupScript = false;

View File

@@ -2069,3 +2069,12 @@ select.multiselect {
} }
span.refresh-button {
display: inline-block;
width: 21px;
height: 18px;
cursor: pointer;
background: transparent url(../images/refresh-fff.png) left center no-repeat;
}

View File

@@ -302,7 +302,6 @@ input.textSearch {
border: 1px solid #7f9db9; border: 1px solid #7f9db9;
background: #fff url(../images/ac-background.gif) no-repeat right; background: #fff url(../images/ac-background.gif) no-repeat right;
} }
/* By Rom */ /* By Rom */
.csvimport_createobj { .csvimport_createobj {
color: #AA0000; color: #AA0000;
@@ -1525,3 +1524,10 @@ h2.printable-tab-title {
select.multiselect { select.multiselect {
max-width: 150px; max-width: 150px;
} }
span.refresh-button {
display: inline-block;
width: 21px;
height: 18px;
cursor: pointer;
background: transparent url(../images/refresh-fff.png) left center no-repeat;
}

BIN
images/refresh-fff.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B