phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r4229 - in phpcompta/branches/rel600-dynamic-menu: html


From: phpcompta-dev
Subject: [Phpcompta-dev] r4229 - in phpcompta/branches/rel600-dynamic-menu: html include include/template sql
Date: Sun, 23 Oct 2011 20:51:11 +0200 (CEST)

Author: danydb
Date: 2011-10-23 20:51:09 +0200 (Sun, 23 Oct 2011)
New Revision: 4229

Added:
   phpcompta/branches/rel600-dynamic-menu/sql/backup-new-object.sh
   phpcompta/branches/rel600-dynamic-menu/sql/object-6.0.sql
Modified:
   phpcompta/branches/rel600-dynamic-menu/html/do.php
   phpcompta/branches/rel600-dynamic-menu/include/ac_common.php
   phpcompta/branches/rel600-dynamic-menu/include/balance.inc.php
   phpcompta/branches/rel600-dynamic-menu/include/class_acc_account_ledger.php
   phpcompta/branches/rel600-dynamic-menu/include/constant.php
   phpcompta/branches/rel600-dynamic-menu/include/fiche.inc.php
   phpcompta/branches/rel600-dynamic-menu/include/impress_bilan.inc.php
   phpcompta/branches/rel600-dynamic-menu/include/impress_fiche.inc.php
   phpcompta/branches/rel600-dynamic-menu/include/impress_gl_comptes.inc.php
   phpcompta/branches/rel600-dynamic-menu/include/impress_jrn.inc.php
   phpcompta/branches/rel600-dynamic-menu/include/impress_poste.inc.php
   phpcompta/branches/rel600-dynamic-menu/include/impress_rapport.inc.php
   phpcompta/branches/rel600-dynamic-menu/include/impress_rec.inc.php
   phpcompta/branches/rel600-dynamic-menu/include/template/menu.php
   phpcompta/branches/rel600-dynamic-menu/include/template/module.php
Log:
Dynamic menu: impress works

Modified: phpcompta/branches/rel600-dynamic-menu/html/do.php
===================================================================
--- phpcompta/branches/rel600-dynamic-menu/html/do.php  2011-10-22 20:37:48 UTC 
(rev 4228)
+++ phpcompta/branches/rel600-dynamic-menu/html/do.php  2011-10-23 18:51:09 UTC 
(rev 4229)
@@ -41,21 +41,19 @@
 
 if (isset($_REQUEST['ac']))
 {
-    $all = explode(':', $_REQUEST['ac']);
+    $all = explode('/', $_REQUEST['ac']);
     $module_selected = $all[0];
-}
 
 // Show module and highligt selected one
-show_module($module_selected);
-
-// if $module_selected != -1,
-if ($module_selected != - 1)
-{
-    // show the menu
-    show_menu($all);
-
+    show_module($module_selected);
+   for ( $i=0;$i != count($all);$i++)
+       {   // show the menu
+           show_menu($all,$i);
+       }
 }
 else
 {
-    show_default();
+    show_module(-1);
 }
+
+

Modified: phpcompta/branches/rel600-dynamic-menu/include/ac_common.php
===================================================================
--- phpcompta/branches/rel600-dynamic-menu/include/ac_common.php        
2011-10-22 20:37:48 UTC (rev 4228)
+++ phpcompta/branches/rel600-dynamic-menu/include/ac_common.php        
2011-10-23 18:51:09 UTC (rev 4229)
@@ -693,12 +693,17 @@
  */
 function show_module($selected)
 {
+    global $g_user;
     $cn=Dossier::connect();
-    $amodule=$cn->get_array("select m_code,m_menu,m_url from module order by 
m_order");
+    $amodule=$cn->get_array("select me_code,me_menu,me_url from v_all_menu
+       where
+       user_name=$1
+       and me_module='Y'
+       order by p_order",array($g_user->login));
     require_once('template/module.php');
     if ( $selected != -1 )
     {
-       $file=$cn->get_value("select m_file from module where 
m_code=$1",array($selected));
+       $file=$cn->get_value("select me_file from v_all_menu where 
me_code=$1",array($selected));
        if ($file != '')
            require_once $file;
     }
@@ -720,13 +725,35 @@
 /**
  *
  */
-function show_menu($module)
+function show_menu($module,$idx)
 {
+    global $g_user;
     $cn=Dossier::connect();
-    $amenu=$cn->get_array("select me_id,me_menu from menu
-       join menu_ref using (me_code)
-       join module using (m_code) where
-       m_code=$1 order by me_order",array($module[0]));
-    require_once 'template/menu.php';
+    $amenu=$cn->get_array("select
+       me_menu,me_code
+       from v_all_menu
+       where
+       me_code_dep=$1 order by p_order",array($module[$idx]));
+
+    if (! empty ($amenu))
+    {
+       require 'template/menu.php';
+    }
+    else
+    {
+       $file=$cn->get_value("select me_file
+       from v_all_menu
+       where
+       user_name=$1 and me_code=$2 and
+       (me_file is not null or trim(me_file) <>'')",
+           array($g_user->login,$module[$idx]));
+
+       if ( $file != "" )
+       {
+           echo '<div class="content">';
+           require_once "$file";
+           echo '</div>';
+       }
+    }
 }
 ?>

Modified: phpcompta/branches/rel600-dynamic-menu/include/balance.inc.php
===================================================================
--- phpcompta/branches/rel600-dynamic-menu/include/balance.inc.php      
2011-10-22 20:37:48 UTC (rev 4228)
+++ phpcompta/branches/rel600-dynamic-menu/include/balance.inc.php      
2011-10-23 18:51:09 UTC (rev 4229)
@@ -22,7 +22,7 @@
  * \brief Show the balance and let you print it or export to PDF
  *        file included by user_impress
  *
- * some variable are already defined ($cn, $User ...)
+ * some variable are already defined ($cn, $g_user ...)
  */
 
 include_once ("ac_common.php");
@@ -34,12 +34,12 @@
 require_once('class_acc_ledger.php');
 require_once('class_periode.php');
 require_once('class_exercice.php');
-global $User;
+global $g_user;
+$gDossier=dossier::id();
+$g_user->can_request(IMPBAL);
+$exercice=(isset($_GET['exercice']))?$_GET['exercice']:$g_user->get_exercice();
 
-$User->can_request(IMPBAL);
-$exercice=(isset($_GET['exercice']))?$_GET['exercice']:$User->get_exercice();
 
-
 echo '<div class="content">';
 /*
  * Let you change the exercice
@@ -72,7 +72,7 @@
 $input_from->type=ALL;
 $input_from->cn=$cn;
 $input_from->filter_year=true;
-$input_from->user=$User;
+$input_from->user=$g_user;
 
 echo 'Depuis :'.$input_from->input();
 // filter on the current year
@@ -82,7 +82,7 @@
 $input_to->filter_year=true;
 $input_to->type=ALL;
 $input_to->cn=$cn;
-$input_to->user=$User;
+$input_to->user=$g_user;
 echo ' jusque :'.$input_to->input();
 
 //-------------------------------------------------
@@ -91,7 +91,7 @@
 /*  add a all ledger choice */
 echo 'Filtre ';
 $rad=new IRadio();
-$array_ledger=$User->get_ledger('ALL',3);
+$array_ledger=$g_user->get_ledger('ALL',3);
 $selected=(isset($_GET['r_jrn']))?$_GET['r_jrn']:null;
 $select_cat=(isset($_GET['r_cat']))?$_GET['r_cat']:null;
 $array_cat=Acc_Ledger::array_cat();

Modified: 
phpcompta/branches/rel600-dynamic-menu/include/class_acc_account_ledger.php
===================================================================
--- phpcompta/branches/rel600-dynamic-menu/include/class_acc_account_ledger.php 
2011-10-22 20:37:48 UTC (rev 4228)
+++ phpcompta/branches/rel600-dynamic-menu/include/class_acc_account_ledger.php 
2011-10-23 18:51:09 UTC (rev 4229)
@@ -129,18 +129,18 @@
            $filter=str_replace('jrn_def_id','jr_def_id',$filter_sql);
            $bal_sql="select sum(amount_deb) as s_deb,sum(amount_cred) as 
s_cred, j_poste from                                          (select case when 
j_debit='t' then j_montant else 0 end as amount_deb,
                                                                case when 
j_debit='f' then j_montant else 0 end as amount_cred,
-                                                               j_poste 
+                                                               j_poste
                                                                from jrnx join 
jrn on (j_grpt = jr_grpt_id)
-                                                               where 
+                                                               where
                                                                j_poste=$1 and
                                                                $filter and
-                                                               ( 
to_date($2,'DD.MM.YYYY') <= j_date and 
+                                                               ( 
to_date($2,'DD.MM.YYYY') <= j_date and
                                   to_date($3,'DD.MM.YYYY') >= j_date  )) as 
signed_amount
                                                group by j_poste
                                                ";
            $r=$this->db->get_array($bal_sql,array($this->id,$p_from,$p_to));
            if ( $this->db->count() == 0 ) return array();
-           if ($r[0]['s_deb']==$r[0]['s_cred']) return array(); 
+           if ($r[0]['s_deb']==$r[0]['s_cred']) return array();
          }
         $Res=$this->db->exec_sql("select  jr_id,to_char(j_date,'DD.MM.YYYY') 
as j_date_fmt,j_date,".
                                  "case when j_debit='t' then j_montant else 0 
end as deb_montant,".
@@ -311,7 +311,7 @@
     }
     /*!
      * \brief HtmlTable, display a HTML of a poste for the asked period
-     * \param $p_array array for filter 
+     * \param $p_array array for filter
      * \param $let lettering of operation 0
      * \return -1 if nothing is found otherwise 0
      */
@@ -381,7 +381,7 @@
            $progress=bcadd($progress,$tmp_diff);
            $sum_cred=bcadd($sum_cred,$op['cred_montant']);
            $sum_deb=bcadd($sum_deb,$op['deb_montant']);
-           
+
            echo "<TR>".
              "<TD>".format_date($op['j_date'])."</TD>".
              td(h($op['jr_pj_number'])).
@@ -390,7 +390,7 @@
              "<TD style=\"text-align:right\">".nbm($op['deb_montant'])."</TD>".
              "<TD 
style=\"text-align:right\">".nbm($op['cred_montant'])."</TD>".
              td(nbm(abs($progress)),'style="text-align:right"').
-             
+
              td($let,' style="color:red;text-align:right"').
              "</TR>";
            $old_exercice=$op['p_exercice'];
@@ -439,9 +439,9 @@
        default:
          throw new Exception(" Fonction HtmlTableHeader argument actiontarget 
invalid");
          exit;
-       }         
+       }
         $hid=new IHidden();
-     
+
         echo "<table >";
         echo '<TR>';
         
$str_ople=(isset($_REQUEST['ople']))?HtmlInput::hidden('ople',$_REQUEST['ople']):'';
@@ -450,7 +450,7 @@
            echo '<TD><form method="GET" ACTION="">'.
              dossier::hidden().
              HtmlInput::submit('bt_other',"Autre poste").
-             
$hid->input("type","poste").$hid->input('p_action','impress')."</form></TD>";
+             
$hid->input("type","poste").$hid->input('ac',$_REQUEST['ac'])."</form></TD>";
          }
 
 
@@ -467,13 +467,13 @@
        if ( isset($_REQUEST['letter'] )) echo HtmlInput::hidden('letter','2');
        if ( isset($_REQUEST['solded'] )) echo HtmlInput::hidden('solded','1');
 
-       if (isset($_REQUEST['from_poste'])) 
+       if (isset($_REQUEST['from_poste']))
          echo HtmlInput::hidden('from_poste',$_REQUEST['from_poste']);
 
-       if (isset($_REQUEST['to_poste'])) 
+       if (isset($_REQUEST['to_poste']))
          echo HtmlInput::hidden('to_poste',$_REQUEST['to_poste']);
 
-        if (isset($_REQUEST['poste_id'])) 
+        if (isset($_REQUEST['poste_id']))
          echo HtmlInput::hidden("poste_id",$_REQUEST['poste_id']);
 
         if (isset($_REQUEST['poste_fille']))
@@ -492,13 +492,13 @@
         $hid->input("from_periode",$_REQUEST['from_periode']).
          $hid->input("to_periode",$_REQUEST['to_periode']);
 
-       if (isset($_REQUEST['from_poste'])) 
+       if (isset($_REQUEST['from_poste']))
          echo HtmlInput::hidden('from_poste',$_REQUEST['from_poste']);
 
-       if (isset($_REQUEST['to_poste'])) 
+       if (isset($_REQUEST['to_poste']))
          echo HtmlInput::hidden('to_poste',$_REQUEST['to_poste']);
 
-        if (isset($_REQUEST['poste_id'])) 
+        if (isset($_REQUEST['poste_id']))
          echo HtmlInput::hidden("poste_id",$_REQUEST['poste_id']);
 
        if ( isset($_REQUEST['letter'] )) echo HtmlInput::hidden('letter','2');
@@ -513,8 +513,8 @@
         echo "</form></TD>";
        echo '</tr>';
         echo "</table>";
-     
 
+
     }
     /*!
      * \brief verify that the poste belong to a ledger

Modified: phpcompta/branches/rel600-dynamic-menu/include/constant.php
===================================================================
--- phpcompta/branches/rel600-dynamic-menu/include/constant.php 2011-10-22 
20:37:48 UTC (rev 4228)
+++ phpcompta/branches/rel600-dynamic-menu/include/constant.php 2011-10-23 
18:51:09 UTC (rev 4229)
@@ -35,7 +35,12 @@
 /*set to none for production */
 /* uncomment for production */
 
-$version_phpcompta=9999;
+/*
+ * $version_phpcompta=SVNINFO;
+ * define ("DEBUG",false);
+ *
+ */
+$version_phpcompta=4208;
 define ("DEBUG",true);
 
 define ("DBVERSION",97);

Modified: phpcompta/branches/rel600-dynamic-menu/include/fiche.inc.php
===================================================================
--- phpcompta/branches/rel600-dynamic-menu/include/fiche.inc.php        
2011-10-22 20:37:48 UTC (rev 4228)
+++ phpcompta/branches/rel600-dynamic-menu/include/fiche.inc.php        
2011-10-23 18:51:09 UTC (rev 4229)
@@ -34,7 +34,7 @@
 
 $gDossier=dossier::id();
 $str_dossier=dossier::get();
-global $User;
+global $g_user;
 
 $pop_tva=new IPopup('popup_tva');
 $pop_tva->title=_('Choix TVA');
@@ -44,7 +44,7 @@
 
 $cn=new Database($gDossier);
 // Security check
-$write=$User->check_action(FICADD);
+$write=$g_user->check_action(FICADD);
 if ($write == 0 )
 {
     /* Cannot Access */
@@ -132,7 +132,7 @@
 // in the database
 if ( isset($_POST['add_modele'])    )
 {
-    $User->can_request(FICCAT);
+    $g_user->can_request(FICCAT);
     // insert the model of card in database
     $fiche_def=new Fiche_Def($cn);
     $fiche_def->Add($_POST);
@@ -141,7 +141,7 @@
 
 if ( isset ($_POST['remove_cat'] )  )
 {
-    $User->can_request(FICCAT);
+    $g_user->can_request(FICCAT);
 
     $fd_id=new Fiche_Def($cn,$_POST['fd_id']);
     $remains=$fd_id->remove();
@@ -153,7 +153,7 @@
 // Add a line in the card model
 if ( isset ($_POST["add_line"])  )
 {
-    $User->can_request(FIC);
+    $g_user->can_request(FIC);
 
     $r= '<DIV class="u_redcontent" style="width:auto">';
     if ( $write ==0)
@@ -176,7 +176,7 @@
 
 if ( isset($_POST['save_line']))
 {
-    $User->can_request(FICCAT);
+    $g_user->can_request(FICCAT);
     $fiche_def=new Fiche_Def($cn,$_REQUEST['fd_id']);
     $fiche_def->save_order($_POST);
     $r= '<DIV class="u_redcontent" style="width:auto">';
@@ -196,7 +196,7 @@
 // Remove lines from a card model
 if ( isset ($_POST['remove_line'])   )
 {
-    $User->can_request(FICCAT);
+    $g_user->can_request(FICCAT);
     $r= '<DIV class="u_redcontent" style="width:auto">';
     if ( $write ==0)
         $r.= "<h2 class=\"error\"> Pas d'accès </h2>";
@@ -219,7 +219,7 @@
 // Change the name of the card  model
 if ( isset ($_POST["change_name"] )   )
 {
-    $User->can_request(FICCAT);
+    $g_user->can_request(FICCAT);
     $r= '<DIV class="u_redcontent" style="width:auto">';
     if ( $write ==0)
         $r.= "<h2 class=\"error\"> "._("Pas d'accès")." </h2>";
@@ -250,7 +250,7 @@
             && ! isset ($_POST['move'])
             && ! isset ($_POST['delete']))
     {
-        $User->can_request(FICADD);
+        $g_user->can_request(FICADD);
 
         echo '<DIV class="u_redcontent" style="width:auto">';
         $fiche_def=new Fiche_Def($cn,$_GET['fiche']);
@@ -266,7 +266,7 @@
     {
         echo '<DIV class="u_redcontent" style="width:auto">';
         $t=false;
-        if ( $User->check_action(FICADD)==0)
+        if ( $g_user->check_action(FICADD)==0)
         {
             echo '<H2 class="info"> Vos changements ne seront pas sauvés</h2>';
             $t=true;
@@ -321,7 +321,7 @@
     // the property of the card model
     if ($action == "add_modele" )
     {
-        $User->can_request(FICCAT);
+        $g_user->can_request(FICCAT);
         echo '<DIV class="u_redcontent" style="width:auto">';
         echo '<form method="post">';
         $oFiche_Def=new Fiche_Def($cn);
@@ -338,7 +338,7 @@
     // Modify a card Model
     if ($action == "modifier" )
     {
-        $User->can_request(FICCAT);
+        $g_user->can_request(FICCAT);
         echo '<DIV class="u_redcontent" style="width:auto">';
         $fiche_def=new Fiche_Def($cn,$_GET['fiche']);
 
@@ -386,7 +386,7 @@
 // Display a blank  card from the selected category
 if ( isset ($_POST["fiche"]) && isset ($_POST["add"] ) )
 {
-    $User->can_request(FICADD);
+    $g_user->can_request(FICADD);
 
     echo '<DIV class="u_redcontent" style="width:auto">';
     if ( $write ==0)
@@ -416,7 +416,7 @@
 // delete a card
 if (isset($_POST['delete']) )
 {
-    $User->can_request(FIC);
+    $g_user->can_request(FIC);
     ShowRecherche();
     echo '<DIV class="u_redcontent">';
     if ( $write ==0)
@@ -436,7 +436,7 @@
 // Add the data (attribute) of the card
 if ( isset ($_POST["add_fiche"]) )
 {
-    $User->can_request(FICADD);
+    $g_user->can_request(FICADD);
     if ( $write ==0)
     {
         echo '<DIV class="u_redcontent">';
@@ -460,7 +460,7 @@
 // Update a card
 if ( isset ($_POST["update_fiche"])  )
 {
-    $User->can_request(FIC);
+    $g_user->can_request(FIC);
     echo '<DIV class="u_redcontent">';
     if ( $write ==0)
         echo "<h2 class=\"error\"> Pas d'accès </h2>";

Modified: phpcompta/branches/rel600-dynamic-menu/include/impress_bilan.inc.php
===================================================================
--- phpcompta/branches/rel600-dynamic-menu/include/impress_bilan.inc.php        
2011-10-22 20:37:48 UTC (rev 4228)
+++ phpcompta/branches/rel600-dynamic-menu/include/impress_bilan.inc.php        
2011-10-23 18:51:09 UTC (rev 4229)
@@ -25,14 +25,14 @@
  * \brief form who call the printing of the bilan in RTF
  *        file included by user_impress
  *
- * some variable are already defined ($cn, $User ...)
+ * some variable are already defined ($cn, $g_user ...)
  */
 
 //-----------------------------------------------------
 // Show the jrn and date
 //-----------------------------------------------------
 require_once('class_database.php');
-global $User;
+global $g_user;
 //-----------------------------------------------------
 // Form
 //-----------------------------------------------------
@@ -40,7 +40,7 @@
 $bilan=new Acc_Bilan($cn);
 $bilan->get_request_get();
 echo '<div class="content">';
-$exercice=(isset($_GET['exercice']))?$_GET['exercice']:$User->get_exercice();
+$exercice=(isset($_GET['exercice']))?$_GET['exercice']:$g_user->get_exercice();
 
 /*
  * Let you change the exercice

Modified: phpcompta/branches/rel600-dynamic-menu/include/impress_fiche.inc.php
===================================================================
--- phpcompta/branches/rel600-dynamic-menu/include/impress_fiche.inc.php        
2011-10-22 20:37:48 UTC (rev 4228)
+++ phpcompta/branches/rel600-dynamic-menu/include/impress_fiche.inc.php        
2011-10-23 18:51:09 UTC (rev 4229)
@@ -27,7 +27,7 @@
 
 $gDossier=dossier::id();
 $cn=new Database($gDossier);
-global $User;
+global $g_user;
 
 /**
  * Show first the form
@@ -39,7 +39,7 @@
 $str_categorie=$categorie->input();
 
 /* periode */
-$exercice=$User->get_exercice();
+$exercice=$g_user->get_exercice();
 $iperiode=new Periode($cn);
 list ($first,$last)=$iperiode->get_limit($exercice);
 

Modified: 
phpcompta/branches/rel600-dynamic-menu/include/impress_gl_comptes.inc.php
===================================================================
--- phpcompta/branches/rel600-dynamic-menu/include/impress_gl_comptes.inc.php   
2011-10-22 20:37:48 UTC (rev 4228)
+++ phpcompta/branches/rel600-dynamic-menu/include/impress_gl_comptes.inc.php   
2011-10-23 18:51:09 UTC (rev 4229)
@@ -27,14 +27,14 @@
  * \brief Print account (html or pdf)
  *        file included from user_impress
  *
- * some variable are already defined $cn, $User ...
+ * some variable are already defined $cn, $g_user ...
  *
  */
 //-----------------------------------------------------
 // Show the jrn and date
 //-----------------------------------------------------
 require_once('class_database.php');
-global $User;
+global $g_user;
 //-----------------------------------------------------
 // Form
 //-----------------------------------------------------
@@ -48,7 +48,7 @@
 
 $cn=new Database(dossier::id());
 $periode=new Periode($cn);
-$a=$periode->get_limit($User->get_exercice());
+$a=$periode->get_limit($g_user->get_exercice());
 // $a is an array
 $first_day=$a[0]->first_day();
 $last_day=$a[1]->last_day();
@@ -56,7 +56,7 @@
 // filter on period
 $date_from=new IDate('from_periode');
 $date_to=new IDate('to_periode');
-$year=$User->get_exercice();
+$year=$g_user->get_exercice();
 $date_from->value=(isset($_REQUEST['from_periode'])&& 
isDate($_REQUEST['from_periode'])!=0)?$_REQUEST['from_periode']:$first_day;
 $date_to->value=(isset($_REQUEST['to_periode']) && 
isDate($_REQUEST['to_periode']) !=0  )?$_REQUEST['to_periode']:$last_day;
 echo td(_('Depuis').$date_from->input());

Modified: phpcompta/branches/rel600-dynamic-menu/include/impress_jrn.inc.php
===================================================================
--- phpcompta/branches/rel600-dynamic-menu/include/impress_jrn.inc.php  
2011-10-22 20:37:48 UTC (rev 4228)
+++ phpcompta/branches/rel600-dynamic-menu/include/impress_jrn.inc.php  
2011-10-23 18:51:09 UTC (rev 4229)
@@ -29,19 +29,19 @@
 require_once('class_dossier.php');
 load_all_script();
 $gDossier=dossier::id();
-global $User;
+global $g_user;
 //-----------------------------------------------------
 // Show the jrn and date
 //-----------------------------------------------------
 require_once('class_database.php');
 
-if ( $User->Admin() == 0 && $User->is_local_admin()==0)
+if ( $g_user->Admin() == 0 && $g_user->is_local_admin()==0)
 {
     $sql="select jrn_def_id,jrn_def_name
          from jrn_def join jrn_type on jrn_def_type=jrn_type_id
          join user_sec_jrn on uj_jrn_id=jrn_def_id
          where
-         uj_login='$User->login'
+         uj_login='$g_user->login'
          and uj_priv !='X'
          ";
     $ret=$cn->make_array($sql);
@@ -59,7 +59,7 @@
                        from jrn_def join jrn_type on jrn_def_type=jrn_type_id
                        join  user_sec_jrn on uj_jrn_id=jrn_def_id
                        where
-                       uj_login='$User->id'
+                       uj_login='$g_user->id'
                        and uj_priv ='X'
                        ");
 // Pour voir tout les journal ?
@@ -71,7 +71,7 @@
 }
 if ( count($ret) < 1 )
     NoAccess();
-$exercice=(isset($_GET['exercice']))?$_GET['exercice']:$User->get_exercice();
+$exercice=(isset($_GET['exercice']))?$_GET['exercice']:$g_user->get_exercice();
 
 //-----------------------------------------------------
 // Form

Modified: phpcompta/branches/rel600-dynamic-menu/include/impress_poste.inc.php
===================================================================
--- phpcompta/branches/rel600-dynamic-menu/include/impress_poste.inc.php        
2011-10-22 20:37:48 UTC (rev 4228)
+++ phpcompta/branches/rel600-dynamic-menu/include/impress_poste.inc.php        
2011-10-23 18:51:09 UTC (rev 4229)
@@ -87,7 +87,7 @@
 
 $date_from=new IDate('from_periode');
 $date_to=new IDate('to_periode');
-$year=$User->get_exercice();
+$year=$g_user->get_exercice();
 
$date_from->value=(isset($_REQUEST['from_periode']))?$_REQUEST['from_periode']:"01.01.".$year;
 
$date_to->value=(isset($_REQUEST['to_periode']))?$_REQUEST['to_periode']:"31.12.".$year;
 echo td(_('Depuis').$date_from->input());

Modified: phpcompta/branches/rel600-dynamic-menu/include/impress_rapport.inc.php
===================================================================
--- phpcompta/branches/rel600-dynamic-menu/include/impress_rapport.inc.php      
2011-10-22 20:37:48 UTC (rev 4228)
+++ phpcompta/branches/rel600-dynamic-menu/include/impress_rapport.inc.php      
2011-10-23 18:51:09 UTC (rev 4229)
@@ -21,14 +21,14 @@
  * \brief print first the report in html and propose to print it in pdf
  *        file included by user_impress
  *
- * some variable are already defined ($cn, $User ...)
+ * some variable are already defined ($cn, $g_user ...)
  */
 require_once("class_ihidden.php");
 require_once("class_iselect.php");
 require_once("class_idate.php");
 require_once("class_acc_report.php");
 require_once('class_exercice.php');
-global $User;
+global $g_user;
 //-----------------------------------------------------
 // If print is asked
 // First time in html
@@ -174,7 +174,7 @@
 // Form
 //-----------------------------------------------------
 echo '<div class="content">';
-$exercice=(isset($_GET['exercice']))?$_GET['exercice']:$User->get_exercice();
+$exercice=(isset($_GET['exercice']))?$_GET['exercice']:$g_user->get_exercice();
 
 /*
  * Let you change the exercice

Modified: phpcompta/branches/rel600-dynamic-menu/include/impress_rec.inc.php
===================================================================
--- phpcompta/branches/rel600-dynamic-menu/include/impress_rec.inc.php  
2011-10-22 20:37:48 UTC (rev 4228)
+++ phpcompta/branches/rel600-dynamic-menu/include/impress_rec.inc.php  
2011-10-23 18:51:09 UTC (rev 4229)
@@ -25,13 +25,13 @@
  */
 require_once ('class_acc_reconciliation.php');
 require_once('function_javascript.php');
-global $User;
+global $g_user;
 
 /**
  address@hidden
  address@hidden add the export to PDF
  */
-$aledger=$User->get_ledger('ALL',3);
+$aledger=$g_user->get_ledger('ALL',3);
 echo '<div class="noprint">';
 echo '<div class="content">';
 $rjrn='';
@@ -45,7 +45,7 @@
 /*
  * Limit by date, default current exercice
  */
-list($start,$end)=$User->get_limit_current_exercice();
+list($start,$end)=$g_user->get_limit_current_exercice();
 $dstart=new IDate('p_start');
 $dstart->value=(isset($_REQUEST['p_start']))?$_REQUEST['p_start']:$start;
 
@@ -106,7 +106,6 @@
     echo "Choix invalid";
     exit();
 }
+$gDossier=Dossier::id();
 require_once('template/impress_reconciliation.php');
-exit();
-exit();
 exit();
\ No newline at end of file

Modified: phpcompta/branches/rel600-dynamic-menu/include/template/menu.php
===================================================================
--- phpcompta/branches/rel600-dynamic-menu/include/template/menu.php    
2011-10-22 20:37:48 UTC (rev 4228)
+++ phpcompta/branches/rel600-dynamic-menu/include/template/menu.php    
2011-10-23 18:51:09 UTC (rev 4229)
@@ -2,18 +2,37 @@
 <table style="width:100%">
     <tr>
        <?php
+       global $g_user;
+       // Display the menu
        for($i=0;$i < count($amenu);$i++):
-           if ( isset($module[1]) && $module[1]==$amenu[$i]['me_id']):
+           if ( isset($module[$idx+1]) && 
$module[$idx+1]==$amenu[$i]['me_code']):
                $class="selectedcell";
+?>
+       <td class="<?=$class?>">
+           <a class="mtitle" 
href="do.php?gDossier=<?=Dossier::id()?>&ac=<?=$_REQUEST['ac']?>">
+           <?=$amenu[$i]['me_menu']?>
+           </a>
+       </td>
+<?
            else:
                $class="mtitle";
-           endif;
-       ?>
-       <td class="<?=$class?>">
-           <a class="mtitle" 
href="do.php?gDossier=<?=Dossier::id()?>&ac=<?=$module[0]?>:<?=$amenu[$i]['me_id']?>">
+           $url="";$pt="";
+
+           for ($e=0;$e <= $idx;$e++):
+               $url.=$pt.$module[$e];
+               $pt="/";
+           endfor;
+           $url.=$pt.$amenu[$i]['me_code'];
+?>     <td class="<?=$class?>">
+           <a class="mtitle" 
href="do.php?gDossier=<?=Dossier::id()?>&ac=<?=$url?>">
            <?=$amenu[$i]['me_menu']?>
            </a>
        </td>
+
+
+<?
+endif;
+       ?>
        <?
            endfor;
        ?>
@@ -22,66 +41,7 @@
 
 </table>
 </div>
-<div class="content">
-<?
-// If something is selected, display the file
-if ( count($module)>1):
-    $file_to_include=$cn->get_array("select me_file,me_submenu from menu_ref
-       join menu using(me_code)
-       where
-       m_code=$1 and me_id=$2",array($module[0],$module[1]));
-$gDossier=dossier::id();
-?>
-
 <?php
-// if submenu is not null then we show the submenu
-if ( $file_to_include[0]['me_file'] == ''):
-    ?>
-    <div class="lmenu">
-    <table>
-       <tr>
-           <?php
-           $submenu=$cn->get_array("select me_id,me_code,me_menu,me_file from 
menu
-                                   join menu_ref using(me_code)
-                                   where
-                                   me_submenu in (select me_code from
-                                           menu where 
me_id=$1)",array($module[1]));
-           for ($e=0;$e<count($submenu);$e++):
-               $style="mtitle";
-               if (isset ($module[2]) && $module[2]==$submenu[$e]['me_id']):
-                   $style="selectedcell";
-               endif;
-               ?>
-           <td class="<?=$style?>">
-               <a 
href="do.php?gDossier=<?=Dossier::id()?>&ac=<?=$module[0]?>:<?=$module[1]?>:<?=$submenu[$e]['me_id']?>">
-               <?=$submenu[$e]['me_menu']?>
-               </a>
-           </td>
-           <?
-           endfor;
-           ?>
-       </tr>
-    </table>
-    </div>
-    <?php
-       $file="";
-       if (isset ($module[2])):
-           $file=$cn->get_value("select me_file from menu
-               join menu_ref using (me_code)
-               where me_id=$1",array($module[2]));
-       endif;
-    else:
-       $file=$file_to_include[0]['me_file'];
-    endif;
-?>
-
-
-
-<?php
-// otherwise we include the file
-if ($file != ''):
-    require_once "$file";
-endif;
-endif;
-?>
-</div>
+// if something is selected check if file to include or submen
+//
+ ?>

Modified: phpcompta/branches/rel600-dynamic-menu/include/template/module.php
===================================================================
--- phpcompta/branches/rel600-dynamic-menu/include/template/module.php  
2011-10-22 20:37:48 UTC (rev 4228)
+++ phpcompta/branches/rel600-dynamic-menu/include/template/module.php  
2011-10-23 18:51:09 UTC (rev 4229)
@@ -11,25 +11,25 @@
                foreach ($amodule as $row):
 
                    $style="background:white";
-                   if ( $row['m_menu']=='new_line')
+                   if ( $row['me_menu']=='new_line')
                    {
                        echo "</tr><tr>";
                        continue;
                    }
-                   if ($row['m_code']==$selected)
+                   if ($row['me_code']==$selected)
                    {
                        $style="background:red";
                    }
-                   if ( $row['m_url']!='')
+                   if ( $row['me_url']!='')
                    {
-                       $url=$row['m_url'];
+                       $url=$row['me_url'];
                    }
                    else
                    {
-                       
$url="do.php?gDossier=".Dossier::id()."&ac=".$row['m_code'];
+                       
$url="do.php?gDossier=".Dossier::id()."&ac=".$row['me_code'];
                    }
                    ?>
-               <td class="tool" style="<?=$style?>"><a class="mtitle" 
href="<?=$url?>"><?=$row['m_menu']?></td>
+               <td class="tool" style="<?=$style?>"><a class="mtitle" 
href="<?=$url?>"><?=$row['me_menu']?></td>
                <?
                    endforeach;
                ?>

Added: phpcompta/branches/rel600-dynamic-menu/sql/backup-new-object.sh
===================================================================
--- phpcompta/branches/rel600-dynamic-menu/sql/backup-new-object.sh             
                (rev 0)
+++ phpcompta/branches/rel600-dynamic-menu/sql/backup-new-object.sh     
2011-10-23 18:51:09 UTC (rev 4229)
@@ -0,0 +1 @@
+pg_dump testdossier82 --inserts -t profile -t menu_ref -t profile_menu -t 
profile_user -t v_all_menu > object-6.0.sql


Property changes on: 
phpcompta/branches/rel600-dynamic-menu/sql/backup-new-object.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: phpcompta/branches/rel600-dynamic-menu/sql/object-6.0.sql
===================================================================
--- phpcompta/branches/rel600-dynamic-menu/sql/object-6.0.sql                   
        (rev 0)
+++ phpcompta/branches/rel600-dynamic-menu/sql/object-6.0.sql   2011-10-23 
18:51:09 UTC (rev 4229)
@@ -0,0 +1,450 @@
+--
+-- PostgreSQL database dump
+--
+
+SET statement_timeout = 0;
+SET client_encoding = 'UTF8';
+SET standard_conforming_strings = off;
+SET check_function_bodies = false;
+SET client_min_messages = warning;
+SET escape_string_warning = off;
+
+SET search_path = public, pg_catalog;
+
+SET default_tablespace = '';
+
+SET default_with_oids = false;
+
+--
+-- Name: menu_ref; Type: TABLE; Schema: public; Owner: dany; Tablespace: 
+--
+
+CREATE TABLE menu_ref (
+    me_code text NOT NULL,
+    me_menu text,
+    me_file text,
+    me_module character(1),
+    me_url text
+);
+
+
+ALTER TABLE public.menu_ref OWNER TO dany;
+
+--
+-- Name: COLUMN menu_ref.me_code; Type: COMMENT; Schema: public; Owner: dany
+--
+
+COMMENT ON COLUMN menu_ref.me_code IS 'Menu Code ';
+
+
+--
+-- Name: COLUMN menu_ref.me_menu; Type: COMMENT; Schema: public; Owner: dany
+--
+
+COMMENT ON COLUMN menu_ref.me_menu IS 'Label to display';
+
+
+--
+-- Name: COLUMN menu_ref.me_file; Type: COMMENT; Schema: public; Owner: dany
+--
+
+COMMENT ON COLUMN menu_ref.me_file IS 'if not empty file to include';
+
+
+--
+-- Name: COLUMN menu_ref.me_url; Type: COMMENT; Schema: public; Owner: dany
+--
+
+COMMENT ON COLUMN menu_ref.me_url IS 'url ';
+
+
+--
+-- Name: profile; Type: TABLE; Schema: public; Owner: dany; Tablespace: 
+--
+
+CREATE TABLE profile (
+    p_name text NOT NULL,
+    p_id integer NOT NULL,
+    p_desc text
+);
+
+
+ALTER TABLE public.profile OWNER TO dany;
+
+--
+-- Name: TABLE profile; Type: COMMENT; Schema: public; Owner: dany
+--
+
+COMMENT ON TABLE profile IS 'Available profile ';
+
+
+--
+-- Name: COLUMN profile.p_desc; Type: COMMENT; Schema: public; Owner: dany
+--
+
+COMMENT ON COLUMN profile.p_desc IS 'description of the profile';
+
+
+--
+-- Name: profile_menu; Type: TABLE; Schema: public; Owner: dany; Tablespace: 
+--
+
+CREATE TABLE profile_menu (
+    pm_id integer NOT NULL,
+    me_code text,
+    me_code_dep text,
+    p_id integer,
+    p_order integer,
+    p_type_display character(1)
+);
+
+
+ALTER TABLE public.profile_menu OWNER TO dany;
+
+--
+-- Name: TABLE profile_menu; Type: COMMENT; Schema: public; Owner: dany
+--
+
+COMMENT ON TABLE profile_menu IS 'Join  between the profile and the menu ';
+
+
+--
+-- Name: COLUMN profile_menu.me_code_dep; Type: COMMENT; Schema: public; 
Owner: dany
+--
+
+COMMENT ON COLUMN profile_menu.me_code_dep IS 'menu code dependency';
+
+
+--
+-- Name: COLUMN profile_menu.p_id; Type: COMMENT; Schema: public; Owner: dany
+--
+
+COMMENT ON COLUMN profile_menu.p_id IS 'link to profile';
+
+
+--
+-- Name: COLUMN profile_menu.p_order; Type: COMMENT; Schema: public; Owner: 
dany
+--
+
+COMMENT ON COLUMN profile_menu.p_order IS 'order of displaying menu';
+
+
+--
+-- Name: COLUMN profile_menu.p_type_display; Type: COMMENT; Schema: public; 
Owner: dany
+--
+
+COMMENT ON COLUMN profile_menu.p_type_display IS 'M is a module
+E is a menu';
+
+
+--
+-- Name: profile_menu_pm_id_seq; Type: SEQUENCE; Schema: public; Owner: dany
+--
+
+CREATE SEQUENCE profile_menu_pm_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MAXVALUE
+    NO MINVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.profile_menu_pm_id_seq OWNER TO dany;
+
+--
+-- Name: profile_menu_pm_id_seq; Type: SEQUENCE OWNED BY; Schema: public; 
Owner: dany
+--
+
+ALTER SEQUENCE profile_menu_pm_id_seq OWNED BY profile_menu.pm_id;
+
+
+--
+-- Name: profile_menu_pm_id_seq; Type: SEQUENCE SET; Schema: public; Owner: 
dany
+--
+
+SELECT pg_catalog.setval('profile_menu_pm_id_seq', 19, true);
+
+
+--
+-- Name: profile_p_id_seq; Type: SEQUENCE; Schema: public; Owner: dany
+--
+
+CREATE SEQUENCE profile_p_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MAXVALUE
+    NO MINVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.profile_p_id_seq OWNER TO dany;
+
+--
+-- Name: profile_p_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dany
+--
+
+ALTER SEQUENCE profile_p_id_seq OWNED BY profile.p_id;
+
+
+--
+-- Name: profile_p_id_seq; Type: SEQUENCE SET; Schema: public; Owner: dany
+--
+
+SELECT pg_catalog.setval('profile_p_id_seq', 1, true);
+
+
+--
+-- Name: profile_user; Type: TABLE; Schema: public; Owner: dany; Tablespace: 
+--
+
+CREATE TABLE profile_user (
+    user_name text NOT NULL,
+    pu_id integer NOT NULL,
+    p_id integer
+);
+
+
+ALTER TABLE public.profile_user OWNER TO dany;
+
+--
+-- Name: TABLE profile_user; Type: COMMENT; Schema: public; Owner: dany
+--
+
+COMMENT ON TABLE profile_user IS 'Contains the available profile for users';
+
+
+--
+-- Name: COLUMN profile_user.user_name; Type: COMMENT; Schema: public; Owner: 
dany
+--
+
+COMMENT ON COLUMN profile_user.user_name IS 'fk to available_user : login';
+
+
+--
+-- Name: COLUMN profile_user.p_id; Type: COMMENT; Schema: public; Owner: dany
+--
+
+COMMENT ON COLUMN profile_user.p_id IS 'fk to profile';
+
+
+--
+-- Name: profile_user_pu_id_seq; Type: SEQUENCE; Schema: public; Owner: dany
+--
+
+CREATE SEQUENCE profile_user_pu_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MAXVALUE
+    NO MINVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.profile_user_pu_id_seq OWNER TO dany;
+
+--
+-- Name: profile_user_pu_id_seq; Type: SEQUENCE OWNED BY; Schema: public; 
Owner: dany
+--
+
+ALTER SEQUENCE profile_user_pu_id_seq OWNED BY profile_user.pu_id;
+
+
+--
+-- Name: profile_user_pu_id_seq; Type: SEQUENCE SET; Schema: public; Owner: 
dany
+--
+
+SELECT pg_catalog.setval('profile_user_pu_id_seq', 1, true);
+
+
+--
+-- Name: v_all_menu; Type: VIEW; Schema: public; Owner: dany
+--
+
+CREATE VIEW v_all_menu AS
+    SELECT pm.me_code, pm.pm_id, pm.me_code_dep, pm.p_order, 
pm.p_type_display, pu.user_name, pu.pu_id, p.p_name, p.p_desc, mr.me_menu, 
mr.me_file, mr.me_module, mr.me_url FROM (((profile_menu pm JOIN profile_user 
pu ON ((pu.p_id = pm.p_id))) JOIN profile p ON ((p.p_id = pm.p_id))) JOIN 
menu_ref mr USING (me_code)) ORDER BY pm.p_order;
+
+
+ALTER TABLE public.v_all_menu OWNER TO dany;
+
+--
+-- Name: p_id; Type: DEFAULT; Schema: public; Owner: dany
+--
+
+ALTER TABLE profile ALTER COLUMN p_id SET DEFAULT 
nextval('profile_p_id_seq'::regclass);
+
+
+--
+-- Name: pm_id; Type: DEFAULT; Schema: public; Owner: dany
+--
+
+ALTER TABLE profile_menu ALTER COLUMN pm_id SET DEFAULT 
nextval('profile_menu_pm_id_seq'::regclass);
+
+
+--
+-- Name: pu_id; Type: DEFAULT; Schema: public; Owner: dany
+--
+
+ALTER TABLE profile_user ALTER COLUMN pu_id SET DEFAULT 
nextval('profile_user_pu_id_seq'::regclass);
+
+
+--
+-- Data for Name: menu_ref; Type: TABLE DATA; Schema: public; Owner: dany
+--
+
+INSERT INTO menu_ref VALUES ('CARD', 'Fiche', 'fiche.inc.php', 'N', NULL);
+INSERT INTO menu_ref VALUES ('STOCK', 'Stock', 'stock.inc.php', 'N', NULL);
+INSERT INTO menu_ref VALUES ('MISC', 'Opérations Diverses', 
'compta_ods.inc.php', 'N', NULL);
+INSERT INTO menu_ref VALUES ('HIST', 'Historique', 'user_action_gl.php', 'N', 
NULL);
+INSERT INTO menu_ref VALUES ('VEN', 'Vente', 'compta_ven.inc.php', 'N', NULL);
+INSERT INTO menu_ref VALUES ('ACH', 'Achat', 'compta_ach.inc.php', 'N', NULL);
+INSERT INTO menu_ref VALUES ('FIN', 'Financier', 'compta_fin.inc.php', 'N', 
NULL);
+INSERT INTO menu_ref VALUES ('LET', 'Lettrage', 'letter.inc.php', 'N', NULL);
+INSERT INTO menu_ref VALUES ('PREOD', 'Opérations prédéfinies', 
'preod.inc.php', 'N', NULL);
+INSERT INTO menu_ref VALUES ('VERIFBIL', 'Vérification ', 
'verif_bilan.inc.php', 'N', NULL);
+INSERT INTO menu_ref VALUES ('REPORT', 'Création de rapport', 
'report.inc.php', 'N', NULL);
+INSERT INTO menu_ref VALUES ('OPEN', 'Ecriture Ouverture', 'opening.inc.php', 
'N', NULL);
+INSERT INTO menu_ref VALUES ('ADM', 'Administration', 'adm.inc.php', 'N', 
NULL);
+INSERT INTO menu_ref VALUES ('SUPPL', 'Fournisseur', 'supplier.inc.php', 'N', 
NULL);
+INSERT INTO menu_ref VALUES ('FOLLOW', 'Courrier', 'action.inc.php', 'N', 
NULL);
+INSERT INTO menu_ref VALUES ('FORECAST', 'Prévision', 'forecast.inc.php', 'N', 
NULL);
+INSERT INTO menu_ref VALUES ('IMPJRN', 'Historique', 'impress_jrn.inc.php', 
'N', NULL);
+INSERT INTO menu_ref VALUES ('IMPREC', 'Rapprochement', 'impress_rec.inc.php', 
'N', NULL);
+INSERT INTO menu_ref VALUES ('IMPPOSTE', 'Poste', 'impress_poste.inc.php', 
'N', NULL);
+INSERT INTO menu_ref VALUES ('IMPREPORT', 'Rapport', 
'impress_rapport.inc.php', 'N', NULL);
+INSERT INTO menu_ref VALUES ('IMPBILAN', 'Bilan', 'impress_bilan.inc.php', 
'N', NULL);
+INSERT INTO menu_ref VALUES ('IMPGL', 'Grand Livre', 
'impress_gl_comptes.inc.php', 'N', NULL);
+INSERT INTO menu_ref VALUES ('IMPBAL', 'Balance', 'balance.inc.php', 'N', 
NULL);
+INSERT INTO menu_ref VALUES ('IMPCARD', 'Catégorie de Fiches', 
'impress_fiche.inc.php', 'N', NULL);
+INSERT INTO menu_ref VALUES ('CUSTDET', 'Fiche', 'detail_client.inc.php', 'N', 
NULL);
+INSERT INTO menu_ref VALUES ('CUSTFOLLOW', 'Suivi', 'suivi_client.inc.php', 
'N', NULL);
+INSERT INTO menu_ref VALUES ('CUSTOP', 'Opération', 
'operation_client.inc.php', 'N', NULL);
+INSERT INTO menu_ref VALUES ('CARDBAL', 'Balance', 'balance_card.inc.php', 
'N', NULL);
+INSERT INTO menu_ref VALUES ('CUST', 'Client', 'client.inc.php', 'N', NULL);
+INSERT INTO menu_ref VALUES ('ANC', 'C. Analytique', NULL, 'Y', NULL);
+INSERT INTO menu_ref VALUES ('PARAM', 'Paramètre', NULL, 'Y', NULL);
+INSERT INTO menu_ref VALUES ('GESTION', 'Gestion', NULL, 'Y', NULL);
+INSERT INTO menu_ref VALUES ('CUSTCONTACT', 'Contact (à faire)', NULL, 'N', 
NULL);
+INSERT INTO menu_ref VALUES ('COMPTA', 'Comptabilité', NULL, 'Y', NULL);
+INSERT INTO menu_ref VALUES ('LOGOUT', 'Sortie', NULL, 'Y', 'logout.php');
+INSERT INTO menu_ref VALUES ('DASHBOARD', 'Tableau de bord', 
'dashboard.inc.php', 'Y', NULL);
+INSERT INTO menu_ref VALUES ('IMP', 'Impression', NULL, 'N', NULL);
+
+
+--
+-- Data for Name: profile; Type: TABLE DATA; Schema: public; Owner: dany
+--
+
+INSERT INTO profile VALUES ('default', 1, 'Profil par défaut');
+
+
+--
+-- Data for Name: profile_menu; Type: TABLE DATA; Schema: public; Owner: dany
+--
+
+INSERT INTO profile_menu VALUES (1, 'COMPTA', NULL, 1, 1, 'M');
+INSERT INTO profile_menu VALUES (2, 'ANC', NULL, 1, 2, 'M');
+INSERT INTO profile_menu VALUES (3, 'ACH', 'COMPTA', 1, 3, 'E');
+INSERT INTO profile_menu VALUES (4, 'VEN', 'COMPTA', 1, 4, 'E');
+INSERT INTO profile_menu VALUES (5, 'CARD', 'COMPTA', 1, 5, 'E');
+INSERT INTO profile_menu VALUES (6, 'IMP', 'COMPTA', 1, 6, 'E');
+INSERT INTO profile_menu VALUES (9, 'IMPPOSTE', 'IMP', 1, 7, 'E');
+INSERT INTO profile_menu VALUES (10, 'IMPREC', 'IMP', 1, 8, 'E');
+INSERT INTO profile_menu VALUES (11, 'IMPREPORT', 'IMP', 1, 9, 'E');
+INSERT INTO profile_menu VALUES (13, 'IMPBILAN', 'IMP', 1, 11, 'E');
+INSERT INTO profile_menu VALUES (14, 'IMPCARD', 'IMP', 1, 12, 'E');
+INSERT INTO profile_menu VALUES (15, 'IMPGL', 'IMP', 1, 13, 'E');
+INSERT INTO profile_menu VALUES (16, 'IMPJRN', 'IMP', 1, 14, 'E');
+INSERT INTO profile_menu VALUES (17, 'IMPBAL', 'IMP', 1, 15, 'E');
+INSERT INTO profile_menu VALUES (18, 'MISC', 'COMPTA', 1, 16, 'E');
+INSERT INTO profile_menu VALUES (19, 'FIN', 'COMPTA', 1, 17, 'E');
+INSERT INTO profile_menu VALUES (20, 'LOGOUT', NULL, 1, 19, 'M');
+
+
+--
+-- Data for Name: profile_user; Type: TABLE DATA; Schema: public; Owner: dany
+--
+
+INSERT INTO profile_user VALUES ('phpcompta', 1, 1);
+
+
+--
+-- Name: menu_ref_pkey; Type: CONSTRAINT; Schema: public; Owner: dany; 
Tablespace: 
+--
+
+ALTER TABLE ONLY menu_ref
+    ADD CONSTRAINT menu_ref_pkey PRIMARY KEY (me_code);
+
+
+--
+-- Name: profile_menu_pkey; Type: CONSTRAINT; Schema: public; Owner: dany; 
Tablespace: 
+--
+
+ALTER TABLE ONLY profile_menu
+    ADD CONSTRAINT profile_menu_pkey PRIMARY KEY (pm_id);
+
+
+--
+-- Name: profile_pkey; Type: CONSTRAINT; Schema: public; Owner: dany; 
Tablespace: 
+--
+
+ALTER TABLE ONLY profile
+    ADD CONSTRAINT profile_pkey PRIMARY KEY (p_id);
+
+
+--
+-- Name: profile_user_pkey; Type: CONSTRAINT; Schema: public; Owner: dany; 
Tablespace: 
+--
+
+ALTER TABLE ONLY profile_user
+    ADD CONSTRAINT profile_user_pkey PRIMARY KEY (pu_id);
+
+
+--
+-- Name: profile_user_user_name_key; Type: CONSTRAINT; Schema: public; Owner: 
dany; Tablespace: 
+--
+
+ALTER TABLE ONLY profile_user
+    ADD CONSTRAINT profile_user_user_name_key UNIQUE (user_name, p_id);
+
+
+--
+-- Name: fki_profile_menu_menu_ref; Type: INDEX; Schema: public; Owner: dany; 
Tablespace: 
+--
+
+CREATE INDEX fki_profile_menu_menu_ref ON profile_menu USING btree (me_code);
+
+
+--
+-- Name: fki_profile_menu_profile; Type: INDEX; Schema: public; Owner: dany; 
Tablespace: 
+--
+
+CREATE INDEX fki_profile_menu_profile ON profile_menu USING btree (p_id);
+
+
+--
+-- Name: profile_menu_me_code_fkey; Type: FK CONSTRAINT; Schema: public; 
Owner: dany
+--
+
+ALTER TABLE ONLY profile_menu
+    ADD CONSTRAINT profile_menu_me_code_fkey FOREIGN KEY (me_code) REFERENCES 
menu_ref(me_code);
+
+
+--
+-- Name: profile_menu_p_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 
dany
+--
+
+ALTER TABLE ONLY profile_menu
+    ADD CONSTRAINT profile_menu_p_id_fkey FOREIGN KEY (p_id) REFERENCES 
profile(p_id);
+
+
+--
+-- Name: profile_user_p_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 
dany
+--
+
+ALTER TABLE ONLY profile_user
+    ADD CONSTRAINT profile_user_p_id_fkey FOREIGN KEY (p_id) REFERENCES 
profile(p_id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- PostgreSQL database dump complete
+--
+




reply via email to

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