diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 2ad74cb1b6169d829f062a7657798c1d4e41c75e..cec34b94e0fb2b675bd6a5e30b41c9e230ae4403 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -68,6 +68,7 @@ class Form */ function textwithhelp($text,$htmltext,$tooltipon=1) { + global $conf; return $this->textwithtooltip($text,$htmltext,$tooltipon); } @@ -172,11 +173,24 @@ class Form if ("$type" == "0") $type='info'; // For backward compatibility $alt=''; - if (empty($conf->use_javascript_ajax)) $alt='Help disabled (javascript disabled)'; + // If info or help with no javascript, show only text + if (empty($conf->use_javascript_ajax)) + { + if ($type == 'info' || $type == 'help') return $text; + else { $alt=$htmltext; $htmltext=''; } + } + // If info or help with smartphone, show only text + if (! empty($conf->browser->phone)) + { + if ($type == 'info' || $type == 'help') return $text; + } + // Info or help if ($type == 'info') $img=img_help(0,$alt); if ($type == 'help' || $type ==1) $img=img_help(1,$alt); - if ($type == 'warning') $img=img_warning($alt); if ($type == 'superadmin') $img=img_redstar($alt); + // Warnings + if ($type == 'warning') $img=img_warning($alt); + return $this->textwithtooltip($text,$htmltext,2,$direction,$img); } diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 2c74993f000b3760b49769ae622523eed485547a..634e25a85d0bc5f1e27b673b50dbd287c72224d2 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -1055,32 +1055,32 @@ function img_action($alt = "default", $numaction) if ($numaction == 2) $alt=$langs->trans("ChangeContactInProcess"); if ($numaction == 3) $alt=$langs->trans("ChangeContactDone"); } - return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/stcomm'.$numaction.'.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; + return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/stcomm'.$numaction.'.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; } /** - \brief Affiche logo fichier - \param alt Texte sur le alt de l'image - \return string Retourne tag img + * \brief Affiche logo fichier + * \param alt Texte sur le alt de l'image + * \return string Retourne tag img */ function img_file($alt = "default") { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Show"); - return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/file.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; + return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/file.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; } /** - \brief Affiche logo refresh - \param alt Texte sur le alt de l'image - \return string Retourne tag img + * \brief Affiche logo refresh + * \param alt Texte sur le alt de l'image + * \return string Retourne tag img */ function img_refresh($alt = "default") { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Refresh"); - return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/refresh.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; + return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/refresh.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; } /** @@ -1092,7 +1092,7 @@ function img_folder($alt = "default") { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Dossier"); - return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/folder.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; + return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/folder.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; } /** @@ -1104,7 +1104,7 @@ function img_file_new($alt = "default") { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Show"); - return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/filenew.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; + return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/filenew.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; } /** @@ -1117,7 +1117,7 @@ function img_pdf($alt = "default",$size=3) { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Show"); - return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/pdf'.$size.'.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; + return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/pdf'.$size.'.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; } /** @@ -1129,7 +1129,7 @@ function img_edit_add($alt = "default") { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Add"); - return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/edit_add.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; + return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/edit_add.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; } /** * \brief Affiche logo - @@ -1140,7 +1140,7 @@ function img_edit_remove($alt = "default") { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Remove"); - return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/edit_remove.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; + return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/edit_remove.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; } /** @@ -1153,7 +1153,7 @@ function img_edit($alt = "default", $float=0, $other='') { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Modify"); - $img='<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/edit.png" border="0" alt="'.$alt.'" title="'.$alt.'"'; + $img='<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/edit.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'; if ($float) $img.=' style="float: right"'; if ($other) $img.=' '.$other; $img.='>'; @@ -1170,7 +1170,7 @@ function img_view($alt = "default", $float=0, $other='') { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("View"); - $img='<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/view.png" border="0" alt="'.$alt.'" title="'.$alt.'"'; + $img='<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/view.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'; if ($float) $img.=' style="float: right"'; if ($other) $img.=' '.$other; $img.='>'; @@ -1186,7 +1186,7 @@ function img_delete($alt = "default") { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Delete"); - return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; + return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; } @@ -1204,7 +1204,7 @@ function img_help($usehelpcursor=1,$usealttitle=1) $s.='src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/info.png" border="0"'; if ($usealttitle) { - if (is_string($usealttitle)) $s.=' alt="'.$usealttitle.'" title="'.$usealttitle.'"'; + if (is_string($usealttitle)) $s.=' alt="'.dol_escape_htmltag($usealttitle).'" title="'.dol_escape_htmltag($usealttitle).'"'; else $s.=' alt="'.$langs->trans("Info").'" title="'.$langs->trans("Info").'"'; } else $s.=' alt=""'; @@ -1221,7 +1221,7 @@ function img_info($alt = "default") { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Informations"); - return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/info.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; + return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/info.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; } /** @@ -1234,7 +1234,7 @@ function img_warning($alt = "default",$float=0) { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Warning"); - $img='<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/warning.png" border="0" alt="'.$alt.'" title="'.$alt.'"'; + $img='<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/warning.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'; if ($float) $img.=' style="float: right"'; $img.='>'; @@ -1251,7 +1251,7 @@ function img_redstar($alt = "default",$float=0) { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("SuperAdministrator"); - $img='<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/redstar.png" border="0" alt="'.$alt.'" title="'.$alt.'"'; + $img='<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/redstar.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'; if ($float) $img.=' style="float: right"'; $img.='>'; @@ -1267,7 +1267,7 @@ function img_error($alt = "default") { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Error"); - return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/error.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; + return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/error.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; } /** @@ -1283,14 +1283,14 @@ function img_phone($alt = "default",$option=0) $img='call_out'; if ($option == 1) $img='call'; $img='object_commercial'; - return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/'.$img.'.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; + return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/'.$img.'.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; } /** - \brief Affiche logo suivant - \param alt Texte sur le alt de l'image - \return string Retourne tag img + * \brief Affiche logo suivant + * \param alt Texte sur le alt de l'image + * \return string Retourne tag img */ function img_next($alt = "default") { @@ -1298,93 +1298,93 @@ function img_next($alt = "default") if ($alt=="default") { $alt=$langs->trans("Next"); } - return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/next.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; + return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/next.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; } /** - \brief Affiche logo precedent - \param alt Texte sur le alt de l'image - \return string Retourne tag img + * \brief Affiche logo precedent + * \param alt Texte sur le alt de l'image + * \return string Retourne tag img */ function img_previous($alt = "default") { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Previous"); - return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/previous.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; + return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/previous.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; } /** - \brief Affiche logo bas - \param alt Texte sur le alt de l'image - \param selected Affiche version "selected" du logo - \return string Retourne tag img + * \brief Affiche logo bas + * \param alt Texte sur le alt de l'image + * \param selected Affiche version "selected" du logo + * \return string Retourne tag img */ function img_down($alt = "default", $selected=0) { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Down"); - if ($selected) return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1downarrow_selected.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; - else return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1downarrow.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; + if ($selected) return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1downarrow_selected.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; + else return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1downarrow.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; } /** - \brief Affiche logo haut - \param alt Texte sur le alt de l'image - \param selected Affiche version "selected" du logo - \return string Retourne tag img + * \brief Affiche logo haut + * \param alt Texte sur le alt de l'image + * \param selected Affiche version "selected" du logo + * \return string Retourne tag img */ function img_up($alt = "default", $selected=0) { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Up"); - if ($selected) return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1uparrow_selected.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; - else return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1uparrow.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; + if ($selected) return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1uparrow_selected.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; + else return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1uparrow.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; } /** - \brief Affiche logo gauche - \param alt Texte sur le alt de l'image - \param selected Affiche version "selected" du logo - \return string Retourne tag img + * \brief Affiche logo gauche + * \param alt Texte sur le alt de l'image + * \param selected Affiche version "selected" du logo + * \return string Retourne tag img */ function img_left($alt = "default", $selected=0) { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Left"); - if ($selected) return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1leftarrow_selected.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; - else return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1leftarrow.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; + if ($selected) return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1leftarrow_selected.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; + else return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1leftarrow.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; } /** - \brief Affiche logo droite - \param alt Texte sur le alt de l'image - \param selected Affiche version "selected" du logo - \return string Retourne tag img + * \brief Affiche logo droite + * \param alt Texte sur le alt de l'image + * \param selected Affiche version "selected" du logo + * \return string Retourne tag img */ function img_right($alt = "default", $selected=0) { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Right"); - if ($selected) return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1rightarrow_selected.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; - else return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1rightarrow.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; + if ($selected) return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1rightarrow_selected.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; + else return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1rightarrow.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; } /** - \brief Affiche logo tick - \param alt Texte sur le alt de l'image - \return string Retourne tag img + * \brief Affiche logo tick + * \param alt Texte sur le alt de l'image + * \return string Retourne tag img */ function img_tick($alt = "default") { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Active"); - return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/tick.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; + return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/tick.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; } /** - \brief Affiche le logo tick si allow - \param allow Authorise ou non - \return string Retourne tag img + * \brief Affiche le logo tick si allow + * \param allow Authorise ou non + * \return string Retourne tag img */ function img_allow($allow,$alt='default') { @@ -1393,7 +1393,7 @@ function img_allow($allow,$alt='default') if ($allow == 1) { - return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/tick.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; + return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/tick.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; } else { diff --git a/htdocs/livraison/pre.inc.php b/htdocs/livraison/pre.inc.php index 6750f5e21a8bd8ec5a1858d0da2e3bf5adee7d03..7bb801865028895ad96a34e7a7183d3152abae6e 100644 --- a/htdocs/livraison/pre.inc.php +++ b/htdocs/livraison/pre.inc.php @@ -15,17 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ - * */ /** \file htdocs/livraison/pre.inc.php \ingroup livraison \brief Fichier de gestion du menu gauche du module livraison - \version $Revision$ + \version $Id$ */ require("../main.inc.php"); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 752fdd0fd95fe5fb127ce94d4f0d7f50a00fec83..6f85f1f54a426c07113cb809b1feade71ca757ba 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -907,7 +907,7 @@ function top_menu($head, $title='', $target='') print $html->textwithtooltip('',$htmltext,2,1,$text); // Link to print main content area - if (empty($conf->global->MAIN_PRINT_DISABLELINK)) + if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->browser->phone)) { $text ='<a href="'.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].'&optioncss=print" target="_blank">'; $text.='<img class="printer" border="0" width="14" height="14" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/printer.png"';