[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 11/15: Fix : Menu problem when 2 duplicate me
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 11/15: Fix : Menu problem when 2 duplicate menus |
Date: |
Fri, 5 Feb 2021 11:38:31 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit bd6775e4c52f94735de213e86b36e86e0fe06435
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Thu Feb 4 14:14:52 2021 +0100
Fix : Menu problem when 2 duplicate menus
---
html/do.php | 21 ++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/html/do.php b/html/do.php
index 2b67723..bd80cfb 100644
--- a/html/do.php
+++ b/html/do.php
@@ -254,29 +254,20 @@ if (isset($_REQUEST['ac']))
pm_id_v3,pm_id_v2,pm_id_v1
from v_menu_profile where code= upper($1) and p_id=$2',
array($AC,$user_profile));
-
try {
- if ( count($amenu_id) != 1 ) {
- // if AC is a simple code and this menu can be accessed
- // we should find the first menu which used it and change the
- // request AC to it
- $pm_id=$cn->get_array('select pm_id from profile_menu '
- . ' where lower(me_code)=lower($1) and p_id=$2',
- array($AC,$user_profile));
- if ( count($pm_id) > 0 ) {
- show_menu($pm_id[0]['pm_id']);
- return;
- } else {
- throw new Exception(_('Erreur menu'),10);
- }
+ if (count($amenu_id) == 0 ) { throw new Exception(_('Erreur
menu'),10);}
+ if ( count($amenu_id)> 1) {
+ $tmp=$amenu_id[0];
+ $amenu_id=[];
+ $amenu_id[0]=$tmp;
}
$amenu_id=complete_default_menu($amenu_id,$user_profile);
$AC=rebuild_access_code($amenu_id);
put_global(array(array("key"=>"ac","value"=>$AC)));
- $module_id=$cn->get_value('select
+ $module_id=$cn->get_value('select distinct
case when pm_id_v3 = 0 then (case when pm_id_v2 = 0 then pm_id_v1
else pm_id_v2 end) else pm_id_v3 end
from
v_menu_profile
- [Noalyss-commit] [noalyss] 01/15: Fix #0001277: <<header>> ne supporte pas caractères avec accent., (continued)
- [Noalyss-commit] [noalyss] 01/15: Fix #0001277: <<header>> ne supporte pas caractères avec accent., Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 03/15: Cosmetic, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 02/15: SQL upgrade, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 06/15: Fix: bug in gettext function, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 05/15: New 0001893: Date remplacement auto des séparateurs, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 09/15: Set Version 8.1 + logo + bug SQL script 151, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 12/15: Compatibility PHP7.0, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 04/15: New : 0001890: Avertissement si la document à télécharger est trop gros, on ne peut soumettre le fichier, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 07/15: ICard Improve doc and test, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 08/15: New : Task #1894: Gestion : ajout un champs paramétrable pour videoconf, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 11/15: Fix : Menu problem when 2 duplicate menus,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 14/15: cosmetic : position inner_box on larger screen, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 10/15: Place of recover_link, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 15/15: We split Database in DatabaseCore and Database, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 13/15: Bug = if double click on a card returns nothing, Dany De Bontridder, 2021/02/05