Browse Source

fix menu for users with admin level 6

Piotr Labudda 11 năm trước cách đây
mục cha
commit
9c655340a6
4 tập tin đã thay đổi với 29 bổ sung17 xóa
  1. 1 1
      SE/VERSION
  2. 1 5
      SE/procesy5.php
  3. 5 11
      SE/se-lib/SE_Layout.php
  4. 22 0
      SE/se-lib/tmpl/menuLevel6.php

+ 1 - 1
SE/VERSION

@@ -1 +1 @@
-3.9.6
+3.9.6.1

+ 1 - 5
SE/procesy5.php

@@ -151,7 +151,6 @@ function User_procesy5_check_access() {
 		<br>.
 		<?php
 		lay_procesy_dol();
-		echo'</body></html>';
 		die();
 	}
 }
@@ -1867,16 +1866,13 @@ DEBUG_S(6,'SRV', $_SERVER, __FILE__, __FUNCTION__, __LINE__);
 
 echo'<br>.';
 lay_procesy_dol();
-echo'</body></html>';
 
 
 function lay_procesy_dol() {
 	if (1 == V::get('HIDE_PANEL', 0, $_REQUEST, 'int')) {
 		return;
 	}
-	echo'<div style="padding:2px 20px;border-top:1px solid #969696;color:#666;font-size:9px;">';
-		echo "&copy; BIALL-NET Sp. Z o.o. ";
-	echo'</div>';
+	SE_Layout::dol();
 }
 
 

+ 5 - 11
SE/se-lib/SE_Layout.php

@@ -172,7 +172,7 @@ jQuery(document).bind('keyup', 'alt+shift+`', function(){
 	}
 
 	public static function dol() {
-		$version = file_get_contents(APP_PATH_ROOT . '/VERSION');
+		$version = (file_exists(APP_PATH_ROOT . '/VERSION'))? file_get_contents(APP_PATH_ROOT . '/VERSION') : null;
 		if ($version) {
 			echo '<div style="border-top:1px solid #ddd;margin-top:10px;padding:0 30px;font-size:xx-small;color:#888;">version: '.$version.'</div>';
 		}
@@ -180,7 +180,9 @@ jQuery(document).bind('keyup', 'alt+shift+`', function(){
 	}
 
 	public static function menu() {
-		if (User::logged() && User::hasAccess('menu')) {
+		if (!User::logged()) return;
+
+		if (User::hasAccess('menu')) {
 			Lib::loadClass('ProcesMenu');
 
 			$procesMenu = ProcesMenu::getInstance();
@@ -193,15 +195,7 @@ jQuery(document).bind('keyup', 'alt+shift+`', function(){
 
 		}
 		else {
-			?>
-			<div class="container">
-				<div class="alert alert-error" style="font-size:14px;">
-					<strong>Brak niezbędnych uprawnień</strong>
-					<a class="pull-right btn btn-primary btn-mini" href="index.php?LOGIN=LOGOUT">Wyloguj</a>
-					<br><br>Wykonaj <a href="procesy5.php?task=CRM_TESTY">testy</a>
-				</div>
-			</div>
-			<?php
+			SE_Layout::loadTemplate('menuLevel6');
 		}
 	}
 

+ 22 - 0
SE/se-lib/tmpl/menuLevel6.php

@@ -0,0 +1,22 @@
+<div class="container">
+	<?php if (!empty($errMsg)) : ?>
+		<div class="alert alert-error"><?php echo $errMsg; ?></div>
+	<?php endif; ?>
+
+	<div class="alert alert-warning" style="font-size:14px;">
+		Jesteś zalogowany jako
+		<?php if ('Anonymous' == User::getType()) : ?>
+			<strong>Gość</strong>
+		<?php elseif ('Partner' == User::getType()) : ?>
+			<strong><?php echo User::getFullName(); ?></strong>
+		<?php else : ?>
+			<strong><?php echo User::getFullName(); ?></strong>
+		<?php endif; ?>
+		<a class="pull-right btn btn-primary btn-mini" href="index.php?LOGIN=LOGOUT">Wyloguj</a>
+
+		<br><br>Wykonaj <a href="procesy5.php?task=CRM_TESTY">testy</a>
+
+	</div>
+</div>
+
+