From f22373b70b0b071b1c5e1888d996a1d225b29994 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Feb 2016 01:19:37 +0100 Subject: [PATCH] Fix bad management of option MAIN_HTML_TITLE --- htdocs/core/class/conf.class.php | 3 +++ htdocs/core/class/html.form.class.php | 2 +- htdocs/main.inc.php | 2 +- htdocs/projet/card.php | 6 +++--- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 7adcd79d364..0bd28092bff 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -394,6 +394,9 @@ class Conf // By default, suppliers objects can be linked to all projects $this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1; + // MAIN_HTML_TITLE + if (! isset($conf->global->MAIN_HTML_TITLE)) $conf->global->MAIN_HTML_TITLE='noapp,thirdpartynameonly,contactnameonly,projectnameonly'; + // conf->liste_limit = constante de taille maximale des listes if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) $this->global->MAIN_SIZE_LISTE_LIMIT=25; $this->liste_limit=$this->global->MAIN_SIZE_LISTE_LIMIT; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 49d75f6377e..1c9dd350859 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1018,7 +1018,7 @@ class Form // Do not use textempty = ' ' or ' ' here, or search on key will search on ' key'. //$textifempty=' '; //if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; - if (! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) $textifempty.=$langs->trans("NoFilter"); + if (! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) $textifempty.=$langs->trans("All"); if ($showempty) $out.= ''."\n"; $num = $this->db->num_rows($resql); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index fffd177fe68..66899a8b2d0 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1008,7 +1008,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE; if ($title && ! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/noapp/',$conf->global->MAIN_HTML_TITLE)) print ''.dol_htmlentities($title).''; - if ($title) print ''.dol_htmlentities($appli.' - '.$title).''; + else if ($title) print ''.dol_htmlentities($appli.' - '.$title).''; else print "".dol_htmlentities($appli).""; print "\n"; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 2266f012964..c6511e2a67d 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -395,8 +395,8 @@ $formfile = new FormFile($db); $formproject = new FormProjets($db); $userstatic = new User($db); -$title=$langs->trans("Project").' - '.$object->ref.' '.$object->name; -if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->ref.' '.$object->name; +$title=$langs->trans("Project").' - '.$object->ref.($object->thirdparty->name?' - '.$object->thirdparty->name:'').($object->title?' - '.$object->title:''); +if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/',$conf->global->MAIN_HTML_TITLE)) $title=$object->ref.($object->thirdparty->name?' - '.$object->thirdparty->name:'').($object->title?' - '.$object->title:''); $help_url="EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; llxHeader("",$title,$help_url); @@ -634,7 +634,7 @@ else print ''.$langs->trans("ThirdParty").''; $filteronlist=''; if (! empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist=$conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST; - $text=$form->select_thirdparty_list($object->thirdparty->id,'socid',$filteronlist,1,1); + $text=$form->select_thirdparty_list($object->thirdparty->id, 'socid', $filteronlist, 1, 1); $texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty"); print $form->textwithtooltip($text.' '.img_help(), $texthelp, 1, 0, '', '', 2); print '';