From 01e5fabd0d94265041f71c1b919284224ddcde36 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 4 Feb 2012 16:08:53 +0100 Subject: [PATCH] New: Increase length of project label into agenda filter --- htdocs/comm/action/index.php | 2 +- htdocs/core/lib/agenda.lib.php | 2 +- htdocs/core/lib/project.lib.php | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index f5a78a35799..eda7b48bd08 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Eric Seigne - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2011 Juanjo Menent * diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index e68728307a8..9b2ece03540 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -103,7 +103,7 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt print ''; print $langs->trans("Project").'   '; print ''; - select_projects($socid?$socid:-1,$pid,'projectid'); + select_projects($socid?$socid:-1, $pid, 'projectid', 64); print ''; } diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 78887cc6a9b..00a53319a8c 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -157,9 +157,10 @@ function task_prepare_head($object) * @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id) * @param int $selected Id project preselected * @param string $htmlname Nom de la zone html + * @param int $maxlength Maximum length of label * @return int Nbre of project if OK, <0 if KO */ -function select_projects($socid=-1, $selected='', $htmlname='projectid') +function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16) { global $db,$user,$conf,$langs; @@ -173,7 +174,7 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid') $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1); } - // On recherche les projets + // Search all projects $sql = 'SELECT p.rowid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public'; $sql.= ' FROM '.MAIN_DB_PREFIX .'projet as p'; $sql.= " WHERE p.entity = ".$conf->entity; @@ -201,7 +202,7 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid') } else { - $labeltoshow=dol_trunc($obj->ref,16); + $labeltoshow=dol_trunc($obj->ref,18); //if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')'; //else $labeltoshow.=' ('.$langs->trans("Private").')'; if (!empty($selected) && $selected == $obj->rowid && $obj->fk_statut > 0) @@ -233,7 +234,7 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid') //if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')'; //else $labeltoshow.=' ('.$langs->trans("Private").')'; $resultat.='>'.$labeltoshow; - if (! $disabled) $resultat.=' - '.dol_trunc($obj->title,12); + if (! $disabled) $resultat.=' - '.dol_trunc($obj->title,$maxlength); $resultat.=''; } print $resultat;