phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r4260 - in phpcompta/trunk: html include


From: phpcompta-dev
Subject: [Phpcompta-dev] r4260 - in phpcompta/trunk: html include
Date: Sat, 29 Oct 2011 02:10:57 +0200 (CEST)

Author: danydb
Date: 2011-10-29 02:10:54 +0200 (Sat, 29 Oct 2011)
New Revision: 4260

Modified:
   phpcompta/trunk/html/do.php
   phpcompta/trunk/include/ac_common.php
Log:
#422 Module by default. Set the $_POST,$_GET,$_REQUEST

Modified: phpcompta/trunk/html/do.php
===================================================================
--- phpcompta/trunk/html/do.php 2011-10-28 23:58:49 UTC (rev 4259)
+++ phpcompta/trunk/html/do.php 2011-10-29 00:10:54 UTC (rev 4260)
@@ -120,6 +120,9 @@
 else
 {
     $default = find_default_module();
+    $_GET['ac']=$default;
+    $_POST['ac']=$default;
+    $_REQUEST['ac']=$default;
     show_module($default);
     $all[0] = $default;
     show_menu($all, 0);

Modified: phpcompta/trunk/include/ac_common.php
===================================================================
--- phpcompta/trunk/include/ac_common.php       2011-10-28 23:58:49 UTC (rev 
4259)
+++ phpcompta/trunk/include/ac_common.php       2011-10-29 00:10:54 UTC (rev 
4260)
@@ -726,6 +726,7 @@
    $default_module = $cn->get_array("select me_code
            from profile_menu join profile_user using (p_id)
            where
+           p_type_display='M' and
            user_name=$1 and pm_default=1", array($g_user->login));
 
        if (empty($default_module))
@@ -734,8 +735,8 @@
            from profile_menu join profile_user using (p_id)
            where
            user_name=$1 and p_order=(select min(p_order) from profile_menu
-               where user_name=$1) limit 1", 
array($g_user->login,$g_user->login));
-           return $default_module;
+               where user_name=$2) limit 1", 
array($g_user->login,$g_user->login));
+           return $default_module[0]['me_code'];
        }
 
        if (count($default_module) > 1)
@@ -747,20 +748,8 @@
            return $default_module[0]['me_code'];
        }
 }
+
 /**
- * show default module
- */
-function show_default()
-{
-    $cn=Dossier::connect();
-    $file=$cn->get_array('SELECT m_code FROM module where m_default=1');
-    if (! empty ($file) )
-    {
-       $selected=$file[0]['m_code'];
-       show_module($selected);
-    }
-}
-/**
  *
  */
 function show_menu($module,$idx)




reply via email to

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