When no_item_list or no_customer_list or no_supplier_list was checked in company...
[fa-stable.git] / includes / page / header.inc
index d71f39fe29e55a12fa5d56e0c5c91264f2e6e5ea..bf93e2d5e1bf15301a9c4bea8bc5a0bc3b1545a2 100644 (file)
@@ -32,7 +32,7 @@ function page_header($title, $no_menu=false, $is_index=false, $onload="", $js=""
        // titles and screen header
        global $db_connections, $path_to_root, $def_app, $applications,
                $help_base_url, $help_page_url, $use_popup_windows,
-               $js_lib, $js_static, $js_path;
+               $js_lib, $js_static, $js_path, $js_userlib, $comp_path;
 
        if (isset($_GET['ajax'])) return;
 
@@ -48,6 +48,7 @@ function page_header($title, $no_menu=false, $is_index=false, $onload="", $js=""
                $js = get_js_open_window(900, 500);
        }
 
+       add_js_user_num(); // add user native numeric input functions
        // javascript includes collect
        add_js_source($js);
        $js ='';
@@ -55,6 +56,10 @@ function page_header($title, $no_menu=false, $is_index=false, $onload="", $js=""
          $js .= '<script language="javascript" type="text/javascript" src="'.
                $js_path . $jsfile . '"></script>';
        }
+       foreach($js_userlib as $jsfile) {
+         $js .= '<script language="javascript" type="text/javascript" src="'.
+           $jsfile . '"></script>';
+       }
        foreach($js_lib as $text) {
          $js .= $text;
        }
@@ -72,10 +77,13 @@ function page_header($title, $no_menu=false, $is_index=false, $onload="", $js=""
        else
                $sel_app = $def_app;
        $_SESSION["sel_app"] = $sel_app;
+       $encoding = $_SESSION['language']->encoding;
 
-       echo "<html dir='" . $_SESSION['language']->dir . "' >";
+       if (!headers_sent()){
+               header("Content-type: text/html; charset='$encoding'");
+       }
+       echo "<html dir='" . $_SESSION['language']->dir . "' >\n";
        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";