* * * [2.] Insert JS-Lib. for navigation library (preparsed by PHP): * * [3.] Insert PHP-Parameter for output (menu, reduced menu, page title) into body of the page * Attention: Do not forget the onLoad calls !!! * * * * * [4.] Insert PHP-Parameter for storing current navigation item in *
... ...
=================================================================================*/ include_once ("../include/global.inc.php"); include_once ("../include/auth.inc.php"); include_once ("../include/inc_user.inc.php"); // Check HTTP-Parameters $httpVars = array("statusMessage", "currentNavigationItem", "menuActiveByPageTitel", "deactivateMenu"); getSecHttpVars("1", $httpVars); getLanguage(__FILE__); // Check parameter to disable menu if ($deactivateMenuStatic == "1" || $deactivateMenu == "1") : $menuDisabled = true; endif; if (!isset($menuDisabled)) : $menuDisabled = false; endif; if ($menuActiveByPageTitel == "1") : $menuActiveByPageTitel = true; elseif ($menuActiveByPageTitel == "0") : $menuActiveByPageTitel = false; else : $menuActiveByPageTitel = false; endif; // Check for used JS framework if ($usedFramework != "1" && $usedFramework != "2") : $usedFramework = getParameterValue("0", "FRAMEWORK_USED", "0", "0"); if ($usedFramework != "1" && $usedFramework != "2") : $usedFramework = "1"; endif; endif; // Check kind of user agent $isFirefox = true; if (strpos($_SERVER['HTTP_USER_AGENT'], "Firefox") === false) { $isFirefox = false; } $browser = $_SERVER['HTTP_USER_AGENT'] . "\n\n

"; $browserOk = false; if (!(strpos($browser, "Firefox") === false)) : $browserOk = true; endif; if (!$browserOk && !(strpos($browser, "FIREFOX") === false)) : $browserOk = true; endif; if (!$browserOk && !(strpos($browser, "Edge") === false)) : $browserOk = true; endif; if (!$browserOk && !(strpos($browser, "Chrome") === false)) : $browserOk = true; endif; // Get user type $userType = getFieldValueFromId("user","usr_id",$usr_id,"usr_type"); // Get hq_workmode $hq_workmode = getFieldValueFromId("headquarters","hq_id",$hq_id,"hq_workmode"); // Get the rights of the employee logged in $empRights = getRights($emp_id); // Current activated navigation item if ($currentNavigationItem == "") : $currentNavigationItem = ""; endif; $currentNavigationLevel = 0; // Get displayed background colors of the employee $constMaskContentBgCol = getParameterValue($emp_id, "MASK_CONTENT_BGCOL", $hq_id); // Constants $constMenuItemWidth = "100px"; $constMenuColWidth = "100px"; $constBackground = "#CDD9FD"; $constMenuBackground = array(); $constMenuBackground[0] = "#1b12b9"; $constMenuBackground[1] = "#1b12b9"; $constMenuBackground[2] = "#4e45ec"; $constMenuBackground[3] = "#97bcFF"; $constMenuBackgroundImage = array(); $constMenuBackgroundImage[0] = "spacer_blue_menu_01.jpg"; $constMenuBackgroundImage[1] = "spacer_blue_menu_01.jpg"; $constMenuBackgroundImage[2] = "spacer_blue_menu_02.jpg"; $constMenuBackgroundImage[3] = "spacer_blue_menu_03.jpg"; $constMenuColor = array(); $constMenuColor[0] = "#FFFFFF"; $constMenuColor[1] = "#FFFFFF"; $constMenuColor[2] = "#FFFFFF"; $constMenuColor[3] = "#FFFFFF"; $constMaincontentBackground = "#CDD9FD"; $constMaincontent2Background = "#CDD9FD"; $constButtonBackground = "#54b8fb"; // Classic dark blue: #1b12b9 $constButtonColor = "#000000"; // #FFFFFF $constButtonColor2 = "#4e45ec"; $constButtonOnMouseOverColor = "#FFFFFF"; // #97bcFF $constListBgCol1 = "#AAAAFF"; $constListBgCol2 = "#AAAAFF"; $constListBgCol3 = "#CCCCFF"; $constListBgCol4 = "#CCCCFF"; $constPageHeadlineBgCol = "#1b12b9"; $constTickerBgCol = "#CDD9FD"; // Overwrite colors by employee parameter if ($constMaskContentBgCol == "1") : $constBackground = "#DDDDDD"; $constMaincontentBackground = "#DDDDDD"; $constMaincontent2Background = "#DDDDDD"; $constButtonBackground = "#AAAAAA"; $constButtonColor = "#FFFFFF"; $constButtonColor2 = "#000000"; $constButtonOnMouseOverColor = "#444444"; $constListBgCol1 = "#AAAAAA"; $constListBgCol2 = "#AAAAAA"; $constListBgCol3 = "#CCCCCC"; $constListBgCol4 = "#CCCCCC"; $constPageHeadlineBgCol = "#888888"; $constTickerBgCol = "#CDD9FD"; endif; // ***************************************************************** // Navigation deep of the headquarters menu, number of sublevels $jsMenuNavigationDeep = 2; // Definition of the headquarters menu structure $idColContainer = array(); $idColContainer[0] = array("menu_00"); $idColContainer[1] = array("menu_01", "menu_02", "menu_03"); $idColContainer[2] = array("menu_01_01", "menu_01_02", "menu_01_03", "menu_01_04", "menu_01_05", "menu_02_01", "menu_03_01", "menu_04_01", "menu_05_01"); // $idColContainer[3] = array("menu_01_02_01", "menu_01_02_02", "menu_01_02_03", "menu_01_02_04", "menu_01_02_05", "menu_01_02_06"); $idColContainer[3] = array("menu_01_02_01", "menu_01_02_02", "menu_01_02_03", "menu_01_02_05", "menu_01_02_06"); // Without "G�ter" /* Frachtverg�tungsmatrizen (leider nicht genutzt): $idColContainer[3] = array("menu_01_02_01", "menu_01_02_07", "menu_01_02_02", "menu_01_02_08", "menu_01_02_03", "menu_01_02_04", "menu_01_02_05", "menu_01_02_06"); */ // The array consists of "name", "URL", "target" and "menu access". // The first dimension is defined according to the (sub)menu level $menu[0]["impressum"] = array(getLngt("Impressum"), "javascript:mkImpressumPopupWin();", "", "", "", "2", array(), "1", ""); if ($userType == "1") : $menu[0]["sprache"] = array(getLngt("Sprache"), "javascript:mkLanguagePopupWin();", "", "", "", "2", array(), "1", ""); endif; $menu[0]["abmelden"] = array(getLngt("Abmelden"), "../admin/logout.php", "_top", "", "1", "2", array(), "", ""); // Headquarter if ($userType == "1") : // Get db-parameter for the number of lists (frames) to be displayed of the current employee $empMaskMultiJoblist = getParameterValue($emp_id, "MASK_MULTI_JOBLIST"); $empMaskMultiJoblistMax = getParameterValue("0", "MASK_MULTI_JOBLIST_MAX", $hq_id); if (!(is_numeric($empMaskMultiJoblist) && $empMaskMultiJoblist > 0 && $empMaskMultiJoblist <= $empMaskMultiJoblistMax)) : $empMaskMultiJoblist = getParameterValue("0", "MASK_MULTI_JOBLIST", $hq_id); if (!(is_numeric($empMaskMultiJoblist)) || !($empMaskMultiJoblist > 0)) : $empMaskMultiJoblist = "4"; endif; endif; // Define items // [0]: Displayed text // [1]: URL // [2]: Target // [3]: Access right // [4]: (= "1") <=> Defines last item of the current container like "menu_01_01" // [5]: (= "1") <=> Disables (!) container actions ("onMouseover", "onMouseout", "onClick") // (= "2") <=> Disables (!) ONLY container action "onClick" // [6]: Array of containers be visible by hovering and click // [7]: (= "1") <=> Disables (!) navigation suffix "?currentNavigationItem=..." in navigation link // [8]: String of GET-parameters added to the navigation link $menu[1]["verwaltung"] = array(getLngt("Verwaltung"), "#", "", "", "", "", array("menu_01_01","menu_01_02","menu_01_03","menu_01_04","menu_01_05"), "1", ""); $menu[1]["auftraege"] = array(getLngt("Auftr�ge"), "#", "", "", "", "", array("menu_02_01"), "1", ""); $menu[1]["listen"] = array(getLngt("Listen"), "../admin/jb_list_fs.php?maskNumOfWins=" . $empMaskMultiJoblist, "_blank", substr($empRights,4,1), "1", "", array(), "1", ""); $menu[1]["rechnungen"] = array(getLngt("Rechnungen"), "#", "", "", "", "", array("menu_03_01"), "1", ""); $menu[1]["vertrieb"] = array(getLngt("Vertrieb"), "../groupware/appointment.php", "", substr($empRights,11,1), "", "", array(), "", ""); $menu[1]["nachrichten"] = array(getLngt("Nachrichten"), "#", "", "", "1", "", array("menu_04_01"), "1", ""); $menu[1]["datentransfer"] = array(getLngt("Datentransfer"), "#", "", "", "", "", array("menu_05_01"), "1", ""); $menu[1]["statistik"] = array(getLngt("Statistik"), "../statistic/statistic.php", "", substr($empRights,8,1), "", "", array(), "", ""); $menu[1]["formulare"] = array(getLngt("Formulare"), "../admin/metafield_editor.php", "", substr($empRights,15,1), "1", "", array(), "", ""); $menu[2]["kunden"] = array(getLngt("Kunden"), "../admin/customer_list.php", "", substr($empRights,0,1), "", "", array(), "", ""); $menu[2]["transporteure"] = array(getLngt("Transporteure"), "../admin/courier_list.php", "", substr($empRights,1,1), "", "", array(), "", ""); $menu[2]["map"] = array(getLngt("Karten�bersicht"), "../locating/map.php", "_blank", substr($empRights,19,1), "1", "", array(), "", ""); // $menu[2]["gueter"] = array(getLngt("G�ter"), "#", "", "", "", "", array("menu_01_02_04"), "1", ""); $menu[2]["berichte"] = array(getLngt("Berichte"), "#", "", "", "", "", array("menu_01_02_06"), "1", ""); $menu[2]["preise"] = array(getLngt("Preise"), "#", "", "", "", "", array("menu_01_02_01"), "1", ""); $menu[2]["rabatte"] = array(getLngt("Rabatte"), "#", "", "", "1", "", array("menu_01_02_02"), "1", ""); /* Frachtverg�tungsmatrizen (leider nicht genutzt): $menu[2]["preise"] = array(getLngt("Preise/Frachtverg."), "#", "", "", "", "", array("menu_01_02_01","menu_01_02_07"), "1", ""); $menu[2]["rabatte"] = array(getLngt("Rabatte"), "#", "", "", "1", "", array("menu_01_02_02","menu_01_02_08"), "1", ""); */ // $menu[2]["mitarbeiter"] = array(getLngt("Mitarbeiter"), "../admin/employee_list.php", "", "", "", "", array(), "", ""); // substr($empRights,3,1); // $menu[2]["mitarbeiter"] = array(getLngt("Mitarbeiter"), "#", "", "", "", "", array("menu_01_02_05"), "1", ""); $menu[2]["niederlassungen"] = array(getLngt("Niederlassungen"), "#", "", "", "", "", array("menu_01_02_05"), "1", ""); $menu[2]["feiertage"] = array(getLngt("Feiertage"), "../admin/public_holiday.php", "", substr($empRights,2,1), "", "", array(), "", ""); $menu[2]["anfahrtszeiten"] = array(getLngt("Anfahrtszeiten"), "../admin/traveltime.php", "", substr($empRights,2,1), "1", "", array(), "", ""); // $menu[2]["adressen"] = array(getLngt("Adressen"), "../admin/ad_admin.php", "", max(substr($empRights,0,1),substr($empRights,1,1)), "1", "", array(), "", ""); $menu[2]["adressen"] = array(getLngt("Adressen"), "#", "", "", "", "", array("menu_01_02_03"), "1", ""); $menu[2]["gruppen"] = array(getLngt("Gruppen"), "../admin/group.php", "", substr($empRights,8,1), "", "", array(), "", ""); // $menu[2]["kontakte"] = array(getLngt("Kontakte"), "../admin/metafield_list.php", "", substr($empRights,11,1), "1", "", array(), "", "category=" . ec("1") . "&categoryPageTitel=KONTAKTE"); // $menu[2]["extras"] = array(getLngt("Kessel Buntes"), "..//tools/statistic_finishment.php", "_blank", substr($empRights,46,1), "1", "", array(), "", ""); $menu[2]["filter"] = array(getLngt("Filter"), "../admin/filter.php", "", substr($empRights,32,1), "1", "", array(), "", "crf_admin=" . ec("100") . ""); // $menu[2]["berichte"] = array(getLngt("Berichte"), "#", "", "", "", "", array("menu_01_02_06"), "1", ""); $menu[2]["bewertung"] = array(getLngt("Bewertungen"), "../admin/metafield_list.php", "", substr($empRights,8,1), "", "", array(), "", "category=" . ec("15") . "&objId=1&categoryPageTitel=BEWERTUNGEN&f_act_mtfl=search&viewItemsMode=0"); // $menu[2]["filter"] = array(getLngt("Filter"), "../admin/filter.php", "", substr($empRights,32,1), "1", "", array(), "", "crf_admin=" . ec("100") . ""); $menu[2]["extras"] = array(getLngt("Kessel Buntes"), "..//tools/statistic_finishment.php", "_blank", substr($empRights,46,1), "1", "", array(), "", ""); $maskSingleJobedit = getParameterValue("0", "MASK_SINGLE_JOBEDIT", $hq_id); if ($maskSingleJobedit == "1") : $menu[2]["erfassung"] = array(getLngt("Einzelerfassung"), "javascript:actionEvent('job_edit')", "", substr($empRights,7,1), "", "", array(), "1", ""); else : $menu[2]["erfassung"] = array(getLngt("Einzelerfassung"), "../jobs/job_edit.php", "_blank", substr($empRights,7,1), "", "", array(), "", ""); endif; $menu[2]["listenerfassung"] = array(getLngt("Listenerfassung"), "../jobs/jb_edit_batch.php", "", substr($empRights,7,1), "1", "", array(), "", ""); // $menu[2]["disposition"] = array(getLngt("Disposition"), "javascript:openVehicleDisposition();", "", substr($empRights,7,1), "1", "", array(), "1", ""); // if (MASK_SINGLE_INVOICE == "1") : $menu[2]["uebersicht"] = array(getLngt("�bersicht"), "../invoice/invoice.php", "", substr($empRights,5,1), "", "", array(), "", ""); // else : // $menu[2]["uebersicht"] = array(getLngt("�bersicht"), "../invoice/invoice.php", "_blank", substr($empRights,5,1), "", "", array(), "", ""); // endif; $menu[2]["pdf_ausgabe"] = array(getLngt("PDF-Ausgabe"), "../jobs/jb_inv_assoc.php", "", substr($empRights,5,1), "", "", array(), "", ""); $menu[2]["csv_ausgabe"] = array(getLngt("CSV-Ausgabe"), "../jobs/jb_exp_csv.php", "", substr($empRights,5,1), "1", "", array(), "", ""); $menu[2]["devices"] = array(getLngt("Endger�te"), "../admin/mf_history.php", "", substr($empRights,4,1), "", "", array(), "", ""); $menu[2]["newsticker"] = array(getLngt("Mitteilungen"), "../admin/newsticker.php", "", substr($empRights,18,1), "", "", array(), "", ""); $menu[2]["newsletter"] = array(getLngt("Newsletter"), "../admin/metafield_list.php", "", substr($empRights,17,1), "1", "", array(), "", "category=" . ec("10") . "&objId=1&categoryPageTitel=NEWSLETTER&f_act_mtfl=search&viewItemsMode=0"); $menu[2]["datenexport"] = array(getLngt("Datenexport"), "../export/export.php", "", substr($empRights,6,1), "", "", array(), "", ""); $menu[2]["datenimport"] = array(getLngt("Datenimport"), "../import/data_transfer.php", "", (substr($empRights,22,1) == "1" || substr($empRights,23,1) == "1" ? "1" : "0"), "", "", array(), "", ""); $menu[3]["servicepreise"] = array(getLngt("Servicepreise"), "../admin/services.php", "", (substr($empRights,2,1) == "1" && substr($empRights,29,1) == "1" ? "1" : "0"), "", "", array(), "", "mode=price"); $menu[3]["plz_preise"] = array(getLngt("PLZ-Preise"), "../admin/services_plz.php", "", (substr($empRights,2,1) == "1" && substr($empRights,29,1) == "1" ? "1" : "0"), "", "", array(), "", "mode=price"); $menu[3]["bereichspreise"] = array(getLngt("Bereichspreise"), "../admin/services_plz_area.php", "", (substr($empRights,2,1) == "1" && substr($empRights,29,1) == "1" ? "1" : "0"), "1", "", array(), "", "mode=price"); /* Frachtverg�tungsmatrizen (leider nicht genutzt): $menu[3]["servicefuhrlohn"] = array(getLngt("Servicefrachtverg."), "../admin/services.php", "", (substr($empRights,2,1) == "1" && substr($empRights,29,1) == "1" ? "1" : "0"), "", "", array(), "", "mode=price&csId=-1"); // $menu[3]["servicefuhrlohn"] = array(getLngt("Servicefrachtverg."), "../admin/services.php", "", "0", "", "", array(), "", "mode=price&csId=-1"); $menu[3]["plz_fuhrlohn"] = array(getLngt("PLZ-Frachtverg."), "../admin/services_plz.php", "", (substr($empRights,2,1) == "1" && substr($empRights,29,1) == "1" ? "1" : "0"), "", "", array(), "", "mode=price&csId=-1"); $menu[3]["bereichsfuhrlohn"] = array(getLngt("Bereichsfrachtverg."), "../admin/services_plz_area.php", "", (substr($empRights,2,1) == "1" && substr($empRights,29,1) == "1" ? "1" : "0"), "1", "", array(), "", "mode=price&csId=-1"); */ $menu[3]["servicerabatte"] = array(getLngt("Servicerabatte"), "../admin/services.php", "", (substr($empRights,2,1) == "1" && substr($empRights,29,1) == "1" ? "1" : "0"), "", "", array(), "", "mode=discount"); $menu[3]["plz_rabatte"] = array(getLngt("PLZ-Rabatte"), "../admin/services_plz.php", "", (substr($empRights,2,1) == "1" && substr($empRights,29,1) == "1" ? "1" : "0"), "", "", array(), "", "mode=discount"); $menu[3]["bereichsrabatte"] = array(getLngt("Bereichsrabatte"), "../admin/services_plz_area.php", "", (substr($empRights,2,1) == "1" && substr($empRights,29,1) == "1" ? "1" : "0"), "1", "", array(), "", "mode=discount"); /* Frachtverg�tungsmatrizen (leider nicht genutzt): $menu[3]["servicefuhrlohnrabatte"] = array(getLngt("Srv-Fv.-Rab."), "../admin/services.php", "", (substr($empRights,2,1) == "1" && substr($empRights,29,1) == "1" ? "1" : "0"), "", "", array(), "", "mode=discount&csId=-1"); $menu[3]["plz_fuhrlohnrabatte"] = array(getLngt("PLZ-Fv.-Rabatte"), "../admin/services_plz.php", "", (substr($empRights,2,1) == "1" && substr($empRights,29,1) == "1" ? "1" : "0"), "", "", array(), "", "mode=discount&csId=-1"); $menu[3]["bereichsfuhrlohnrabatte"] = array(getLngt("Bereichsfrachtv.rab."), "../admin/services_plz_area.php", "", (substr($empRights,2,1) == "1" && substr($empRights,29,1) == "1" ? "1" : "0"), "1", "", array(), "", "mode=discount&csId=-1"); */ $menu[3]["adressenverwaltung"] = array(getLngt("Allgemein"), "../admin/ad_admin.php", "", substr($empRights,2,1), "", "", array(), "", ""); $menu[3]["plz_adressen"] = array(getLngt("PLZ-Adressen"), "../admin/srvpa_list.php", "", substr($empRights,2,1), "", "", array(), "", ""); $menu[3]["bereichsadressen"] = array(getLngt("Bereichsadr."), "../admin/srvpaa_list.php", "", substr($empRights,2,1), "1", "", array(), "", ""); /* $menu[3]["serviceeinheit"] = array(getLngt("Serviceeinheiten"), "../stock/article_list.php", "", substr($empRights,14,1), "", "", array(), "", "objecttypemode=" . ec("1")); $menu[3]["artikel"] = array(getLngt("Artikel"), "../stock/article_list.php", "", substr($empRights,14,1), "", "", array(), "", ""); $menu[3]["lager"] = array(getLngt("L�ger"), "../stock/stock.php", "", substr($empRights,14,1), "1", "", array(), "", ""); */ $menu[3]["zentralenmitarbeiter"] = array(getLngt("Mitarbeiter"), "../admin/employee_list.php", "", "", "", "", array(), "", ""); // substr($empRights,3,1); // $menu[3]["lagerist"] = array(getLngt("Lageristen"), "../admin/user_list.php", "", substr($empRights,3,1), "", "", array(), "", "userListOfType=" . ec("4")); $menu[3]["zentralenkonfiguration"] = array(getLngt("Einstellungen"), "../admin/hq_admin.php", "", "", "1", "", array(), "", ""); $menu[3]["kd_berichte"] = array(getLngt("Kunden"), "../groupware/report.php", "_blank", (substr($empRights,0,1) == "1" && substr($empRights,16,1) == "1" ? "1" : "0"), "", "", array(), "", "rpObjType=cs"); $menu[3]["un_berichte"] = array(getLngt("Transporteure"), "../groupware/report.php", "_blank", (substr($empRights,1,1) == "1" && substr($empRights,16,1) == "1" ? "1" : "0"), "1", "", array(), "", "rpObjType=cr"); endif; // Customer if ($userType == "2") : $jsMenuNavigationDeep = 1; $idColContainer = array(); $idColContainer[0] = array("menu_00"); $idColContainer[1] = array("menu_01", "menu_02"); $idColContainer[2] = array("menu_01_01"); $idColContainer[3] = array(); // Get customer $cscId = getFieldValueFromId("employee","emp_id",$emp_id,"csc_id"); $csId = getFieldValueFromId("costcenter","csc_id",$cscId,"cs_id"); $csJbedit = getFieldValueFromId("customer","cs_id",$csId,"cs_jbedit"); if ($hq_workmode != "0") : $tmpMenuAccess = "0"; if ($csJbedit != "0") : $tmpMenuAccess = "1"; endif; else : $tmpMenuAccess = "1"; endif; // echo $customerId . "  " . $cscIdRoot . "  " . $cscIdActual . "
"; // echo ec($customerId) . "  " . ec($cscIdRoot) . "  " . ec($cscIdActual) . "
"; $menu[1]["kostenstellen"] = array(getLngt("Kostenstellen"), "../customer/costcenter.php", "", "", "", "", array(), "", "customerId=" . ec($customerId) . "&cscIdRoot=" . ec($cscIdRoot) . "&cscIdActual=" . ec($cscIdActual)); $menu[1]["auftraege"] = array(getLngt("Auftr�ge"), "#", "", "", "", "", array("menu_01_01"), "1", ""); $menu[1]["zentralenmitarbeiter"] = array(getLngt("Mitarbeiter"), "../admin/employee_list.php", "", "1", "1", "", array(), "", "customerId=" . ec($customerId) . "&cscIdRoot=" . ec($cscIdRoot) . "&cscIdActual=" . ec($cscIdActual)); // $menu[1]["adressen"] = array(getLngt("Adressen"), "../customer/cscad_fs.php", "", substr($empRights,3,1), "", "", array(), "", "customerId=" . ec($customerId) . "&cscIdRoot=" . ec($cscIdRoot) . "&cscIdActual=" . ec($cscIdActual)); $menu[1]["datenexport"] = array(getLngt("Datenexport"), "../export/export.php", "", substr($empRights,7,1), "", "", array(), "", "customerId=" . ec($customerId) . "&cscIdRoot=" . ec($cscIdRoot) . "&cscIdActual=" . ec($cscIdActual)); $menu[1]["statistik"] = array(getLngt("Statistik"), "../statistic/statistic.php", "", substr($empRights,8,1), "", "", array(), "", "customerId=" . ec($customerId) . "&cscIdRoot=" . ec($cscIdRoot) . "&cscIdActual=" . ec($cscIdActual)); // Check for customer parameter for displaying the map view if ($customerId != "") : $constCsShowMapView = getParameterValue("0", "MASK_JB_MAP_VIEW_ENABLED_" . $customerId, "0"); if ($constCsShowMapView == "1") : $menu[1]["map"] = array(getLngt("Karten�bersicht"), "../locating/map.php", "_blank", "1", "1", "", array(), "", ""); endif; endif; if (MASK_SINGLE_JOBEDIT == "1") : $menu[2]["erfassung"] = array(getLngt("Erfassung"), "javascript:actionEvent('job_edit2')", "", $tmpMenuAccess, "", "", array(), "1", ""); else : $menu[2]["erfassung"] = array(getLngt("Erfassung"), "../jobs2/job_edit.php", "_blank", $tmpMenuAccess, "", "", array(), "1", ""); endif; $menu[2]["listen"] = array(getLngt("Listen"), "../customer/jb_list.php", "", substr($empRights,4,1), "", "", array(), "", "customerId=" . ec($customerId) . "&cscIdRoot=" . ec($cscIdRoot) . "&cscIdActual=" . ec($cscIdActual)); $menu[2]["uebersicht"] = array(getLngt("�bersicht"), "../invoice/invoice.php", "", substr($empRights,5,1), "1", "", array(), "", "customerId=" . ec($customerId) . "&cscIdRoot=" . ec($cscIdRoot) . "&cscIdActual=" . ec($cscIdActual)); endif; // Courier if ($userType == "3") : $jsMenuNavigationDeep = 0; $idColContainer = array(); $idColContainer[0] = array("menu_00"); $idColContainer[1] = array("menu_01"); $idColContainer[2] = array(); $idColContainer[3] = array(); $menu[1]["auftraege"] = array(getLngt("Auftr�ge"), "../invoice/invoice_cr.php", "", "1", "", "", array(), "", ""); $menu[1]["passwort"] = array(getLngt("Passwort"), "../courier/cr_changepwd.php", "", "1", "1", "", array(), "", ""); endif; // Warehouseman if ($userType == "4") : $jsMenuNavigationDeep = 0; $idColContainer = array(); $idColContainer[0] = array("menu_00"); $idColContainer[1] = array("menu_01"); $idColContainer[2] = array(); $idColContainer[3] = array(); $menu[1]["lager"] = array(getLngt("L�ger"), "../stock/stock.php", "", "1", "1", "", array(), "", ""); // $menu[1]["passwort"] = array(getLngt("Passwort"), "../courier/cr_changepwd.php", "", "1", "1", "", array(), "", ""); endif; // Generate menu with structure and links $jsMenuStruct = array(); $jsSubMenu = array(); $menuOut = ""; function generateMenu($menu, $idColContainer, $jsMenuStruct, $jsSubMenu, $menuStructPrefix) { global $constMenuBackground, $constMenuBackgroundImage, $currentNavigationItem, $currentNavigationLevel; $jsMenuStruct = array(); $jsSubMenu = array(); $menuOut = ""; if ($menuStructPrefix == "") : $menuStructPrefix = "menu_"; endif; $menuLevels = count($menu); for ($j = 0; $j < $menuLevels; $j++) : $colCounter = 0; $keyArray = array_keys($menu[$j]); $keyArrayLen = count($keyArray); $menuOut .= "
\n"; $jsMenuStruct[$j] = "\""; for ($i = 0; $i < $keyArrayLen; $i++) : if ($menu[$j][$keyArray[$i]][3] == "1" || $menu[$j][$keyArray[$i]][3] == "") : $menuOut .= "
"; // $menuOut .= "
"; $menuOut .= "  " . $menu[$j][$keyArray[$i]][0]; $tmpStrLen = strlen($menu[$j][$keyArray[$i]][0]); for ($k = $tmpStrLen; $k < 17; $k++) : $menuOut .= " "; endfor; $menuOut .= ""; $menuOut .= "
\n"; else : $menuOut .= "
"; $menuOut .= "
"; // $menuOut .= "
"; $menuOut .= "  " . $menu[$j][$keyArray[$i]][0] . ""; $menuOut .= "
\n"; endif; // Check for reaching last element of the container like "menu_01_01" if ($menu[$j][$keyArray[$i]][4] == "1") : $colCounter++; $tmpJ = $j; if ($i == ($keyArrayLen - 1)) : $tmpJ = $j + 1; $colCounter = 0; endif; if ($i < ($keyArrayLen - 1)) : $menuOut .= "\n"; $menuOut .= "
\n"; endif; endif; // ONLY for remembering the current menu status (activated item) // Get the navigation level from the $currentNavigationItem if ($currentNavigationItem == $keyArray[$i]) : $currentNavigationLevel = ($j - 1); // Check for disabled navigation suffix if ($menu[$j][$keyArray[$i]][7] == "1") : $currentNavigationItem = ""; $currentNavigationLevel = 0; endif; endif; //ONLY FOR JAVASCRIPT // Menu structure $jsMenuStruct[$j] .= $keyArray[$i]; if ($i < ($keyArrayLen - 1)) : $jsMenuStruct[$j] .= "\",\""; endif; // Array of containers be visible by hovering and click // Used for the structure in Javascript: // subMenu["verwaltung"] = new Array("menu_01_01","menu_01_02","menu_01_03"); ... $tmpLen = count($menu[$j][$keyArray[$i]][6]); if ($tmpLen > 0) : $jsSubMenu[] = array($keyArray[$i], $menu[$j][$keyArray[$i]][6]); endif; endfor; $menuOut .= "
\n"; $jsMenuStruct[$j] .= "\""; endfor; return array($menuOut, $menuLevels, $jsMenuStruct, $jsSubMenu); } // Call generation of the MAIN MENU using globals list ($menuOut, $menuLevels, $jsMenuStruct, $jsSubMenu) = generateMenu($menu, $idColContainer, $jsMenuStruct, $jsSubMenu, ""); // ********** // * OUTPUT * // ********** $phpMenuOut = ""; $phpReducedMenuOut = ""; $phpPageTitelOut = ""; $phpHeadquartersOut = ""; $phpCurrentNavigationOnLoad = ""; $phpCurrentNavigationInputHidden = ""; if (!$menuDisabled) : // Check activation of the user state items $constMenuUserStateItems = getParameterValue("0", "MENU_USER_STATE_ITEMS", $hq_id); if ($constMenuUserStateItems == "") : $constMenuUserStateItems = getParameterValue("0", "MENU_USER_STATE_ITEMS", "0"); endif; // Get user states if activated $showUserStateInfo = false; $menuItemListArrayLen = 0; if ($browserOk && $constMenuUserStateItems == "1" && isset($usr_id) && $usr_id > 0 && $userType == "1") : // Global switch to show user state buttons $showUserStateInfo = true; $usrStateBoolArray = array(); $parMenuUserStateItemListOutput = getParameterValue("0", "MENU_USER_STATE_ITEMLIST_OUTPUT", $hq_id); if ($parMenuUserStateItemListOutput == "") : $parMenuUserStateItemListOutput = getParameterValue("0", "MENU_USER_STATE_ITEMLIST_OUTPUT", "0"); endif; if ($parMenuUserStateItemListOutput != "") : $menuItemListArray = getKeyValueArrayFromString($parMenuUserStateItemListOutput); $menuItemListArrayLen = count($menuItemListArray); if ($menuItemListArrayLen > 0) : $menuItemListKeyArray = array_keys($menuItemListArray); $menuItemListKeyArrayLen = count($menuItemListKeyArray); for ($i = 0; $i < $menuItemListKeyArrayLen; $i++) : $menuItemKey = "usr_state_" . $menuItemListKeyArray[$i]; // User states $usrStateBoolArray[$menuItemKey] = "0"; if (existsEntry("genericdatacontainer",array("gdc_obj_type","usr","gdc_obj_id",$usr_id,"gdc_gen_fieldname",$menuItemKey))) : $usrStateBoolArray[$menuItemKey] = getFieldValueFromClause("genericdatacontainer","gdc_content","gdc_obj_type = 'usr' AND gdc_obj_id = '" . $usr_id . "' AND gdc_gen_fieldname = '" . $menuItemKey . "'"); endif; endfor; endif; endif; // User state disposition [template] /* $usrStateDispo = "0"; if (existsEntry("genericdatacontainer",array("gdc_obj_type","usr","gdc_obj_id",$usr_id,"gdc_gen_fieldname","usr_state_dispo"))) : $usrStateDispo = getFieldValueFromClause("genericdatacontainer","gdc_content","gdc_obj_type = 'usr' AND gdc_obj_id = '" . $usr_id . "' AND gdc_gen_fieldname = 'usr_state_dispo'"); endif; */ // User state newsticker $usrLastTifId = 0; if (existsEntry("genericdatacontainer",array("gdc_obj_type","usr","gdc_obj_id",$usr_id,"gdc_gen_fieldname","usr_state_newsticker"))) : $usrLastTifId = getFieldValueFromClause("genericdatacontainer","gdc_content","gdc_obj_type = 'usr' AND gdc_obj_id = '" . $usr_id . "' AND gdc_gen_fieldname = 'usr_state_newsticker'"); endif; $tifIdLast = getMaxOfField("phoenix_group.tickerforum", "tif_id", ""); $numOfNewsToBeRead = getUserMessages("2", $usrLastTifId); endif; $phpCurrentNavigationOnLoad .= "adjustWidthsOnLoad();"; // Resize headline, etc. $phpCurrentNavigationOnLoad .= "activateMenusByPageTitle();"; if ($userType == "1") : $phpCurrentNavigationOnLoad .= "myhide('menu_reduced');"; endif; if (!$isFirefox) : $phpCurrentNavigationOnLoad .= "hideFocusOfLinkClass();"; endif; $phpCurrentNavigationInputHidden = "\n"; if ($currentNavigationItem != "") : $phpCurrentNavigationOnLoad .= "setMenuOnLoad('" . $currentNavigationItem . "'," . $currentNavigationLevel . ");"; $phpCurrentNavigationInputHidden = "\n"; endif; $phpCurrentNavigationInputHidden .= "\n"; if ($showUserStateInfo) : // Close "Info" per default $phpCurrentNavigationOnLoad .= "myhide('page_info');"; // In the beginning of a script per default all state buttons are "off" (e.g. "red") and have individually to switched to "on" (e.g. "green") if ($menuItemListKeyArrayLen > 0) : for ($i = 0; $i < $menuItemListKeyArrayLen; $i++) : $menuItemKey = "usr_state_" . $menuItemListKeyArray[$i]; $phpCurrentNavigationOnLoad .= "changeButtonMenuState('" . $menuItemKey . "','" . $menuItemKey . "','','2','" . $usrStateBoolArray[$menuItemKey] . "');"; endfor; endif; // $phpCurrentNavigationOnLoad .= "changeButtonMenuState('usr_state_dispo','menuUserStateDispo','','2','" . $usrStateDispo . "');"; // User state newsticker if ($numOfNewsToBeRead == 0) : $phpCurrentNavigationOnLoad .= "changeButtonMenuState('usr_state_newsticker','menuUserStateNews','Mitteilungen','1','" . $tifIdLast . "');"; endif; endif; // Complete menu $phpMenuOut .= "
\n"; // $phpMenuOut .= "
\n"; $phpMenuOut .= "
\n"; $phpMenuOut .= "
\n"; $phpMenuOut .= "
\n"; $phpMenuOut .= "
\n"; $phpMenuOut .= "
\n"; $phpMenuOut .= $menuOut; $phpMenuOut .= "
\n"; // Reduced menu (only for headquarters) if ($userType == "1") : $reducedMenu[0]["mainmenu"] = array(getLngt("Menu") . "               ", "javascript:switchTicker('off');activateMenu('menu','menu_reduced');", "", "", "1", "2", array(), "1", ""); $reducedMenu[0]["ticker"] = array(getLngt("Ticker") . "             ", "javascript:switchTicker();", "", "", "1", "2", array(), "1", ""); $IdColContainerReducedMenu = array(); $IdColContainerReducedMenu[0] = array("menu_00"); $IdColContainerReducedMenu[1] = array(); $jsReducedMenuStruct = array(); $jsSubReducedMenu = array(); list ($reducedMenuOut, $reducedMenuLevels, $jsReducedMenuStruct, $jsSubReducedMenu) = generateMenu($reducedMenu, $IdColContainerReducedMenu, $jsReducedMenuStruct, $jsSubReducedMenu, "reduced_menu_"); $phpReducedMenuOut .= "
\n"; $phpReducedMenuOut .= $reducedMenuOut . "\n"; // $phpReducedMenuOut .= "\n"; $phpReducedMenuOut .= "
\n"; $phpReducedMenuOut .= "
\n"; endif; // Check current employee for access to switch headquarters on the fly /* $empHqList = getParameterValue("0", "HEADQUARTERS_MULTIPLE_ACCESS_EMPLOYEES", "0"); $outHqSelection = ""; if (!$menuDisabled && $hq_id != "" && $userType == "1" && $empHqList != "") : $empHqArray = getKeyValueArrayFromString($empHqList); $tmpKeysArray = array_keys($empHqArray); $tmpKeysArrayLen = count($tmpKeysArray); // Check access to multiple headquarters selection $showMultipleHqSelection = false; for ($i = 0; $i < $tmpKeysArrayLen; $i++) : if ($emp_id == $empHqArray[$tmpKeysArray[$i]]) : $showMultipleHqSelection = true; endif; endfor; if ($showMultipleHqSelection) : $outHqSelection .= "
\n"; $outHqSelection .= " " . strtoupper(getFieldValueFromId("headquarters","hq_id",$hq_id,"hq_mnemonic")) . " : :"; $outHqSelection .= "
\n"; $outHqSelection .= "
"; for ($i = 0; $i < $tmpKeysArrayLen; $i++) : $outHqSelection .= " " . getFieldValueFromId("headquarters","hq_id",$tmpKeysArray[$i],"hq_mnemonic") . "  
"; endfor; $outHqSelection .= "
"; $phpCurrentNavigationOnLoad .= "myhide('currHqSelection'); myshow('currHqSelectionReduced');"; endif; endif; */ $outHqSelection = ""; if ($hq_id != "") : $empHqList = getParameterValue("0", "HEADQUARTERS_MULTIPLE_ACCESS_EMPLOYEES", "0"); if (!$menuDisabled && $userType == "1" && $empHqList != "") : $showMultipleHqSelection = isInParameterString($emp_id, $empHqList); if ($showMultipleHqSelection) : $tmpHqIdArray = getColVectorFromDB2ArrayByClause("mandatorheadquarters AS mdhq, headquarters AS hq", "hq.hq_id", "mdhq.md_id = '" . $md_id . "' AND mdhq.hq_id = hq.hq_id AND hq.hq_disabled = '0'", "", "hq.hq_mnemonic", ""); $tmpHqIdArrayLen = count($tmpHqIdArray); $outHqSelection .= "
\n"; $outHqSelection .= " " . strtoupper(getFieldValueFromId("headquarters","hq_id",$hq_id,"hq_mnemonic")) . " : :"; $outHqSelection .= "
\n"; $outHqSelection .= "
"; for ($i = 0; $i < $tmpHqIdArrayLen; $i++) : $outHqSelection .= " " . getFieldValueFromId("headquarters","hq_id",$tmpHqIdArray[$i],"hq_mnemonic") . "  
"; endfor; $outHqSelection .= "
"; $phpCurrentNavigationOnLoad .= "myhide('currHqSelection'); myshow('currHqSelectionReduced');"; endif; endif; endif; // Titel $phpPageTitelOut .= $outHqSelection; $phpPageTitelOut .= "
\n"; $phpPageTitelOut .= "  " . mcIsSet($pageTitel) . "\n"; if ($showUserStateInfo) : $phpPageTitelOut .= "       \n"; $phpPageTitelOut .= " " . "\n"; $phpPageTitelOut .= " " . "\n"; // $phpPageTitelOut .= " " . "\n"; for ($i = 0; $i < $menuItemListKeyArrayLen; $i++) : $menuItemKey = "usr_state_" . $menuItemListKeyArray[$i]; $menuItemValue = $menuItemListArray[$menuItemListKeyArray[$i]]; $phpPageTitelOut .= " " . "\n"; endfor; if (substr($empRights,0,1) == "1" && substr($empRights,11,1) == "1" && substr($empRights,36,1) == "1") : $phpPageTitelOut .= " " . "\n"; endif; endif; $phpPageTitelOut .= "
\n"; // Info if ($showUserStateInfo) : $phpPageInfoOut = ""; $phpPageInfoOut .= "
\n"; $phpPageInfoOut .= "
\n"; // $phpPageInfoOut .= " " . "\n"; $phpPageInfoOut .= "
\n"; $phpPageInfoOut .= "
\n"; $phpPageInfoOut .= "
\n"; $phpPageInfoOut .= "
\n"; $phpPageTitelOut .= $phpPageInfoOut; // Add "Info" to "Title" endif; endif; ?>