Browse Source

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

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3756 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 9 years ago
parent
commit
13eb7d918d

+ 1 - 4
application/cmdbabstract.class.inc.php

@@ -179,13 +179,10 @@ EOF
 		}
 
 		$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
 		$bSynchronized = false;
+		$aIcons = array();
 		if (!$oPage->IsPrintableVersion())
 		{
 			$oCreatorTask = null;

+ 15 - 1
application/displayblock.class.inc.php

@@ -1382,6 +1382,7 @@ class MenuBlock extends DisplayBlock
 			}
 		}
 		$bIsCreationAllowed = (UserRights::IsActionAllowed($sClass, UR_ACTION_CREATE) == UR_ALLOWED_YES) && ($oReflectionClass->IsSubclassOf('cmdbAbstractObject'));
+		$sRefreshAction = '';
 		switch($oSet->Count())
 		{
 			case 0:
@@ -1401,6 +1402,15 @@ class MenuBlock extends DisplayBlock
 			else
 			{
 				$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;
 				if (MetaModel::GetConfig()->Get('concurrent_lock_enabled'))
 				{
@@ -1671,8 +1681,12 @@ class MenuBlock extends DisplayBlock
 			{
 				$sHtml .= "<div class=\"itop_popup actions_menu\"><ul>\n<li>".Dict::S('UI:Menu:Actions')."\n<ul>\n";
 			}
-	
+				
 			$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;

+ 9 - 0
css/light-grey.css

@@ -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;
+}
+
+

+ 7 - 1
css/light-grey.scss

@@ -302,7 +302,6 @@ input.textSearch {
 	border: 1px solid #7f9db9;
 	background: #fff url(../images/ac-background.gif) no-repeat right;
 }
-
 /* By Rom */
 .csvimport_createobj {
     color: #AA0000;
@@ -1524,4 +1523,11 @@ h2.printable-tab-title {
 }
 select.multiselect {
 	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