Browse Source

- Fixed bug #226: Back button no longer uses the history "back" which is too unpredictable.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@792 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 14 years ago
parent
commit
2335ccbbc8
2 changed files with 7 additions and 1 deletions
  1. 1 1
      application/cmdbabstract.class.inc.php
  2. 6 0
      application/itopwebpage.class.inc.php

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

@@ -1267,7 +1267,7 @@ EOF
 		{
 			// The object does not exist in the database it's a creation
 			$oPage->add("<input type=\"hidden\" name=\"operation\" value=\"apply_new\">\n");			
-			$oPage->add("<button type=\"button\" class=\"action\" onClick=\"goBack()\"><span>".Dict::S('UI:Button:Cancel')."</span></button>&nbsp;&nbsp;&nbsp;&nbsp;\n");
+			$oPage->add("<button type=\"button\" class=\"action\" onClick=\"BackToList('$sClass')\"><span>".Dict::S('UI:Button:Cancel')."</span></button>&nbsp;&nbsp;&nbsp;&nbsp;\n");
 			$oPage->add("<button type=\"submit\" class=\"action\"><span>".Dict::S('UI:Button:Create')."</span></button>\n");
 		}
 		$oPage->add("</form>\n");

+ 6 - 0
application/itopwebpage.class.inc.php

@@ -294,6 +294,12 @@ EOF
 			window.location.href = './UI.php?operation=details&class='+sClass+'&id='+id;
 		}
 
+		
+		function BackToList(sClass)
+		{
+			window.location.href = './UI.php?operation=search_oql&oql_class='+sClass+'&oql_clause=WHERE id=0';
+		}
+
 		function ShowDebug()
 		{
 			if ($('#rawOutput > div').html() != '')