#419 : réécriture paramètrage journaux

This commit is contained in:
Dany De Bontridder 2011-11-05 23:39:54 +00:00
parent 249222be25
commit 8f0461092e
7 changed files with 683 additions and 771 deletions

View file

@ -31,118 +31,6 @@ require_once("class_ispan.php");
/*!
* \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_deprecated($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 ,_("Historique"),_("Historique : toutes les opérations"),0),
array("compta.php?p_action=ven&".$str_dossier ,_("Recette"),_("Journal de vente, produit et recette"),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,' style="width:100%;"');
$str_dossier=dossier::get();
$r="";
$r.=menu_tool("compta.php");
$r.='<div class="topmenu">';
$r.=$result;
$r.='</div>';
return $r;
}
/*!
**************************************************
* \brief build the menu of user_advanced.php
*
* \param $default
*
* \return the menu
*/
function ShowMenuAdvanced_deprecated($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('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('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='<div class="u_subtmenu">'.$left_menu."</div>";
return $r;
}
/*!
* \brief Show the menu for the card management
*
@ -229,66 +117,7 @@ function MenuAdmin()
$menu=ShowItem($item,'H',"mtitle","mtitle",$def,' style="width:80%;margin-left:10%" ');
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=periode&'.$s,_('Periode'),_("Gestion des periodes"),25),
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 '<TABLE>';
echo '<TR><TD class="mtitle"><A class="mtitle" HREF="?p_action=jrn&sa=add&'.$str_dossier.'">'._('Création').' </A></TD></TR>';
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 ('<TR><TD class="mtitle"><A class="mtitle" HREF="?p_action=jrn&sa=detail&p_jrn=%s&'.$str_dossier.'">%s</A></TD></TR>',
$l_line['jrn_def_id'],$l_line['jrn_def_name']);
}
echo "</TABLE>";
}
/*!
* \brief Show the menu from the pcmn page
*
@ -319,96 +148,3 @@ function menu_acc_plan($p_start=1)
echo "</TABLE>";
}
/*!
* \brief Show the menu for importing, verify and transfert Bank CSV
*
* \return nothing
*/
function ShowMenuImport()
{
$str_dossier=dossier::get();
echo '<TABLE>';
echo '<TR><TD class="mtitle"><A class="mtitle" HREF="import.php?action=import&'.$str_dossier.'">'._('Importer CSV').'</A></TD></TR>';
echo '<TR><TD class="mtitle"><A class="mtitle" HREF="import.php?action=verif&'.$str_dossier.'">'._('Verif CSV').'</A></TD></TR>';
echo '<TR><TD class="mtitle"><A class="mtitle" HREF="import.php?action=transfer&'.$str_dossier.'">'._('Transfert CSV').'</A></TD></TR>';
echo '<TR><TD class="mtitle"><A class="mtitle" HREF="import.php?action=purge&'.$str_dossier.'">'._('Purge CSV').'</A></TD></TR>';
echo "</TABLE>";
}
/*!\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_deprecated($p_from)
{
if ( ! isset ($_REQUEST['gDossier']))
return "" ;
$r="";
$r.= '<div class="u_tool">';
$r.= '<div class="name">';
$r.= "<H2 class=\"dossier\"> Dossier : ".h(dossier::name())."</h2> ";
$r.=IButton::show_calc();
$r.= '</div>';
$r.= '<div class="acces_direct">';
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.= '<table>';
$r.='<tr>';
foreach($amodule as $col )
{
$url=$col['value'].'?'.dossier::get();
if ( $p_from==$col['value'])
{
$r.= '<td style="background-color:red">'.
'<a class="mtitle" href="'.$url.'" >'.$col['label'].'</a>'.
'</td>';
}
else
{
if ( $col['value']=='new_line')
{
$r.='</tr><tr>';
continue;
}
$r.= '<td class="tool">'.
'<a class="cell" href="'.$url.'" >'.$col['label'].'</a>'.
'</td>';
}
}
$r.='<td class="tool">';
$r.= '<A class="cell" HREF="javascript:openRecherche('.$gDossier.')">'.
_('Recherche').'</a></td>';
$r.='</tr>';
$r.= '</table>';
$r.= '</div>';
$r.= '</div>';
$r.= '</div>';
return $r;
}