Merge pull request #328 from marcosgdf/coding-style

Removed duplicated code
This commit is contained in:
Regis Houssin 2012-08-18 12:02:52 -07:00
commit 4439d829e3
2 changed files with 9 additions and 15 deletions

View File

@ -3,6 +3,7 @@
* Copyright (C) 2008-2010 Laurent Destailleur <eldy@uers.sourceforge.net>
* Copyright (C) 2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -58,8 +59,6 @@ if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && $conf->stock->enabled)
$langs->load("cashdesk");
$langs->load("main");
$logout='<img class="login" border="0" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/logout.png" title="'.dol_escape_htmltag($langs->trans("Logout")).'">';
print '<div class="menu_bloc">';
print '<ul class="menu">';
// Link to new sell
@ -68,7 +67,7 @@ print '<li class="menu_choix1"><a href="affIndex.php?menu=facturation&id=NOUV"><
print '<li class="menu_choix2"><a href=".." target="backoffice"><span>'.$langs->trans("BackOffice").'</span></a></li>';
// Disconnect
print '<li class="menu_choix0">'.$langs->trans("User").': '.$_SESSION['prenom'].' '.$_SESSION['nom'];
print ' <a href="deconnexion.php">'.$logout.'</a><br>';
print ' <a href="deconnexion.php">'.img_picto($langs->trans('Logout'), 'logout.png').'</a><br>';
print $langs->trans("CashDeskThirdParty").': '.$companyLink.'<br>';
/*print $langs->trans("CashDeskBankCash").': '.$bankcashLink.'<br>';
print $langs->trans("CashDeskBankCB").': '.$bankcbLink.'<br>';

View File

@ -1289,19 +1289,15 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
if ($_SESSION["dol_authmode"] != 'forceuser'
&& $_SESSION["dol_authmode"] != 'http')
{
$logouttext.='<a href="'.DOL_URL_ROOT.'/user/logout.php"';
$logouttext.=$menutop->atarget?(' target="'.$menutop->atarget.'"'):'';
$logouttext.='>';
$logouttext.='<img class="login" border="0" width="14" height="14" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/logout.png"';
$logouttext.=' alt="'.dol_escape_htmltag($langs->trans("Logout")).'" title=""';
$logouttext.='>';
$logouttext.='</a>';
$logouttext .='<a href="'.DOL_URL_ROOT.'/user/logout.php"';
$logouttext .=$menutop->atarget?(' target="'.$menutop->atarget.'"'):'';
$logouttext .='>';
$logouttext .= img_picto($langs->trans('Logout'), 'logout.png', 'class="login"');
$logouttext .='</a>';
}
else
{
$logouttext.='<img class="login" border="0" width="14" height="14" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/logout.png"';
$logouttext.=' alt="'.dol_escape_htmltag($langs->trans("Logout")).'" title=""';
$logouttext.='>';
$logouttext .= img_picto($langs->trans('Logout'), 'logout.png', 'class="login"');
}
print '<div class="login_block">'."\n";
@ -1323,8 +1319,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
{
$qs=$_SERVER["QUERY_STRING"].($_SERVER["QUERY_STRING"]?'&':'').$morequerystring;
$text ='<a href="'.$_SERVER["PHP_SELF"].'?'.$qs.($qs?'&':'').'optioncss=print" target="_blank">';
$text.='<img class="printer" border="0" width="14" height="14" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/printer.png"';
$text.=' title="" alt="">';
$text.= img_picto('', 'printer.png', 'class="printer"');
$text.='</a>';
$toprightmenu.=$form->textwithtooltip('',$langs->trans("PrintContentArea"),2,1,$text,'',1);
}