Skip these checks if (stristr($_SERVER['SCRIPT_FILENAME'], "/") !== FALSE) { $_SESSION[$_PAGE_INFO['id']]['base'] = $_DEFAULT['base']; $_SESSION[$_PAGE_INFO['id']]['base_path'] = $_DEFAULT['base_path']; if (is_ReleaseCandidate()) { $_SESSION[$_PAGE_INFO['id']]['base'] = $_RELEASE['rc']['url'] . $_SESSION[$_PAGE_INFO['id']]['release_dir'] . "/"; $_SESSION[$_PAGE_INFO['id']]['base_path'] = $_RELEASE['rc']['dir'] . $_SESSION[$_PAGE_INFO['id']]['release_dir'] . "/"; } } /* * Check resolution */ $_PAGE_INFO['tablet'] = is_tablet(); /* * Project selected? */ $_PAGE_INFO['page_project'] = ""; if ((isset($_SESSION[$_PAGE_INFO['id']]['login']['project']['name'])) && (($_SESSION[$_PAGE_INFO['id']]['login']['project']['name'] != "skip") || ($_SESSION[$_PAGE_INFO['id']]['login']['project']['id'] != -1)) ) { $_PAGE_INFO['page_project'] = "&page_project=" . $_GET['page_project']; } /* * Define header main menu button and history link */ $_PAGE_INFO['MAIN_LINK'] = ""; if (db_ver_rights("hoofdmenu")) { $_PAGE_INFO['MAIN_LINK'] = "action/_a_project&link=page/menu&project=skip&project_id=-1"; } if (isset($_SESSION[$_PAGE_INFO['id']]['login']['project']['id'])) { $project = db_fetch_project($_SESSION[$_PAGE_INFO['id']]['login']['project']['id'], "", 1); // Project name removed!! $_PAGE_INFO['HIST_MAIN'] = _("Project info"); } else { $_PAGE_INFO['HIST_MAIN'] = _("Main menu"); } /* * Define skin */ // Skin defaults $_PAGE_INFO['default_skin'] = ($_PAGE_INFO['tablet']) ? "dualinventive_tablet" : "dualinventive"; $_PAGE_INFO['default_skin_name'] = "dualinventive"; // Define skin name $customer = db_fetch_customer($_SESSION[$_PAGE_INFO['id']]['login']['customer']['id'], 1); $_SESSION[$_PAGE_INFO['id']]['skin_name'] = _(strtolower($customer['skin'])); $_SESSION[$_PAGE_INFO['id']]['skin'] = ($_PAGE_INFO['tablet']) ? strtolower($customer['skin']) . "_tablet" : strtolower($customer['skin']); // Skin not available/not logged in => Default skin if ((!isset($_SESSION[$_PAGE_INFO['id']]['logged_on'])) || ((isset($_GET['href'])) && ($_GET['href'] == "page/login")) || (!strlen($_SESSION[$_PAGE_INFO['id']]['skin'])) || (!is_dir(SKIN_DIR . $_SESSION[$_PAGE_INFO['id']]['skin']))) { $_SESSION[$_PAGE_INFO['id']]['skin_name'] = _($_PAGE_INFO['default_skin_name']); $_SESSION[$_PAGE_INFO['id']]['skin'] = $_PAGE_INFO['default_skin']; } // Retrieve ini file skin $ini_file = get_all_files(SKIN_DIR . $_SESSION[$_PAGE_INFO['id']]['skin'] . "/", array("ini")); $_PAGE_INFO['ini'] = parse_ini_file($ini_file[0], true); // Update global variables UpdateGlobals(); /* * Define Header menu items */ if ((!isset($_SESSION[$_PAGE_INFO['id']]['logged_on'])) || ((isset($_GET['href'])) && ($_GET['href'] == "page/login"))) { $_PAGE_INFO['header_menu_buttons'] = array("WELCOME TO MTINFO 3000"); $_PAGE_INFO['header_menu_links'] = array(""); } else { $_PAGE_INFO['header_menu_buttons'] = array("MAIN MENU", "LOGOUT", "BACK", $_PAGE_INFO['ini']['news'][$_SESSION[$_PAGE_INFO['id']]['i18n']], "HELP"); $_PAGE_INFO['header_menu_links'] = array($_PAGE_INFO['MAIN_LINK'], PAGE_LOGIN, "javascript:window.history.back();", $_PAGE_INFO['ini']['news'][$_SESSION[$_PAGE_INFO['id']]['i18n'] . "_link"], "javascript:windowOpener('" . $_SESSION[$_PAGE_INFO['id']]['base'] . "?id=" . $_PAGE_INFO['id'] . "&href=page/help','mtinfo_help_menu','scrollbars=1,resizable=yes,width=600px,height=200px');"); $_PAGE_INFO['header_menu_oncontext'] = array("javascript:ShowPopup(this);", "", "", "", ""); } /** * Print the framework header * * Inputs: * - $extra_head_html: Extra HTML code to be inserted between the and tags. * Useful for including extra CSS and JavaScript * - $body_tag: The HTML tag. This parametrisable to allow extra JavaScript events * such as onload() */ function print_page_header($extra_head_html="", $body_tag = NULL) { GLOBAL $_PAGE_INFO; echo "\n"; echo "\n\n"; echo "\n"; echo ""; echo $_SESSION[$_PAGE_INFO['id']]['skin_name'] . " - " . ucfirst(_($_PAGE_INFO['page_title'])); echo "\n"; // Add google analytics ?>\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if (!isset($_SESSION[$_PAGE_INFO['id']]['extended_menu'])) { echo "\n"; } // Ibox stylesheets echo "\n"; echo "\n"; // New page/session? if (!is_dev("RS3000")) { echo "\n"; } // Calender multiple language support echo "\n"; // IE6 detection echo ""; // include stylesheets // Tablet and non-tablet if( !($_PAGE_INFO['tablet'] || is_mobile_browser()) ) { echo "\n"; $_PAGE_INFO['menu_button_sizes'] = ((isset($_SESSION[$_PAGE_INFO['id']]['logged_on'])) ? 196 : 335); if (browser() == "IE") { // Correct the standard CSS for IE echo "\n"; echo ""; echo ""; echo ""; } } else { echo "\n"; echo "\n"; $_PAGE_INFO['menu_button_sizes'] = ((isset($_SESSION[$_PAGE_INFO['id']]['logged_on'])) ? 196 : 335); if (browser() == "IE") { // Correct the standard CSS for IE echo "\n"; echo ""; echo ""; echo ""; } } if ($_GET['href'] == "page/menu_rt") { // CSS Realtime status echo "\n"; // CSS extended view if (isset($_SESSION[$_PAGE_INFO['id']]['extended_view'])) { echo "\n"; if ($_PAGE_INFO['tablet']) { echo "\n"; } } // rtstatus javascript echo "\n"; } if (isset($_SESSION[$_PAGE_INFO['id']]['extended_menu'])) { // CSS extended menu echo "\n"; if ($_PAGE_INFO['tablet']) { echo "\n"; } } // iBox support (including alternate stylesheets) echo "\n"; echo "\n"; // Hide Select controls echo ""; // Busy function echo "\n"; // Slideshow functionality if (!isset($_SESSION[$_PAGE_INFO['id']]['extended_menu'])) { echo "\n"; } // Define button functionality echo "\n"; // Create status div echo "
"; echo "
"; // Status function echo "\n"; // Temporary, global state for generic use echo "\n"; // Onclick event listener echo "\n"; // Set base echo "\n"; // Get icon $icon_image = SKIN_DIR . $_SESSION[$_PAGE_INFO['id']]['skin'] . "/" . $_PAGE_INFO['ini']['image']['icon']; if ((file_exists($icon_image)) && (strlen($_PAGE_INFO['ini']['image']['icon']))) { echo "\n"; } // Insert skin style sheets (when available) $css_files = get_all_files(SKIN_DIR . $_SESSION[$_PAGE_INFO['id']]['skin'] . "/css/", array("css")); if (is_array($css_files)) { foreach($css_files as $file) { echo "\n"; } } // Add extra head items echo $extra_head_html; echo "\n\n"; if( !$body_tag ) { $body_tag=""; } echo $body_tag . "\n"; // Add tooltips functionality echo "\n"; echo ""; // Header content (logo & header menu) if (!isset($_SESSION[$_PAGE_INFO['id']]['extended_menu'])) { echo "
\n"; echo "\n"; echo "
\n"; echo "\n"; echo "
\n"; // Show print icon if ((!is_tablet()) && ((Browser() != "IE") || (browser_version() > 7))) { $print_actions = array("project_info" , "project_new" , "project_duplicate" , "project_change" , "project_design" , "project_verify_design" , "project_validate_design" , "project_plan" , "project_verify_plan" , "project_validate_plan" , "project_release" , "project_return" , "lance_info" , "workorder_list" , "user_info" , "cust_info"); $print_pages = array("page/menu_report_live", "page/menu&page_project="); // Define printable pages $print_icon_visible = FALSE; // Printable action (with the exception of the search pages) if (((is_array($print_actions)) && (in_array($_SESSION[$_PAGE_INFO['id']]['action'], $print_actions))) && (stristr($_GET['href'], "_search") === FALSE)) { $print_icon_visible = TRUE; } // Printable href else if ((is_array($print_pages)) && (in_array($_GET['href'], $print_pages))) { $print_icon_visible = TRUE; } // Printable uri? else { if (is_array($print_pages)) { foreach($print_pages as $print_page) { if (stristr($_SERVER['REQUEST_URI'], $print_page) !== FALSE) { $print_icon_visible = TRUE; } } } } if ($print_icon_visible) { echo "
"; print_link_start("javascript:PrintLayout();", array('tip' => _("Print..."))); echo "\"\"\n"; print_link_end(); echo "
"; } } // Show refresh button (including cache clearing) echo "
"; print_link_start("javascript:xmlhttp_data('include/set_info.php','', 0,'" . $_SESSION[$_PAGE_INFO['id']]['base'] . "','" . $_PAGE_INFO['id'] . "','&clear_reload=1');javascript:location.reload();", array('tip' => _("Refresh"))); echo "\"\"\n"; print_link_end(); echo "
"; // Show screen mode icon if ((!isset($_SESSION[$_PAGE_INFO['id']]['extended_menu'])) && ((isset($_SESSION[$_PAGE_INFO['id']]['standard_view'])) || (isset($_SESSION[$_PAGE_INFO['id']]['extended_view'])))) { echo "
\n"; if (isset($_SESSION[$_PAGE_INFO['id']]['extended_view'])) { print_link_start( "?id=" . $_PAGE_INFO['id'] . "&href=page/menu_rt&action=" . $_SESSION[$_PAGE_INFO['id']]['action'] . $_PAGE_INFO['page_project'] . "&extended=0" . $rt_shortcuts, array( 'onclick' => "onclick_handler();", 'tip' => _("Standard view"), 'replace' => TRUE ) ); echo ""; echo "\"\"\n"; echo ""; print_link_end(); } else { print_link_start( "?id=" . $_PAGE_INFO['id'] . "&href=page/menu_rt&action=" . $_SESSION[$_PAGE_INFO['id']]['action'] . $_PAGE_INFO['page_project'] . "&extended=1" . $rt_shortcuts, array( 'onclick' => "onclick_handler();", 'tip' => _("Extended view"), 'replace' => TRUE ) ); echo ""; echo "\"\"\n"; echo ""; print_link_end(); } echo "
"; } // Insert Shortcuts from skin (when available) echo "
\n"; if ((is_array($_PAGE_INFO['ini']['link'])) && (!empty($_PAGE_INFO['ini']['link']))) { $i=0; foreach($_PAGE_INFO['ini']['link'] as $link => $key) { // Add link print_link($key, ucfirst(strtolower($link)), array('new_window' => TRUE)); // Increment counter $i++; } } // Version info echo "
" . (is_ReleaseCandidate() ? strtoupper($_SESSION[$_PAGE_INFO['id']]['release_dir']) : VERSION) . "
\n"; // Heartbeat if ((isset($_SESSION[$_PAGE_INFO['id']]['login']['user']['id'])) && (!isset($_SESSION[$_PAGE_INFO['id']]['extended_menu']))) { echo "\n"; echo "
\n"; echo "\"\"\n"; echo "\"\"\n"; echo "
\n"; } echo "
\n"; // Logo image $logo_svg = SKIN_DIR . $_SESSION[$_PAGE_INFO['id']]['skin'] . "/" . $_PAGE_INFO['ini']['image']['header_logo_svg']; $logo_image = SKIN_DIR . $_SESSION[$_PAGE_INFO['id']]['skin'] . "/" . $_PAGE_INFO['ini']['image']['header_logo']; if (((strlen($_PAGE_INFO['ini']['image']['header_logo_svg'])) && (file_exists($logo_svg))) && ((Browser() != "IE") || (browser_version() > 8))) { // Open the file $handle = fopen($logo_svg ,"r"); // Read SVG data echo fread($handle, filesize($logo_svg)); // close handle fclose($handle); } else if ((strlen($_PAGE_INFO['ini']['image']['header_logo'])) && (file_exists($logo_image))) { echo "\"\""; } echo "
\n\n"; echo "\n"; echo "
\n"; echo "
\n"; // Create header button divisions for ($i = 0; $i <= sizeof($_PAGE_INFO['header_menu_buttons']); $i++) { // Only separator? if ($i < sizeof($_PAGE_INFO['header_menu_buttons'])) { echo "
\n"; echo "\"\"\n"; // Create link or not if (!empty($_PAGE_INFO['header_menu_links'][$i])) { // Start with javascript: if (stristr($_PAGE_INFO['header_menu_links'][$i], "javascript:")) { print_link_start( $_PAGE_INFO['header_menu_links'][$i], array( 'style' => "height:100%; width:100%", 'onclick' => "onclick_handler();", 'oncontextmenu' => $_PAGE_INFO['header_menu_oncontext'][$i] ) ); } else { // Link to other host? $url_info = parse_url($_PAGE_INFO['header_menu_links'][$i]); if ((isset($url_info['host'])) && (stristr($url_info['host'], $_SESSION[$_PAGE_INFO['id']]['base']) === FALSE)) { print_link_start( $_PAGE_INFO['header_menu_links'][$i], array( 'new_window' => TRUE, 'style' => "height:100%; width:100%", 'onclick' => "onclick_handler();", 'oncontextmenu' => $_PAGE_INFO['header_menu_oncontext'][$i] ) ); } else { print_link_start( "?id=" . $_PAGE_INFO['id'] . "&href=" . $_PAGE_INFO['header_menu_links'][$i], array( 'style' => "height:100%; width:100%", 'onclick' => "onclick_handler();", 'oncontextmenu' => $_PAGE_INFO['header_menu_oncontext'][$i] ) ); } } } else { echo "
\n"; } echo _($_PAGE_INFO['header_menu_buttons'][$i]); if (!empty($_PAGE_INFO['header_menu_links'][$i])) { print_link_end(); } else { echo "
\n"; } } else { echo "
\n"; echo "\"\"\n"; } echo "
\n"; echo "\n"; } echo "
\n"; echo "
\n\n"; } // Insert project name if ((isset($_SESSION[$_PAGE_INFO['id']]['extended_view'])) && (isset($_SESSION[$_PAGE_INFO['id']]['login']['project']['id'])) && (!isset($_SESSION[$_PAGE_INFO['id']]['extended_menu']))) { echo "
\n"; $project = db_fetch_project($_SESSION[$_PAGE_INFO['id']]['login']['project']['id'], "", 1); echo htmlspecialchars($project['naam']); echo "
\n"; } // Header image & message of the day echo "\n"; if (!isset($_SESSION[$_PAGE_INFO['id']]['extended_menu'])) { echo "
\n"; echo "
\n"; if (!isset($_SESSION[$_PAGE_INFO['id']]['extended_view'])) { echo "
    \n"; // Get all header images $header_images = get_all_files(SKIN_DIR . $_SESSION[$_PAGE_INFO['id']]['skin'] . "/header/", array("jpg","png")); // Get all header label $header_labels = $_PAGE_INFO['ini']["header"]; // Check for i18n header labels if (isset($_PAGE_INFO['ini']["header_" . $_SESSION[$_PAGE_INFO['id']]['i18n']])) { $header_labels = $_PAGE_INFO['ini']["header_" . $_SESSION[$_PAGE_INFO['id']]['i18n']]; } if (is_array($header_images)) { // Define start image srand((double)microtime()*1000000); $start = rand() % (sizeof($header_images) - 1); for($i=0; $i\n"; echo "\"\"\n"; if (isset($header_labels)) { $label_index = rand() % (sizeof($header_labels) - 1); echo "
    "; // Search for extra actions (hyperlinks/etc.)? $header_value = explode(";", $header_labels["line" . $label_index]); echo "
    " . $header_value[0] . "
    "; if (isset($header_value[1])) { switch(trim(strtolower($header_value[1]))) { case "hyper_button": print_link( $header_value[3], utf8_encode($header_value[2]), array( 'id' => "header_button", 'new_window' => TRUE ) ); echo "
    \n"; break; default: echo utf8_encode($footer_value[0]) . "
    \n"; break; } } echo "
    "; } echo ""; } } echo "
"; } echo "
\n"; echo "
\n"; } // ibox workaround => preload image echo "
\n"; echo "\n"; // IE workaround => indicator does not work when preloaded if (browser() != "IE") { echo "\n"; } echo "
\n"; // Message of the day if ((isset($_SESSION[$_PAGE_INFO['id']]['login'])) && (!isset($_SESSION[$_PAGE_INFO['id']]['extended_menu']))) { $motd = db_fetch_system_maint_mes(); if (is_array($motd)) { foreach ($motd as $item) { if ($item['i18n'] == $_SESSION[$_PAGE_INFO['id']]['i18n']) { if (strlen($item['onderhoud'])) { echo "\n"; echo "
\n"; echo "
\n"; echo $item['onderhoud']; echo "
\n"; echo "
\n"; } else { echo "
\n"; echo "
\n"; } } } } } // Extended view & project if ((!isset($_SESSION[$_PAGE_INFO['id']]['extended_menu'])) && (isset($_SESSION[$_PAGE_INFO['id']]['extended_view']))) { print_link_start( "javascript:Extend_Menu('show','" . $_PAGE_INFO['id'] . "');", array('id' => "arrow_right_href") ); echo ""; print_image(FALSE, IMAGE_DIR . "arrow_right.png", array('id' => "arrow_right")); echo ""; print_link_end(); print_link_start( "javascript:Extend_Menu('hide','" . $_PAGE_INFO['id'] . "');", array('id' => "arrow_left_bg_href") ); print_image(FALSE, IMAGE_DIR . "arrow_left_bg.png", array('id' => "arrow_left_bg")); print_link_end(); print_link_start( "javascript:Extend_Menu('hide','" . $_PAGE_INFO['id'] . "');", array('id' => "arrow_left_href") ); echo ""; print_image(FALSE, IMAGE_DIR . "arrow_left.png", array('id' => "arrow_left")); echo ""; print_link_end(); } echo "
\n"; // Page content echo "\n"; echo "
\n"; echo "
\n"; if (!isset($_SESSION[$_PAGE_INFO['id']]['extended_menu'])) { echo "
\n"; // Login info if ((isset($_SESSION[$_PAGE_INFO['id']]['login'])) && (!isset($_SESSION[$_PAGE_INFO['id']]['extended_view']))) { echo "
"; echo "
\n"; echo "

" . _("Login info") . "

\n"; echo "
    \n"; $extra_user_info = ""; if (isset($_SESSION[$_PAGE_INFO['id']]['dbg']['enabled'])) { $extra_user_info = " (dbg "; if (isset($_SESSION[$_PAGE_INFO['id']]['dbg']['mask'])) { $extra_user_info .= strtoupper(dechex($_SESSION[$_PAGE_INFO['id']]['dbg']['mask'])); } else { $extra_user_info .= "0"; } $extra_user_info .= ")"; } $username = ucwords(getUser()) . $extra_user_info; // Redirect to user info page? if (db_ver_rights("menu:gebruikers&menu:gebruikers:zoeken,menu:gebruikers:root")) { print_link( "?id=" . $_PAGE_INFO['id'] . "&href=page/menu_user_info&action=user_info&login=1" . $_PAGE_INFO['page_project'], $username, array( 'onclick' => "onclick_handler();", 'tip' => array('auto' => 24), 'list' => TRUE ) ); } else { print_link( NULL, $username, array( 'tip' => array('auto' => 24), 'list' => TRUE ) ); } echo "
  • \n"; $customer = db_fetch_customer($_SESSION[$_PAGE_INFO['id']]['login']['customer']['id'], 1); $customername = ucfirst($customer['bedrijfsnaam']); // Redirect to customer info page? if (db_ver_rights("menu:klanten&menu:klanten:zoeken,menu:klanten:root")) { print_link( "?id=" . $_PAGE_INFO['id'] . "&href=page/menu_cust_info&action=cust_info&login=1" . $_PAGE_INFO['page_project'], $customername, array( 'onclick' => "onclick_handler();", 'tip' => array('auto' => 24), 'list' => TRUE ) ); } else { print_link( NULL, $customername, array( 'tip' => array('auto' => 24), 'list' => TRUE ) ); } // Display project name (when selected) if ((isset($_SESSION[$_PAGE_INFO['id']]['login']['project']['name'])) && (($_SESSION[$_PAGE_INFO['id']]['login']['project']['name'] != "skip") || ($_SESSION[$_PAGE_INFO['id']]['login']['project']['id'] != -1)) ) { echo "
  • \n"; $project = db_fetch_project($_SESSION[$_PAGE_INFO['id']]['login']['project']['id'], "", 1); $projectname = ucfirst($project['naam']); print_link( "?id=" . $_PAGE_INFO['id'] . "&href=page/menu" . $_PAGE_INFO['page_project'], _("Project") . ": " . $projectname, array( 'onclick' => "onclick_handler();", 'tip' => array('auto' => (24 - 12), 'text' => $projectname), 'list' => TRUE ) ); } // Display period name (when selected) if ((isset($_SESSION[$_PAGE_INFO['id']]['login']['project']['period'])) && (is_valid_action("lance_use_relay","switch_code"))) { echo "
  • \n"; print_link( NULL, _("Period") . ": " . $_SESSION[$_PAGE_INFO['id']]['project_info']["naam_" . $_SESSION[$_PAGE_INFO['id']]['login']['project']['period']], array( 'tip' => array('auto' => (24 - 12), 'text' => $_SESSION[$_PAGE_INFO['id']]['project_info']["naam_" . $_SESSION[$_PAGE_INFO['id']]['login']['project']['period']]), 'list' => TRUE ) ); } // Display number of unread messages (only login needed) $messages = db_fetch_messages_user($_SESSION[$_PAGE_INFO['id']]['login']['user']['id'], "marked"); $unread = (is_array($messages)) ? sizeof($messages) : 0; // Pop-up when new message has been received if ((isset($_SESSION[$_PAGE_INFO['id']]['unread_messages'])) && ($_SESSION[$_PAGE_INFO['id']]['unread_messages'] < $unread) && (!is_valid_action("messages_read", "messages_new", "messages_inbox"))) { $_SESSION[$_PAGE_INFO['id']]['errormsg']['text'] = _("New message received, go to inbox?"); $_SESSION[$_PAGE_INFO['id']]['errormsg']['type'] = "confirm"; $_SESSION[$_PAGE_INFO['id']]['errormsg']['redirect'] = "?id=" . $_PAGE_INFO['id'] . "&href=page/menu_messages&action=messages_inbox" . $_PAGE_INFO['page_project'] . ""; } $_SESSION[$_PAGE_INFO['id']]['unread_messages'] = $unread; echo "
  • \n"; print_link( "?id=" . $_PAGE_INFO['id'] . "&href=page/menu_messages&action=messages_inbox" . $_PAGE_INFO['page_project'], _("Inbox") . " (" . $_SESSION[$_PAGE_INFO['id']]['unread_messages'] . ")", array( 'onclick' => "onclick_handler();", 'list' => TRUE ) ); echo "
\n"; echo "
\n"; echo "
\n"; } // History menu (became menu structure!) if ((!empty($_PAGE_INFO['history_menu_buttons'])) && (!isset($_SESSION[$_PAGE_INFO['id']]['extended_view']))) { echo "
"; echo "
\n"; echo "

" . _("Menu structure") . "

\n"; echo "
    \n"; for ($i = 0; $i < sizeof($_PAGE_INFO['history_menu_buttons']); $i++) { if ($i) { echo "
  • \n"; } // Hyperlink? and catch project exception: no "magazijn" rigths => no projects page $projects = db_fetch_user_projects($_SESSION[$_PAGE_INFO['id']]['login']['user']['id'], "normaal"); $valid_project = 0; if (is_array($projects)) { foreach($projects as $project) { // Check for non-closed projects // normal project => planning status must be finished // rc project => planning and design status must be validated if (($project['status'] != "afgesloten") && ((($project['type'] == "normaal") && ($project['pstatus'] == "gereed")) || (($project['type'] == "rc") && (($project['pstatus'] == "gevalideerd") && ($project['ostatus'] == "gevalideerd"))))) { $valid_project = 1; } } } // Clip the name of an item in the menu structure (minding nearower letters) $value = _($_PAGE_INFO['history_menu_buttons'][$i]); if ((empty($_PAGE_INFO['history_menu_links'][$i])) || (($_PAGE_INFO['history_menu_links'][$i] == PAGE_PROJECT) && ((!db_ver_rights("menu:projecten:root,menu:projecten&projecten:d")))) && (!$valid_project) ) { // text only print_link( FALSE, $value, array( 'list' => TRUE, 'tip' => array('auto' => 24) ) ); } else { // menu link print_link( "?id=" . $_PAGE_INFO['id'] . "&href=" . $_PAGE_INFO['history_menu_links'][$i], $value, array( 'onclick' => "onclick_handler();", 'list' => TRUE, 'tip' => array('auto' => 24) ) ); } } // Current menu or screen if ($i) { echo "
  • \n"; } // Clip the name of an item in the menu structure (minding nearower letters) - JW20140327: clipping via CSS $value = $_SESSION[$_PAGE_INFO['id']]['title']; // text only print_link( FALSE, $value, array( 'list' => TRUE, 'tip' => array('auto' => 24), 'css_class' => "current" ) ); echo "
\n"; echo "
\n"; echo "
\n"; } // Shortcut menu if ((!empty($_PAGE_INFO['shortcut_menu_buttons'])) && (!isset($_SESSION[$_PAGE_INFO['id']]['extended_view']))) { echo "
"; echo "
\n"; echo "

" . _("Shortcuts") . "

\n"; echo "
    \n"; for ($i = 0; $i < sizeof($_PAGE_INFO['shortcut_menu_buttons']); $i++) { if ($i) { echo "
  • \n"; } // Hyperlink? $value = _($_PAGE_INFO['shortcut_menu_buttons'][$i]); if ((empty($_PAGE_INFO['shortcut_menu_links'][$i])) || ((strlen($_PAGE_INFO['shortcut_menu_rights'][$i])) && (!db_ver_rights($_PAGE_INFO['shortcut_menu_rights'][$i])))) { // text only print_link( FALSE, $value, array( 'list' => TRUE, 'tip' => array('auto' => 24) ) ); } else { // menu link print_link( (substr($_PAGE_INFO['shortcut_menu_links'][$i], 0, 11) == "javascript:") ? $_PAGE_INFO['shortcut_menu_links'][$i] : "?id=" . $_PAGE_INFO['id'] . "&href=" . $_PAGE_INFO['shortcut_menu_links'][$i], $value, array( 'onclick' => "onclick_handler();", 'list' => TRUE, 'tip' => array('auto' => 24), 'new_window' => (stristr($_PAGE_INFO['shortcut_menu_links'][$i], "&renew=1") !== FALSE) ) ); } } echo "
\n"; echo "
\n"; echo "
\n"; } echo "
\n"; // id="content_table_col1" } // Page content (forms, menus, etc) echo "
\n"; echo "
"; // Display extended menu if ((isset($_SESSION[$_PAGE_INFO['id']]['extended_view'])) && (!isset($_SESSION[$_PAGE_INFO['id']]['extended_menu']))) { echo "
\n"; // Store extended menu id when not exist if ((!isset($_SESSION[$_PAGE_INFO['id']]['extended_menu_id'])) || (!strlen($_SESSION[$_PAGE_INFO['id']]['extended_menu_id']))) { $_SESSION[$_PAGE_INFO['id']]['extended_menu_id'] = UniqSessionId(); } // Create iframe if (isset($_SESSION[$_PAGE_INFO['id']]['login']['project']['id'])) { // Project selected => lance use & shortcuts echo ""; } else { // No project selected => Select lances & shortcuts echo ""; } echo "
\n"; } } /** * Add xmlhttp request header * */ function print_xml_header($ypos = 0, $extra_header_HTML="") { global $_PAGE_INFO; // default options, can be set by passing an array through 'ypos' $active_element = FALSE; $onload = FALSE; $onunload = FALSE; if( is_array($ypos) ) { $options = $ypos; if( isset($options['y_position']) ) { $ypos = $options['y_position']; } else $ypos = 0; // default value when not set or passed as an argument if( isset($options['active_element']) ) { $active_element = $options['active_element']; if( ($at = strrpos($active_element, "@")) !== FALSE ) { $selection = explode(",", substr($active_element, $at + 1)); $active_element = substr($active_element, 0, $at); } } if( isset($options['onload']) ) $onload = $options['onload']; if( isset($options['onunload']) ) $onunload = $options['onunload']; } // Add extra header tags to include more JavaScript and CSS than usual $extra_header_HTML .= ""; $extra_header_HTML .= ""; // Show page header $body = ""; print_page_header($extra_header_HTML, $body); } /** * Print the framework footer */ function print_page_footer() { GLOBAL $_PAGE_INFO; echo "
"; // contextmenu popup menu if (!isset($_SESSION[$_PAGE_INFO['id']]['extended_menu'])) { echo "\n"; } echo "
\n"; // id="content_xmlhttp" echo "
\n"; // id="content_table_col1" echo "
\n"; // id="content_table" echo "
\n\n"; // id="content" if ((!isset($_SESSION[$_PAGE_INFO['id']]['extended_view'])) && (!isset($_SESSION[$_PAGE_INFO['id']]['extended_menu']))) { echo "\n"; echo "
\n"; echo "
\n"; // Get footer blocks (max 4 blocks) for ($i=0; $i < 4; $i++) { // Default block name $block = $_PAGE_INFO['ini']["footer" . $i]; // Check for i18n block name if (isset($_PAGE_INFO['ini']["footer" . $i . "_" . $_SESSION[$_PAGE_INFO['id']]['i18n']])) { $block = $_PAGE_INFO['ini']["footer" . $i . "_" . $_SESSION[$_PAGE_INFO['id']]['i18n']]; } if (isset($block)) { echo "
\n"; $found = TRUE; $count = 0; do { // Check if line exists $found = (isset($block["line" . $count])) ? $found : FALSE; if ($found) { if (!$count) { echo "

"; } // Search for extra actions (hyperlinks/images/etc.)? $footer_value = explode(";", $block["line" . $count]); if (isset($footer_value[1])) { switch(trim(strtolower($footer_value[1]))) { case "newsletter": echo ""; print_link( "javascript:xmlhttp_data( 'include/set_info.php','', 0,'" . $_SESSION[$_PAGE_INFO['id']]['base'] . "'," . "'" . $_PAGE_INFO['id'] . "'&newsletter=1&footerblock=" . $i . "&email=' + getElement('email').value);" . "getElement('email').value='" . _("email") . " " . strtolower(_("Adres")) . "';" . "return false;", ">>", array('id' => "footer_button") ); break; case "hyper_button": print_link( $footer_value[2], utf8_encode($footer_value[0]), array('id' => "footer_button", 'new_window' => TRUE) ); break; case "hyper": print_link( $footer_value[2], utf8_encode($footer_value[0]), array('new_window' => TRUE) ); break; case "hyper_twitter": print_link( $footer_value[2], utf8_encode($footer_value[0]), array('new_window' => TRUE) ); echo ""; echo ""; print_image(FALSE, IMAGE_DIR . "twit-bird.png", array('id' => "twit-bird", 'alt' => "twitter")); echo ""; echo "
"; break; case "last_tweets": // To be sure the twitter functionality is available require_once("twitter.php"); $timeline = TwitterPublicTimeline(trim($footer_value[2])); echo ""; echo "
"; echo "
"; echo ""; echo "
"; if (is_array($timeline)) { echo "
    "; echo "
    "; foreach($timeline as $item) { echo "
  • "; echo $item['user'] . ": " . $item['text']; echo "
  • "; } echo "
    "; echo "
"; } echo "
"; if (sizeof($timeline) > 1) { echo "\n"; } break; case "media_icons": // Initial values $icons_found = TRUE; $icons_count = 0; echo "
"; do { $icons_found = (isset($footer_value[2 + $icons_count])) ? $icons_found : FALSE; if ($icons_found) { switch(trim(strtolower($footer_value[2 + $icons_count]))) { case "facebook": print_link_start( $footer_value[3 + $icons_count], array('new_window' => TRUE) ); echo ""; print_image(FALSE, IMAGE_DIR . "icon_facebook.png", array('css_class' => "social_media_icons", 'id' => "social_media_icons", 'alt' => "Facebook")); echo ""; print_link_end(); break; case "linked_in": print_link_start( $footer_value[3 + $icons_count], array('new_window' => TRUE) ); echo ""; print_image(FALSE, IMAGE_DIR . "icon_linkedin.png", array('css_class' => "social_media_icons", 'id' => "social_media_icons", 'alt' => "LinkedIn")); echo ""; print_link_end(); break; case "youtube": print_link_start( $footer_value[3 + $icons_count], array('new_window' => TRUE) ); echo ""; print_image(FALSE, IMAGE_DIR . "icon_youtube.png", array('css_class' => "social_media_icons", 'id' => "social_media_icons", 'alt' => "YouTube")); echo ""; print_link_end(); break; default: break; } } // Increment icon counter $icons_count++; } while ($icons_found); echo "
"; break; default: echo utf8_encode($footer_value[0]) . "
"; break; } } else { echo utf8_encode($footer_value[0]) . "
"; } if (!$count) { echo "

"; } } // Increment line counter $count++; } while ($found); echo "
\n"; } } echo "
\n"; echo "
\n\n"; } // Define extended view div height (content div) if ((isset($_SESSION[$_PAGE_INFO['id']]['extended_view'])) && (!isset($_SESSION[$_PAGE_INFO['id']]['extended_menu']))) { echo "\n"; } // Display error alert/confirm message? echo "
\n"; echo "
\n"; // Project & Right checker (recursive funtion, only the parent!) if ((isset($_SESSION[$_PAGE_INFO['id']]['login']['user']['id'])) && (!isset($_SESSION[$_PAGE_INFO['id']]['extended_menu']))) { // Project defined? $project = (isset($_SESSION[$_PAGE_INFO['id']]['login']['project']['id'])) ? "&project=" . $_SESSION[$_PAGE_INFO['id']]['login']['project']['id'] : ""; $csrf_token = csrf_create_token("status_check"); echo ""; } // Display debug info if (!isset($_SESSION[$_PAGE_INFO['id']]['extended_view'])) { echo "
\n"; include("include/debug_info.php"); echo "
\n"; } // Include errormessage include("include/errormsg.php"); echo "\n\n"; echo "\n"; } /** * Verify Rights (login), valid project (when req) and log page * * Inputs: * - rights Rights needed for current page * - menu menu name which will be logged in db * - log_info extra db log info (optional) * * Return: 1 (ok)/0 (false) */ function Ver_Rights_Project_Log($rights, $menu = "", $log_info = "") { global $_PAGE_INFO; // Initial return value $result = 0; // Verify "login" rights and check if user is allowed at this time (begin/end date)! if (db_ver_rights("login")) { // Verify if the user is still on the selected project and check if the project is still running if (isset($_SESSION[$_PAGE_INFO['id']]['login']['project']['id'])) { $valid_project = 0; $row_users = db_fetch_project_users($_SESSION[$_PAGE_INFO['id']]['login']['project']['id'], "", array("normaal","wbu","wbv")); if (is_array($row_users)) { foreach ($row_users as $row_user) { if ($row_user['id'] == $_SESSION[$_PAGE_INFO['id']]['login']['user']['id']) { $valid_project = 1; } } } if ($valid_project) { // Retrieve project info $row_project = db_fetch_project($_SESSION[$_PAGE_INFO['id']]['login']['project']['id'], "", 1); // Check for non-closed projects // normal project => planning status must be finished // rc project => planning and design status must be validated and the project must be released // App => Also show projects which are ready for release if (($row_project['status'] == "afgesloten") || ((($row_project['type'] == "normaal") && ($row_project['pstatus'] != "gereed")) || (($row_project['type'] == "rc") && (($row_project['pstatus'] != "gevalideerd") || ($row_project['ostatus'] != "gevalideerd") || ($row_project['sstatus'] != "vrijgegeven"))))) { //(($row_project['sstatus'] != "vrijgegeven") && (!is_dev("APP"))))))) { $valid_project = 0; } } } else { // No project selected $valid_project = 1; } if ($valid_project) { // Verify rights for current menu if ((empty($rights)) || ($rights == "login") || (db_ver_rights($rights))) { // Valid $result = 1; // Get link $href = get_page_href(); // Log action to db? if (($_SESSION[$_PAGE_INFO['id']]['href_history'] != $href) && (strlen($menu))) { // Log data if (is_array($log_info)) { switch($log_info['table']) { case "log_gebruiker_project": $_PAGE_INFO['user_log_id'] = db_log_user_project($log_info['project_id'], $menu, $log_info['log_info']); break; default: break; } } else { $_PAGE_INFO['user_log_id'] = db_log_user($menu, $log_info); } // Store var (help function) $_SESSION[$_PAGE_INFO['id']]['MTinfo_menu'] = $menu; } // href changed? => Store old value! if ($_SESSION[$_PAGE_INFO['id']]['href_history'] != $href) { store_history($href); } } else { // Redirect page back to login page force_logout("No user rights", "No user rights: " . current_action(TRUE)); } } else { // Redirect page back to login page force_logout("No valid project", "Invalid project: " . current_action(TRUE)); } } else { // Redirect page back to login page force_logout("Account has been blocked", "Account blocked: " . getUser($_SESSION[$_PAGE_INFO['id']]['login']['user']['id']) . " [" . $_SESSION[$_PAGE_INFO['id']]['login']['user']['id'] . "]: " . current_action(TRUE)); } return $result; } ?>