Fix: Optimisation chargement lang

This commit is contained in:
Laurent Destailleur 2008-02-20 00:39:33 +00:00
parent d8f4ae3510
commit 4ce77c2b97
11 changed files with 93 additions and 92 deletions

View File

@ -1,4 +1,4 @@
#Sat Jan 26 10:43:38 GMT 2008 #Tue Feb 19 23:17:47 GMT 2008
eclipse.preferences.version=1 eclipse.preferences.version=1
encoding//dev/skeletons/modMyModule.class.php=ISO-8859-1 encoding//dev/skeletons/modMyModule.class.php=ISO-8859-1
encoding//htdocs/about.php=ISO-8859-1 encoding//htdocs/about.php=ISO-8859-1
@ -34,7 +34,6 @@ encoding//htdocs/compta/facture/stats/month.php=ISO-8859-1
encoding//htdocs/compta/index.php=ISO-8859-1 encoding//htdocs/compta/index.php=ISO-8859-1
encoding//htdocs/conf/conf.class.php=ISO-8859-1 encoding//htdocs/conf/conf.class.php=ISO-8859-1
encoding//htdocs/contrat/fiche.php=ISO-8859-1 encoding//htdocs/contrat/fiche.php=ISO-8859-1
encoding//htdocs/contrat/ligne.php=ISO-8859-1
encoding//htdocs/dolgraph.class.php=ISO-8859-1 encoding//htdocs/dolgraph.class.php=ISO-8859-1
encoding//htdocs/expedition/expedition.class.php=ISO-8859-1 encoding//htdocs/expedition/expedition.class.php=ISO-8859-1
encoding//htdocs/expedition/stats/month.php=ISO-8859-1 encoding//htdocs/expedition/stats/month.php=ISO-8859-1
@ -71,6 +70,7 @@ encoding//htdocs/lib/product.lib.php=ISO-8859-1
encoding//htdocs/main.inc.php=ISO-8859-1 encoding//htdocs/main.inc.php=ISO-8859-1
encoding//htdocs/master.inc.php=ISO-8859-1 encoding//htdocs/master.inc.php=ISO-8859-1
encoding//htdocs/paiement.class.php=ISO-8859-1 encoding//htdocs/paiement.class.php=ISO-8859-1
encoding//htdocs/product/fiche.php=ISO-8859-1
encoding//htdocs/product/reassort.php=ISO-8859-1 encoding//htdocs/product/reassort.php=ISO-8859-1
encoding//htdocs/product/stats/fiche.php=ISO-8859-1 encoding//htdocs/product/stats/fiche.php=ISO-8859-1
encoding//htdocs/projet/tasks/fiche.php=ISO-8859-1 encoding//htdocs/projet/tasks/fiche.php=ISO-8859-1

View File

@ -51,7 +51,7 @@ if ($action == 'del_bookmark') {
llxHeader(); llxHeader();
print_titre("Charges"); print_titre($langs->trans("Charges"));
print '<table width="100%">'; print '<table width="100%">';

View File

@ -48,7 +48,7 @@ llxHeader();
$html=new Form($db); $html=new Form($db);
// Affiche en-tête de rapport // Affiche en-t<EFBFBD>te de rapport
if ($modecompta=="CREANCES-DETTES") if ($modecompta=="CREANCES-DETTES")
{ {
$nom=$langs->trans("AnnualByCompaniesDueDebtMode"); $nom=$langs->trans("AnnualByCompaniesDueDebtMode");
@ -92,7 +92,7 @@ if ($modecompta == 'CREANCES-DETTES') {
} else { } else {
/* /*
* Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les
* vieilles versions, ils n'étaient pas liés via paiement_facture. On les ajoute plus loin) * vieilles versions, ils n'<EFBFBD>taient pas li<EFBFBD>s via paiement_facture. On les ajoute plus loin)
*/ */
$sql = "SELECT s.nom as nom, s.rowid as socid, sum(pf.amount) as amount_ttc"; $sql = "SELECT s.nom as nom, s.rowid as socid, sum(pf.amount) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p";
@ -129,7 +129,7 @@ if ($result) {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
// On ajoute les paiements clients anciennes version, non liés par paiement_facture // On ajoute les paiements clients anciennes version, non li<EFBFBD>s par paiement_facture
if ($modecompta != 'CREANCES-DETTES') if ($modecompta != 'CREANCES-DETTES')
{ {
$sql = "SELECT 'Autres' as nom, '0' as idp, sum(p.amount) as amount_ttc"; $sql = "SELECT 'Autres' as nom, '0' as idp, sum(p.amount) as amount_ttc";
@ -151,7 +151,7 @@ if ($modecompta != 'CREANCES-DETTES')
$var=!$var; $var=!$var;
print "<tr $bc[$var]><td>&nbsp;</td>"; print "<tr $bc[$var]><td>&nbsp;</td>";
print "<td>".$langs->trans("Bills")." ".$langs->trans("Other")." (anciens paiements liés à aucune facture)\n"; print "<td>".$langs->trans("Bills")." ".$langs->trans("Other")." (anciens paiements li<EFBFBD>s <20> aucune facture)\n";
if ($modecompta == 'CREANCES-DETTES') print "<td align=\"right\">".price($objp->amount_ht)."</td>\n"; if ($modecompta == 'CREANCES-DETTES') print "<td align=\"right\">".price($objp->amount_ht)."</td>\n";
print "<td align=\"right\">".price($objp->amount_ttc)."</td>\n"; print "<td align=\"right\">".price($objp->amount_ttc)."</td>\n";
@ -265,7 +265,7 @@ $subtotal_ttc = 0;
if ($modecompta == 'CREANCES-DETTES') if ($modecompta == 'CREANCES-DETTES')
{ {
// TVA à payer // TVA <EFBFBD> payer
$amount=0; $amount=0;
$sql = "SELECT sum(f.tva) as amount, date_format(f.datef,'%Y-%m') as dm"; $sql = "SELECT sum(f.tva) as amount, date_format(f.datef,'%Y-%m') as dm";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
@ -301,7 +301,7 @@ if ($modecompta == 'CREANCES-DETTES')
print "<td align=\"right\">".price($amount)."</td>\n"; print "<td align=\"right\">".price($amount)."</td>\n";
print "</tr>\n"; print "</tr>\n";
// TVA à récupérer // TVA <EFBFBD> r<>cup<75>rer
$amount=0; $amount=0;
$sql = "SELECT sum(f.total_tva) as amount, date_format(f.datef,'%Y-%m') as dm"; $sql = "SELECT sum(f.total_tva) as amount, date_format(f.datef,'%Y-%m') as dm";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
@ -341,7 +341,7 @@ if ($modecompta == 'CREANCES-DETTES')
} }
else else
{ {
// TVA réellement déjà payée // TVA r<EFBFBD>ellement d<>j<EFBFBD> pay<61>e
$amount=0; $amount=0;
$sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm"; $sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm";
$sql .= " FROM ".MAIN_DB_PREFIX."tva as t"; $sql .= " FROM ".MAIN_DB_PREFIX."tva as t";
@ -379,7 +379,7 @@ else
print "<td align=\"right\">".price($amount)."</td>\n"; print "<td align=\"right\">".price($amount)."</td>\n";
print "</tr>\n"; print "</tr>\n";
// TVA récupérée // TVA r<EFBFBD>cup<EFBFBD>r<EFBFBD>e
$amount=0; $amount=0;
$sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm"; $sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm";
$sql .= " FROM ".MAIN_DB_PREFIX."tva as t"; $sql .= " FROM ".MAIN_DB_PREFIX."tva as t";
@ -424,10 +424,10 @@ print '</tr>';
/* /*
* Charges sociales non déductibles * Charges sociales non deductibles
*/ */
print '<tr><td colspan="4">Prestations/Charges NON déductibles</td></tr>'; print '<tr><td colspan="4">Prestations/Charges NON deductibles</td></tr>';
if ($modecompta == 'CREANCES-DETTES') { if ($modecompta == 'CREANCES-DETTES') {
$sql = "SELECT c.libelle as nom, sum(s.amount) as amount"; $sql = "SELECT c.libelle as nom, sum(s.amount) as amount";
@ -487,10 +487,10 @@ print '</tr>';
/* /*
* Charges sociales déductibles * Charges sociales deductibles
*/ */
print '<tr><td colspan="4">Prestations/Charges déductibles</td></tr>'; print '<tr><td colspan="4">Prestations/Charges deductibles</td></tr>';
if ($modecompta == 'CREANCES-DETTES') { if ($modecompta == 'CREANCES-DETTES') {
$sql = "SELECT c.libelle as nom, sum(s.amount) as amount"; $sql = "SELECT c.libelle as nom, sum(s.amount) as amount";

View File

@ -39,7 +39,7 @@ else {
} }
/* /*
* Sécurité accés client * S<EFBFBD>curit<EFBFBD> acc<EFBFBD>s client
*/ */
if ($user->societe_id > 0) if ($user->societe_id > 0)
{ {
@ -55,7 +55,7 @@ llxHeader();
$html=new Form($db); $html=new Form($db);
// Affiche en-tête du rapport // Affiche en-t<EFBFBD>te du rapport
if ($modecompta=="CREANCES-DETTES") if ($modecompta=="CREANCES-DETTES")
{ {
$nom=$langs->trans("AnnualSummaryDueDebtMode"); $nom=$langs->trans("AnnualSummaryDueDebtMode");
@ -90,7 +90,7 @@ if ($modecompta == 'CREANCES-DETTES') {
} else { } else {
/* /*
* Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les
* vieilles versions, ils n'étaient pas liés via paiement_facture. On les ajoute plus loin) * vieilles versions, ils n'<EFBFBD>taient pas li<EFBFBD>s via paiement_facture. On les ajoute plus loin)
*/ */
$sql = "SELECT sum(pf.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; $sql = "SELECT sum(pf.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p";
@ -118,7 +118,7 @@ else {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
// On ajoute les paiements clients anciennes version, non liés par paiement_facture // On ajoute les paiements clients anciennes version, non li<EFBFBD>s par paiement_facture
if ($modecompta != 'CREANCES-DETTES') { if ($modecompta != 'CREANCES-DETTES') {
$sql = "SELECT sum(p.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; $sql = "SELECT sum(p.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm";
$sql .= " FROM ".MAIN_DB_PREFIX."paiement as p"; $sql .= " FROM ".MAIN_DB_PREFIX."paiement as p";
@ -228,7 +228,7 @@ for ($mois = 1 ; $mois <= 12 ; $mois++)
$subtotal_ht = 0; $subtotal_ht = 0;
$subtotal_ttc = 0; $subtotal_ttc = 0;
if ($modecompta == 'CREANCES-DETTES') { if ($modecompta == 'CREANCES-DETTES') {
// TVA à payer // TVA <EFBFBD> payer
$sql = "SELECT sum(f.tva) as amount, date_format(f.datef,'%Y-%m') as dm"; $sql = "SELECT sum(f.tva) as amount, date_format(f.datef,'%Y-%m') as dm";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
$sql .= " WHERE f.fk_statut in (1,2)"; $sql .= " WHERE f.fk_statut in (1,2)";
@ -251,7 +251,7 @@ if ($modecompta == 'CREANCES-DETTES') {
} else { } else {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
// TVA à récupérer // TVA <EFBFBD> r<>cup<75>rer
$sql = "SELECT sum(f.total_tva) as amount, date_format(f.datef,'%Y-%m') as dm"; $sql = "SELECT sum(f.total_tva) as amount, date_format(f.datef,'%Y-%m') as dm";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
$sql .= " WHERE f.fk_statut in (1,2)"; $sql .= " WHERE f.fk_statut in (1,2)";
@ -276,7 +276,7 @@ if ($modecompta == 'CREANCES-DETTES') {
} }
} }
else { else {
// TVA réellement déja payée // TVA r<EFBFBD>ellement d<>ja pay<61>e
$sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm"; $sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm";
$sql .= " FROM ".MAIN_DB_PREFIX."tva as t"; $sql .= " FROM ".MAIN_DB_PREFIX."tva as t";
$sql .= " WHERE amount > 0"; $sql .= " WHERE amount > 0";
@ -305,7 +305,7 @@ else {
} else { } else {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
// TVA récupérée // TVA r<EFBFBD>cup<EFBFBD>r<EFBFBD>e
$sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm"; $sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm";
$sql .= " FROM ".MAIN_DB_PREFIX."tva as t"; $sql .= " FROM ".MAIN_DB_PREFIX."tva as t";
$sql .= " WHERE amount < 0"; $sql .= " WHERE amount < 0";
@ -347,7 +347,7 @@ for ($mois = 1 ; $mois <= 12 ; $mois++)
*/ */
/* /*
* Charges sociales non déductibles * Charges sociales non deductibles
*/ */
$subtotal_ht = 0; $subtotal_ht = 0;
$subtotal_ttc = 0; $subtotal_ttc = 0;
@ -407,7 +407,7 @@ for ($mois = 1 ; $mois <= 12 ; $mois++)
*/ */
/* /*
* Charges sociales déductibles * Charges sociales deductibles
*/ */
$subtotal_ht = 0; $subtotal_ht = 0;
$subtotal_ttc = 0; $subtotal_ttc = 0;

View File

@ -23,11 +23,11 @@
\version $Id$ \version $Id$
\remarks La construction d'un gestionnaire pour le menu de gauche est simple: \remarks La construction d'un gestionnaire pour le menu de gauche est simple:
\remarks A l'aide d'un objet $newmenu=new Menu() et des méthode add et add_submenu, \remarks A l'aide d'un objet $newmenu=new Menu() et des m<EFBFBD>thode add et add_submenu,
\remarks définir la liste des entrées menu à faire apparaitre. \remarks d<EFBFBD>finir la liste des entr<EFBFBD>es menu <EFBFBD> faire apparaitre.
\remarks En fin de code, mettre la ligne $menu=$newmenu->liste. \remarks En fin de code, mettre la ligne $menu=$newmenu->liste.
\remarks Ce qui est défini dans un tel gestionnaire sera alors prioritaire sur \remarks Ce qui est d<EFBFBD>fini dans un tel gestionnaire sera alors prioritaire sur
\remarks les définitions de menu des fichiers pre.inc.php \remarks les d<EFBFBD>finitions de menu des fichiers pre.inc.php
*/ */
@ -47,8 +47,8 @@ class MenuLeft {
/** /**
* \brief Constructeur * \brief Constructeur
* \param db Handler d'accès base de donnée * \param db Handler d'acc<EFBFBD>s base de donn<EFBFBD>e
* \param menu_array Tableau des entrée de menu défini dans les fichier pre.inc.php * \param menu_array Tableau des entr<EFBFBD>e de menu d<EFBFBD>fini dans les fichier pre.inc.php
*/ */
function MenuLeft($db,&$menu_array) function MenuLeft($db,&$menu_array)
{ {
@ -73,17 +73,17 @@ class MenuLeft {
if (! session_id()) { if (! session_id()) {
session_name("DOLSESSID_".$dolibarr_main_db_name); session_name("DOLSESSID_".$dolibarr_main_db_name);
session_start(); // En mode authentification PEAR, la session a déjà été ouverte session_start(); // En mode authentification PEAR, la session a d<EFBFBD>j<EFBFBD> <20>t<EFBFBD> ouverte
} }
// On récupère mainmenu et leftmenu qui définissent le menu à afficher // On r<EFBFBD>cup<EFBFBD>re mainmenu et leftmenu qui d<>finissent le menu <20> afficher
if (isset($_GET["mainmenu"])) { if (isset($_GET["mainmenu"])) {
// On sauve en session le menu principal choisi // On sauve en session le menu principal choisi
$mainmenu=$_GET["mainmenu"]; $mainmenu=$_GET["mainmenu"];
$_SESSION["mainmenu"]=$mainmenu; $_SESSION["mainmenu"]=$mainmenu;
$_SESSION["leftmenuopened"]=""; $_SESSION["leftmenuopened"]="";
} else { } else {
// On va le chercher en session si non défini par le lien // On va le chercher en session si non d<EFBFBD>fini par le lien
$mainmenu=$_SESSION["mainmenu"]; $mainmenu=$_SESSION["mainmenu"];
} }
@ -99,7 +99,7 @@ class MenuLeft {
$_SESSION["leftmenuopened"]=$this->leftmenu; $_SESSION["leftmenuopened"]=$this->leftmenu;
} }
} else { } else {
// On va le chercher en session si non défini par le lien // On va le chercher en session si non d<EFBFBD>fini par le lien
$this->leftmenu=isset($_SESSION["leftmenu"])?$_SESSION["leftmenu"]:''; $this->leftmenu=isset($_SESSION["leftmenu"])?$_SESSION["leftmenu"]:'';
} }
@ -115,7 +115,7 @@ class MenuLeft {
$this->newmenu = $this->menuArbo->menuCharger($mainmenu, $this->newmenu,1,$this->leftmenu); $this->newmenu = $this->menuArbo->menuCharger($mainmenu, $this->newmenu,1,$this->leftmenu);
/* /*
* Menu AUTRES (Pour les menus du haut qui ne serait pas gérés) * Menu AUTRES (Pour les menus du haut qui ne serait pas g<EFBFBD>r<EFBFBD>s)
*/ */
if ($mainmenu && ! in_array($mainmenu,$this->overwritemenufor)) { $mainmenu=""; } if ($mainmenu && ! in_array($mainmenu,$this->overwritemenufor)) { $mainmenu=""; }
@ -125,7 +125,7 @@ class MenuLeft {
/** /**
* Si on est sur un cas géré de surcharge du menu, on ecrase celui par defaut * Si on est sur un cas g<EFBFBD>r<EFBFBD> de surcharge du menu, on ecrase celui par defaut
*/ */
if ($mainmenu) { if ($mainmenu) {
$this->menu_array=$this->newmenu->liste; $this->menu_array=$this->newmenu->liste;
@ -215,7 +215,7 @@ class MenuLeft {
//ballayage du tableau //ballayage du tableau
for ($x=0;$x<count($tab);$x++) { for ($x=0;$x<count($tab);$x++) {
//si un élément a pour père : $pere //si un <EFBFBD>l<EFBFBD>ment a pour p<>re : $pere
if ($tab[$x][1]==$pere) { if ($tab[$x][1]==$pere) {
//on affiche le menu //on affiche le menu
@ -250,7 +250,7 @@ class MenuLeft {
/*et on recherche ses fils /*et on recherche ses fils
en rappelant la fonction recur() en rappelant la fonction recur()
(+ incrémentation du décallage)*/ (+ incr<EFBFBD>mentation du d<EFBFBD>callage)*/
} }
@ -270,7 +270,7 @@ class MenuLeft {
if ($result) if ($result)
{ {
$num = $this->db->num_rows(); $num = $this->db->num_rows($result);
$i = 0; $i = 0;
while (($i < $num) && $constraint == true) while (($i < $num) && $constraint == true)
{ {

View File

@ -14,20 +14,18 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/includes/menus/barre_top/auguria_backoffice.php \file htdocs/includes/menus/barre_top/auguria_backoffice.php
\brief Gestionnaire nomme Auguria du menu du haut \brief Gestionnaire nomme Auguria du menu du haut
\version $Revision$ \version $$Id$
\remarks La construction d'un gestionnaire pour le menu du haut est simple: \remarks La construction d'un gestionnaire pour le menu du haut est simple:
\remarks Toutes les entr<EFBFBD>es de menu <EFBFBD> faire apparaitre dans la barre du haut \remarks Toutes les entrees de menu a faire apparaitre dans la barre du haut
\remarks doivent <EFBFBD>tre affich<EFBFBD>es par <a class="tmenu" href="...?mainmenu=...">...</a> \remarks doivent etre affichees par <a class="tmenu" href="...?mainmenu=...">...</a>
\remarks On peut <EFBFBD>ventuellement ajouter l'attribut id="sel" dans la balise <a> \remarks On peut eventuellement ajouter l'attribut id="sel" dans la balise <a>
\remarks quand il s'agit de l'entr<EFBFBD>e du menu qui est selectionnee. \remarks quand il s'agit de l'entree du menu qui est selectionnee.
*/ */
@ -87,6 +85,7 @@ class MenuTop {
{ {
if ($tabMenu[$i]['right'] == true) if ($tabMenu[$i]['right'] == true)
{ {
// Define url
$url=DOL_URL_ROOT.$tabMenu[$i]['url']; $url=DOL_URL_ROOT.$tabMenu[$i]['url'];
if (! eregi('\?',DOL_URL_ROOT.$tabMenu[$i]['url'])) $url.='?'; if (! eregi('\?',DOL_URL_ROOT.$tabMenu[$i]['url'])) $url.='?';
else $url.='&'; else $url.='&';
@ -105,9 +104,7 @@ class MenuTop {
} }
print '</ul>'; print '</ul>';
} }
} }
?> ?>

View File

@ -14,20 +14,18 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/includes/menus/barre_top/auguria_backoffice.php \file htdocs/includes/menus/barre_top/auguria_backoffice.php
\brief Gestionnaire nomme Auguria du menu du haut \brief Gestionnaire nomme Auguria du menu du haut
\version $Revision$ \version $Id$
\remarks La construction d'un gestionnaire pour le menu du haut est simple: \remarks La construction d'un gestionnaire pour le menu du haut est simple:
\remarks Toutes les entr<EFBFBD>es de menu <EFBFBD> faire apparaitre dans la barre du haut \remarks Toutes les entrees de menu a faire apparaitre dans la barre du haut
\remarks doivent <EFBFBD>tre affich<EFBFBD>es par <a class="tmenu" href="...?mainmenu=...">...</a> \remarks doivent etre affichees par <a class="tmenu" href="...?mainmenu=...">...</a>
\remarks On peut <EFBFBD>ventuellement ajouter l'attribut id="sel" dans la balise <a> \remarks On peut eventuellement ajouter l'attribut id="sel" dans la balise <a>
\remarks quand il s'agit de l'entr<EFBFBD>e du menu qui est selectionnee. \remarks quand il s'agit de l'entree du menu qui est selectionnee.
*/ */

View File

@ -327,7 +327,6 @@ class Menubase
function menuCharger($mainmenu, $newmenu, $type_user, $leftmenu) function menuCharger($mainmenu, $newmenu, $type_user, $leftmenu)
{ {
global $langs, $user, $conf; global $langs, $user, $conf;
$this->mainmenu = $mainmenu; $this->mainmenu = $mainmenu;
@ -353,11 +352,12 @@ class Menubase
$res = $this->db->query($sql); $res = $this->db->query($sql);
if ($res) if ($res)
{ {
$num = $this->db->num_rows(); $num = $this->db->num_rows($res);
$i = 1; $i = 1;
while ($menu = $this->db->fetch_array($res)) { while ($menu = $this->db->fetch_array($res))
$langs->load($menu['langs']); {
if (! empty($menu['langs'])) $langs->load($menu['langs']);
$titre = $langs->trans($menu['titre']); $titre = $langs->trans($menu['titre']);
$rights = $this->verifRights($menu['right']); $rights = $this->verifRights($menu['right']);
$data[] = array ( $data[] = array (
@ -390,7 +390,7 @@ class Menubase
//ballayage du tableau //ballayage du tableau
for ($x = 0; $x < count($tab); $x++) { for ($x = 0; $x < count($tab); $x++) {
//si un <EFBFBD>l<EFBFBD>ment a pour p<>re : $pere //si un element a pour pere : $pere
if ($tab[$x][1] == $pere) { if ($tab[$x][1] == $pere) {
//on affiche le menu //on affiche le menu
@ -518,11 +518,28 @@ class Menubase
$b = 0; $b = 0;
while ($a < $numa) while ($a < $numa)
{ {
// Affichage entete menu // Init tabMenu array
$objm = $this->db->fetch_object($resql); $objm = $this->db->fetch_object($resql);
if ($this->verifConstraint($objm->rowid)) if ($this->verifConstraint($objm->rowid))
{ {
// Define class
$class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == $objm->mainmenu)
{
$class='id="sel"';
}
$chaine="";
// Define $right
$right = true;
if ($objm->perms)
{
$str = "if(!(".$objm->perms.")) \$right = false;";
eval($str);
}
// Define $chaine
$title=$objm->titre; $title=$objm->titre;
if (! eregi('\(dotnoloadlang\)$',$title)) if (! eregi('\(dotnoloadlang\)$',$title))
{ {
@ -533,21 +550,6 @@ class Menubase
$title=eregi_replace('\(dotnoloadlang\)$','',$title); $title=eregi_replace('\(dotnoloadlang\)$','',$title);
} }
$class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == $objm->mainmenu)
{
$class='id="sel"';
}
$chaine="";
$right = true;
if ($objm->perms)
{
$str = "if(!(".$objm->perms.")) \$right = false;";
eval($str);
}
if (eregi("/",$title)) if (eregi("/",$title))
{ {
$tab_titre = explode("/",$title); $tab_titre = explode("/",$title);
@ -560,7 +562,7 @@ class Menubase
$tabMenu[$b]['rowid'] = $objm->rowid; $tabMenu[$b]['rowid'] = $objm->rowid;
$tabMenu[$b]['mainmenu'] = $objm->mainmenu; $tabMenu[$b]['mainmenu'] = $objm->mainmenu;
$tabMenu[$b]['titre'] = $chaine; $tabMenu[$b]['titre'] = $chaine; // Title
$tabMenu[$b]['url'] = $objm->url; $tabMenu[$b]['url'] = $objm->url;
$tabMenu[$b]['atarget'] = $this->atarget; $tabMenu[$b]['atarget'] = $this->atarget;
$tabMenu[$b]['class'] = $class; $tabMenu[$b]['class'] = $class;

View File

@ -154,10 +154,12 @@ class Translate {
*/ */
function Load($domain,$alt=0) function Load($domain,$alt=0)
{ {
// dolibarr_syslog("Translate::Load domain=".$domain." alt=".$alt);
// Check parameters // Check parameters
if (empty($domain)) if (empty($domain))
{ {
dolibarr_syslog("Tranlsate::Load ErrorWrongParameters",LOG_WARNING); dolibarr_syslog("Translate::Load ErrorWrongParameters",LOG_WARNING);
return; return;
} }
@ -182,8 +184,6 @@ class Translate {
$alt=1; $alt=1;
} }
dolibarr_syslog("Translate::Load read file ".$file_lang);
if ($filelangexists) if ($filelangexists)
{ {
// Enable cache of lang file in session (faster but need more memory) // Enable cache of lang file in session (faster but need more memory)
@ -195,7 +195,7 @@ class Translate {
foreach($_SESSION['lang_'.$domain] as $key => $value) foreach($_SESSION['lang_'.$domain] as $key => $value)
{ {
$this->tab_translate[$key]=$value; $this->tab_translate[$key]=$value;
$this->tab_loaded[$domain]=1; // Marque ce fichier comme charg<72> $this->tab_loaded[$domain]=3; // Marque ce fichier comme charge depuis cache session
} }
} }
else else
@ -240,17 +240,21 @@ class Translate {
// Pour les langues aux fichiers parfois incomplets, on charge la langue alternative // Pour les langues aux fichiers parfois incomplets, on charge la langue alternative
if (! $alt && $this->defaultlang != "fr_FR" && $this->defaultlang != "en_US") if (! $alt && $this->defaultlang != "fr_FR" && $this->defaultlang != "en_US")
{ {
dolibarr_syslog("Translate::Load loading alternate translation file"); dolibarr_syslog("Translate::Load loading alternate translation file", LOG_DEBUG);
$this->load($domain,1); $this->load($domain,1);
} }
$this->tab_loaded[$domain]=1; // Marque ce fichier comme charg<EFBFBD> $this->tab_loaded[$domain]=1; // Marque ce fichier comme charge
// To save lang in session // To save lang in session
if ($enablelangcacheinsession && sizeof($tabtranslatedomain)) $_SESSION['lang_'.$domain]=$tabtranslatedomain; if ($enablelangcacheinsession && sizeof($tabtranslatedomain)) $_SESSION['lang_'.$domain]=$tabtranslatedomain;
} }
} }
} }
else
{
$this->tab_loaded[$domain]=2; // Marque ce fichier comme charge non trouve
}
} }