"; $result.=''; if ( $p_admin == 1 ) { $result.=" Administration : "; } $result.=': Sortir'; $result.=""; $result.=""; $result.=""; for ($i=0;$i"; $result.=""; } $result.="
"; $result.=$id." $name"; $result.=""; $result.=$desc; $result.=""; $result.="Comptabilité"; $result.="
"; return $result; } /* function GetAvailableFolder * Purpose : Get all the available folders * for the users * parm : * - $p_user user login * - $p_admin 1 if admin * gen : * - none * return: * - array containing ac_dossier.dos_id * ac_dossier.dos_name * ac_dossier.dos_description * */ function GetAvailableFolder($p_user,$p_admin) { $filter=""; if ($p_admin==0) { // show only available folders // if user is not an admin $sql="select distinct dos_id,dos_name,dos_description from ac_users natural join jnt_use_dos natural join ac_dossier join priv_user on ( priv_jnt=jnt_id) where use_active=1 and use_login='$p_user' and priv_priv != 'NO' "; } else { $sql="select distinct dos_id,dos_name,dos_description from ac_users natural join jnt_use_dos natural join ac_dossier where use_active=1 "; } include_once("postgres.php"); $cn=DbConnect(); $Res=ExecSql($cn,$sql); $max=pg_numRows($Res); if ( $max == 0 ) return 0; for ($i=0;$i<$max;$i++) { $array[]=pg_fetch_array($Res,$i); } return $array; } /* function u_ShowMenu * Purpose : Show The login menu * * parm : * - $p_admin 1 if admin * - $p_item item to add * gen : * - none * return: * - nothing * */ function u_ShowMenu($p_admin,$p_check = 1,$p_item="") { /* $p_check == 1 si test sur Admin */ include_once("postgres.php"); echo '
'; echo ""; if ( $p_admin !=0 ) { /* Administrator Menu */ echo ''; } if (strlen ( $p_item ) != 0 ) { echo ''; } echo ' '; echo ""; echo "
Administrator Menu'.$p_item.' Préférence"; html_button_logout(); echo "
"; echo "
"; } /* function u_ShowMenuCompta * purpose : show the top menu for * the user profile * parm : p_dossier * * return: none * * gen : none */ function u_ShowMenuCompta($p_dossier) { include_once("postgres.php"); $l_name=GetDossierName($p_dossier); $p_array=array(array("user_jrn.php?show","Journaux"), array("recherche.php?p_dossier=$p_dossier","Recherche"), array("fiche.php?p_dossier=$p_dossier","Fiche"), array("user_impress.php","Impression"), array("user_advanced.php","Avancé"), array("dossier_prefs.php","Paramètre"), array('user_pref.php','Preference'), array('login.php','Accueil'), array('logout.php','logout') ); $result=ShowItem($p_array,'H'); //echo "
"; echo "

$l_name

"; echo $result; //echo "
"; } /* function ShowMenuComptaRight * Purpose : Display menu on the Right * (preference, logout and admin) * parm : * - $p_dossier the current dossier * - $p_admin $g_UserProperty['use_admin'] 1 if admin * - $p_more code * gen : * - none * return: * - string containing the html menu * */ function u_ShowMenuComptaRight($p_dossier=0,$p_admin,$p_more="") { include_once("ac_common.php"); $i=0; if ( $p_admin != 0 && $p_dossier != 0) { $p_array[$i++]=array("admin_repo.php","Admin"); } $p_array[$i++]=array('login.php','Accueil'); $p_array[$i++]=array('user_pref.php','Preference'); $p_array[$i]=array('logout.php','logout'); $menu=ShowItem($p_array); echo '
'; echo $menu; echo '
'; } /* function u_ShowMenuJrnUser($p_dossier,$p_user) * Purpose : Show the Menu from the jrn encode * page * * parm : * - $p_dossier * - $p_user * - $p_type type of journal (VEN,ACH,BQE,ODS) * - $p_jrn journal * gen : * - none * return: * - none * */ function u_ShowMenuJrnUser($p_dossier,$p_user,$p_type,$p_jrn) { include_once ("debug.php"); include_once("constant.php"); include_once("class_user.php"); echo_debug(__FILE__,__LINE__,"U_SHOWMENUJRNUSER PTYPE=$p_type"); // echo '
'; echo ''; include_once("postgres.php"); $Cn=DbConnect($p_dossier); $User=new cl_user($Cn); if ( $User->Admin() ==0) { $Ret=ExecSql($Cn,"select jrn_def_id,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_type_id,jrn_desc,uj_priv, jrn_deb_max_line,jrn_cred_max_line 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='$p_user' and uj_priv !='X' 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='$p_type'"); } $Max=pg_NumRows($Ret); include_once("check_priv.php"); for ($i=0;$i<$Max;$i++) { $l_line=pg_fetch_array($Ret,$i); // Admin have always rights if ( $User->Admin() == 0 ){ $right=CheckJrn($p_dossier,$p_user,$l_line['jrn_def_id']); }else { $right=3; } if ( $right > 0 ) { // Minimum Lecture echo_debug(__FILE__,__LINE__,"p_jrn = $p_jrn "); if ( $l_line['jrn_def_id'] != $p_jrn ) { echo '', $l_line['jrn_def_id'], $l_line['jrn_def_name'] ); } else { echo ''; } }// if right }// for echo ''; echo "
'; printf ('%s'. $l_line['jrn_def_name'].'
"; //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,ja_desc 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=""; $access_key_list = array(); for ($i=0;$i<$num;$i++) { $action=pg_fetch_array($Res,$i); $access_key=get_quick_key($action['ja_name'],$access_key_list); $lib=str_replace($access_key,''.$access_key.'',$action['ja_name'],1); $ret.=sprintf('', $access_key, $action['ja_desc'], $action['ja_url'],$action['ja_action'], $lib); } $ret.='
%s
'; return $ret; } /* function get_quick_key * Purpose : Show the menu of the jrn depending of its type * return a not yet used access key. The returned key is added to $access_key_list * parm : * - $title * - &$access_key_list * gen : * - none * return: * - string containing the menu */ function get_quick_key($title,&$access_key_list) { $quick = $title[0]; if(array_key_exists($quick, $access_key_list)) { echo_debug(" key exists: " . $quick); return get_quick_key(substr($title, 1), $access_key_list); } else { echo_debug(" new key: " . $quick); } $access_key_list[$quick] = $quick; //var_dump($access_key_list); return $quick; } /* function u_ShowMenuRecherche ($p_cn,$p_jrn,$p_sessid,$p_array=null) * Purpose : * * parm : * - $p_cn database connection * - $p_jrn jrn id * - $p_array=null previous search * gen : * - none * return: * - none * */ function u_ShowMenuRecherche($p_cn,$p_jrn,$p_sessid,$p_array=null) { echo_debug(__FILE__,__LINE__,"u_ShowMenuRecherche($p_cn,$p_array)"); include ("form_input.php"); if ( $p_array != null ) { foreach ( $p_array as $key=> $element) { ${"p_$key"}=$element; echo_debug(__FILE__,__LINE__,"p_$key =$element;"); } } // Find the journal property // $JrnProperty=GetJrnProperty($p_cn,$p_jrn); $opt='