noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 03/03: Bug 1834 : duplicate , cannot confirm


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 03/03: Bug 1834 : duplicate , cannot confirm an duplicated operation because the $_GET is taken in priority
Date: Mon, 21 Sep 2020 15:49:40 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 44dbd495a6ee269b516ba2e329e82cda531d09ad
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Mon Sep 21 21:40:50 2020 +0200

    Bug 1834 : duplicate , cannot confirm an duplicated operation
    because the $_GET is taken in priority
---
 include/class/acc_operation.class.php | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/include/class/acc_operation.class.php 
b/include/class/acc_operation.class.php
index 7639d9d..e1930ef 100644
--- a/include/class/acc_operation.class.php
+++ b/include/class/acc_operation.class.php
@@ -741,17 +741,22 @@ class Acc_Operation
         $operation = $this->get_quant();
         $array=$operation->compute_array();
         global $g_user;
-        // Prepare the form
-        $r='<form id="'.$p_id.'" method="POST">';
-        $r.=Dossier::hidden();
         $a_code=$this->db->get_array("select code from v_menu_dependency vmd  
where me_code=$1 and p_id=$2",
                 array( $operation->signature,$g_user->get_profile()));
-        
-        // select the menu where the operation will be duplicated
         if ( empty ($a_code)) {
             $r.=_("Menu invalide");
             return $r;
         }
+        /** 
+         * @bug : if several menu possible , will use only the first one, 
because request take first the GET and after
+         * the POST
+         */
+        // Prepare the form
+        $r=sprintf('<form id="%s" method="POST" 
ACTION="%s">',$p_id,NOALYSS_URL."/do.php?".http_build_query([
+                "ac"=>$a_code[0]['code'],"gDossier"=>Dossier::id()
+        ]));
+        $r.=Dossier::hidden();
+        // select the menu where the operation will be duplicated
         $r.="<p>";
         $r.="<ul style=\"margin-left:2rem;padding-left:0;list-style:none;\">";
         $r.=sprintf("<li>%s</li>",$operation->det->jr_pj_number);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]