"; for ($i=0;$icheck_dossier($id)!='P') { $target="access.php?gDossier=$id"; } else { $target="extension.php?gDossier=$id"; } $result.=""; $result.=""; $result.=""; $result.=$id." ".h($name).""; $result.=""; $result.=""; $desc=($desc=="")?"Aucune description":h($desc); $desc="$desc"; $result.="".$desc; $result.=""; $result.=""; } $result.=""; return $result; } /*! * \brief Get all the available folders * for the users, checked with the security * * \param $p_user user login * \param $p_admin 1 if admin * \return array containing * - ac_dossier.dos_id * - ac_dossier.dos_name * - ac_dossier.dos_description * */ function GetAvailableFolder($p_user,$p_admin,$p_filter="") { $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 != 'X' and dos_name ilike '%$p_filter%' order by dos_name"; } else { $sql="select distinct dos_id,dos_name,dos_description from ac_dossier where dos_name ilike '%$p_filter%' order by dos_name"; } require_once('class_database.php'); $cn=new Database(); $Res=$cn->exec_sql($sql); $max=Database::num_row($Res); if ( $max == 0 ) return 0; for ($i=0;$i<$max;$i++) { $array[]=Database::fetch_array($Res,$i); } return $array; } /*! * \brief show the top menu for the user profile * and highight the selected one * \param p_high what to hightlight, by default it is autodetected * but sometimes it must be given. Default value="" * * \return string * */ function ShowMenuCompta($p_high="") { require_once('class_database.php'); // find our current menu $default=basename($_SERVER['PHP_SELF']); switch ($default) { case "user_jrn.php": $default.="?show&".dossier::get(); break; } if ( $p_high !== "" ) $default=$p_high; $default=-1; if ( isset($_REQUEST['p_action'])) { switch ($_REQUEST['p_action'] ) { case 'impress': $default=5; break; case 'fiche': $default=6; break; case 'quick_writing': $default=4; break; case 'gl': $default=0; break; case 'ven': $default=1; break; case 'client': $default=1; break; case 'ach': case 'fournisseur': $default=2; break; case 'fin': $default=3; break; case 'let': $default=10; break; } } $str_dossier=dossier::get(); $p_array=array( array("compta.php?p_action=gl&".$str_dossier ,_("Grand Livre"),_("Grand livre : toutes les opérations"),0), array("compta.php?p_action=ven&".$str_dossier ,_("Vente"),_("Journal de vente / produit"),1), array("compta.php?p_action=ach&".$str_dossier,_("Dépense"),_("Journaux de dépense, d'achat"),2 ), array("compta.php?p_action=fin&".$str_dossier,_("Financier"),_("Journaux financiers: les banques, la caisse"),3), array('compta.php?p_action=quick_writing&'.$str_dossier,_('Opération Diverses'),_('Journaux d\'OD: salaires, déclarations TVA,...'),4), array("compta.php?p_action=impress&".$str_dossier,_("Impression"),_("Impression"),5), array("compta.php?p_action=fiche&".$str_dossier,_("Fiche"),_("Ajouter, modifier ou effacer des fiches"),6), array("compta.php?p_action=let&".$str_dossier,_("Lettrage"),_("Ajouter, modifier ou effacer des lettrage"),10), array("user_advanced.php?".$str_dossier,_("Avancé"),_("Opérations délicates"),7), ); $result=ShowItem($p_array,'H',"mtitle","mtitle",$default,' width="100%"'); $str_dossier=dossier::get(); $r=""; $r.=menu_tool("compta.php"); $r.='
'; $r.=$result; $r.='
'; return $r; } /*! ************************************************** * \brief build the menu of user_advanced.php * * \param $default * * \return the menu */ function ShowMenuAdvanced($default="") { $str_dossier=dossier::get(); // Show the left menu $left_menu=ShowItem(array( //('rapprt.php','Rapprochement'), array('user_advanced.php?'.$str_dossier.'&p_action=preod',_('Ecritures definies'),"",9), array('user_advanced.php?p_action=periode&'.$str_dossier,_('Periode'),_("Gestion des periodes"),2), array('compta.php?p_action=stock&'.$str_dossier,'Stock',_("Gestion des stocks"),5), array('user_advanced.php?p_action=defreport&'.$str_dossier,_('Rapport'),_("Rapport"),6), array('import.php?'.$str_dossier,_('Import Banque'),_("Banque"),7), array('user_advanced.php?p_action=ouv&'.$str_dossier,_('Ecriture ouverture'),"",8), array('user_advanced.php?p_action=verif&'.$str_dossier,_('Vérification'),"",10) ), 'H',"mtitle","mtitle",$default); $r='
'.$left_menu."
"; return $r; } /*! * \brief Show the menu for the card management * * \param $p_dossier dossier 1 * * * * \return nothing */ function ShowMenuFiche($p_dossier) { $cn=new Database($p_dossier); $str_dossier=dossier::get(); echo ''; } /*! MenuAdmin */ /* \brief show the menu for user/database management /* /* \return HTML code with the menu */ function MenuAdmin() { $def=-1; if (isset($_REQUEST['UID'])) $def=0; if ( isset ($_REQUEST['action'])){ switch ($_REQUEST['action']) { case 'user_mgt': $def=0; break; case 'dossier_mgt': $def=1; break; case 'modele_mgt': $def=2; break; case 'restore'; $def=3; break; } } $item=array (array("admin_repo.php?action=user_mgt",_("Utilisateurs"),_('Gestion des utilisateurs'),0), array("admin_repo.php?action=dossier_mgt",_("Dossiers"),_('Gestion des dossiers'),1), array("admin_repo.php?action=modele_mgt",_("Modèles"),_('Gestion des modèles'),2), array("admin_repo.php?action=restore",_("Restaure"),_("Restaure une base de données"),3), array("login.php",_("Accueil")), array("logout.php",_("Sortie")) ); $menu=ShowItem($item,'H',"mtitle","mtitle",$def,' width="100%" '); return $menu; } /*! * \brief Show the parameter menu * * \param $p_action the last action choosed * * * * \return HTML Code * * */ function ShowMenuParam($p_action="") { $s=dossier::get(); $sub_menu=ShowItem(array( array('parametre.php?p_action=company&'.$s,_('Sociétés'),_('Parametre societe'),1), array('parametre.php?p_action=divers&'.$s,_('Divers'),_('Devise, moyen de paiement'),2), array('parametre.php?p_action=pcmn&'.$s,_('Plan Comptable'),_('Modification du plan comptable'),11), array('parametre.php?p_action=ext&'.$s,_('Extension'),_('Extension'),3), array('parametre.php?p_action=sec&'.$s,_('Sécurité'),_('securite'),8), array('parametre.php?p_action=preod&'.$s,_('Ecritures définies'),_('Ecritures définies'),12), array('parametre.php?p_action=document&'.$s,_('Document'),_('Facture, lettre de rappel, proposition...'),7), array('parametre.php?p_action=jrn&'.$s,_('Journaux'),_('Creation et modification de journaux'),10) ), 'H',"mtitle","mtitle",$p_action,' width="100%"'); return $sub_menu; } /*! * \brief display the html the menu in the jrn page * * \return nothing * * */ function MenuJrn() { $str_dossier=dossier::get(); echo ''; echo ''; require_once('class_database.php'); $Cn=new Database(dossier::id()); $Ret=$Cn->exec_sql("select jrn_def_id,jrn_def_name, jrn_def_class_deb,jrn_def_class_cred,jrn_type_id,jrn_desc from jrn_def join jrn_type on jrn_def_type=jrn_type_id order by jrn_def_name"); $Max=Database::num_row($Ret); for ($i=0;$i<$Max;$i++) { $l_line=Database::fetch_array($Ret,$i); printf ('', $l_line['jrn_def_id'],$l_line['jrn_def_name']); } echo "
'._('Création').'
%s
"; } /*! * \brief Show the menu from the pcmn page * * \param $p_start class start default=1 * * * * \return nothing * * */ function ShowMenuPcmn($p_start=1) { $str_dossier="&".dossier::get(); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo "
0'._(' Hors Bilan').'
1'._(' Immobilisé').'
2 '._('Actif a un an au plus').'
3 '._('Stock et commande').'
4 '._('Compte tiers').'
5'._('Actif').'
6'._('Charges').'
7'._('Produits').'
8'._('Hors Comptabilité').'
9 '._('Hors Comptabilité').'
"; } /*! * \brief Show the menu for importing, verify and transfert Bank CSV * * \return nothing */ function ShowMenuImport(){ $str_dossier=dossier::get(); echo ''; echo ''; echo ''; echo ''; echo "
'._('Importer CSV').'
'._('Verif CSV').'
'._('Transfert CSV').'
"; } /*!\brief show the top menu to access the different modules in top * \param $p_from from which module this function is called * \note must include javascript : acc_ledger.js * \return string */ function menu_tool($p_from) { if ( ! isset ($_REQUEST['gDossier'])) return "" ; $r=""; $r.= '
'; $r.= '
'; $r.= "

Dossier : ".h(dossier::name())."

"; $r.= '
'; $r.= '
'; if ( $p_from == 'compta') $view='E'; else $view='S'; $agent=$_SERVER['HTTP_USER_AGENT']; $amodule=array( array('value'=>'access.php','label'=>_('Tableau de bord')), array('value'=>'user_pref.php','label'=>_('Preference')), array('value'=>'parametre.php','label'=>_('Paramètre')), array('value'=>'user_login.php','label'=>_('Autre Dossier')), array('value'=>'logout.php','label'=>_('Deconnexion')), array('value'=>'new_line'), array('value'=>'compta.php','label'=>_('Compta Générale')), array('value'=>'commercial.php','label'=>_('Gestion')), array('value'=>'comptanalytic.php','label'=>_('Compt. Analytique')), array('value'=>'extension.php','label'=>_('Extension')) ) ; $gDossier=dossier::id(); $r.= ''; foreach($amodule as $col ) { $url=$col['value'].'?'.dossier::get(); if ( $p_from==$col['value']) { $r.= ''; } else { if ( $col['value']=='new_line') { $r.=''; continue; } $r.= ''; } } $r.=''; $r.=''; $r.= '
'. ''.$col['label'].''. '
'. ''.$col['label'].''. ''; $r.= ''. _('Recherche').'
'; $r.= '
'; $r.= '
'; return $r; }