- echo "<html dir='" . $_SESSION['language']->dir . "' >";
- echo "<head><title>$title</title>";
- $encoding = $_SESSION['language']->encoding;
- $local_stylesheet = $_SESSION['language']->get_stylesheet();
- echo "<meta http-equiv='Content-type' content='text/html'; charset='$encoding'>";
- echo "<link href='$local_path_to_root/themes/$theme/default.css' rel='stylesheet' type='text/css' /> \n";
- if (file_exists($local_path_to_root. "/".$local_stylesheet))
- echo "<link href='$local_path_to_root/$local_stylesheet' rel='stylesheet' type='text/css' /> \n";
- if ($js != "")
- echo $js;
- echo "</head> \n";
- if ($onload == "")
- echo "<body>";
- else
- echo "<body onload=\"$onload\">";
- echo "<script language='javascript' src='".
- $path_to_root. "/js/inserts.js' type='text/javascript'></script>\n";
- echo "<table class='callout_main' border='0' cellpadding='0' cellspacing='0'>\n";
- echo "<tr>\n";
- echo "<td colspan='2' rowspan='2'>\n";
-
- echo "<table class='main_page' border='0' cellpadding='0' cellspacing='0'>\n";
- echo "<tr>\n";
- echo "<td>\n";
- echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
- echo "<tr>\n";
- echo "<td class='quick_menu'>\n";
- if (!$no_menu)
- {
- echo "<table cellpadding=0 cellspacing=0 width='100%'><tr><td>";
- echo "<div class=tabs>";
- foreach($applications as $app => $name)
- {
- echo "<a ".($sel_app == $app ? "class='selected' " : "").
- "href='$local_path_to_root/index.php?application=".$app.
- SID ."'>" .$name . "</a>";
- }
- echo "</div>";
+ // When startup tab for current user was set to already
+ // removed/inactivated extension module select Sales tab as default.
+ if (isset($_SESSION["App"]) && is_object($_SESSION["App"]))
+ $_SESSION["App"]->selected_application =
+ isset($_SESSION["App"]->applications[$sel_app]) ? $sel_app : 'orders';