diff --git a/include/user_action_ach.php b/include/user_action_ach.php new file mode 100644 index 000000000..ff421c2b8 --- /dev/null +++ b/include/user_action_ach.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/include/user_action_fin.php b/include/user_action_fin.php new file mode 100644 index 000000000..ff421c2b8 --- /dev/null +++ b/include/user_action_fin.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/include/user_action_ods.php b/include/user_action_ods.php new file mode 100644 index 000000000..ff421c2b8 --- /dev/null +++ b/include/user_action_ods.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/include/user_action_ven.php b/include/user_action_ven.php new file mode 100644 index 000000000..ff421c2b8 --- /dev/null +++ b/include/user_action_ven.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/include/user_menu.php b/include/user_menu.php index ad51fe1ee..84437b99c 100644 --- a/include/user_menu.php +++ b/include/user_menu.php @@ -1,24 +1,24 @@

$l_name

"; - $p_array=array(array("user_facture.php" ,"Vente"), - array("user_achat.php","Achat"), - array("user_banque.php","Banque"), - array("user_od.php","Op. Diverses"), + $p_array=array(array("user_jrn.php?JRN_TYPE=VEN" ,"Vente"), + array("user_jrn.php?JRN_TYPE=ACH","Achat"), + array("user_jrn.php?JRN_TYPE=FIN","Banque"), + array("user_jrn.php?JRN_TYPE=OD","Op. Diverses"), array("fiche.php?p_dossier=$p_dossier","Fiche"), array("not_implemented.php","Avancé"), array("dossier_prefs.php","Paramètre") @@ -216,27 +216,6 @@ function u_ShowMenuJrnUser($p_dossier,$p_user,$p_type,$p_jrn) $l_jrn=sprintf("dossier%d",$p_dossier); $Cn=DbConnect($l_jrn); - switch ($p_type) { - case ACH : - $type='ACH'; - $ref="user_achat.php"; - break; - case VEN: - $type='VEN'; - $ref="user_facture.php"; - break; - case BQE: - $type='FIN'; - $ref="user_banque.php"; - break; - case ODS: - $type="OD"; - $ref="user_od.php"; - break; - default: - echo '

Invalid Type

'; - exit(-1); - } $l_jrn=sprintf("dossier%d",$p_dossier); $Cn=DbConnect($l_jrn); @@ -248,13 +227,13 @@ function u_ShowMenuJrnUser($p_dossier,$p_user,$p_type,$p_jrn) where uj_login='$p_user' and uj_priv !='X' - and jrn_def_type='$type' + and jrn_def_type='$p_type' "); } else { $Ret=ExecSql($Cn,"select jrn_def_id,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_deb_max_line,jrn_cred_max_line, jrn_type_id,jrn_desc,'W' as uj_priv from jrn_def join jrn_type on jrn_def_type=jrn_type_id where - jrn_def_type='$type'"); + jrn_def_type='$p_type'"); } $Max=pg_NumRows($Ret); @@ -275,19 +254,51 @@ function u_ShowMenuJrnUser($p_dossier,$p_user,$p_type,$p_jrn) echo_debug("p_jrn = $p_jrn "); if ( $l_line['jrn_def_id'] != $p_jrn ) { echo ''; - printf ('%s',$ref, - $l_line['jrn_def_id'],$l_line['jrn_def_name']); - } - else { - echo ''; - printf ('%s', - $l_line['jrn_def_name']); - } - } - } + printf ('%s', + $l_line['jrn_def_id'], + $l_line['jrn_def_name'] + ); + } else + { + echo ''. $l_line['jrn_def_name'].''; + } + }// if right + }// for echo ""; echo ''; +} +/* function u_ShowMenuJrn + * Purpose : Show the menu of the jrn depending of its type + * + * parm : + * - p_cn database connection + * - p_dossier + * - p_UserProperty + * - p_jrn_type + * - p_jrn + * gen : + * - none + * return: + * - string containing the menu + */ +function u_ShowMenuJrn($p_cn,$p_jrn_type) +{ + + $Res=ExecSql($p_cn,"select ja_name,ja_url,ja_action from jrn_action where ja_jrn_type='$p_jrn_type' + order by ja_id"); + $num=pg_NumRows($Res); + if ($num==0) return ""; + // Retrieve in the database the menu + $ret=""; + for ($i=0;$i<$num;$i++) { + $action=pg_fetch_array($Res,$i); + $ret.=sprintf('', + $action['ja_url'],$action['ja_action'],$action['ja_name']); + } + $ret.='
%s
'; + return $ret; + } ?>