diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index f5a78a35799af3179ed9b9d9b417eac0369a6495..eda7b48bd08c5959e1b680598983fd89e7cada39 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1,7 +1,7 @@ <?php /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2003 Eric Seigne <erics@rycks.com> - * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> + * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index e68728307a84833a0d7cf9651a23cc8003d0f88d..9b2ece03540b7b49d25fb37bb6aa142d09390534 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 '<td nowrap="nowrap">'; print $langs->trans("Project").' '; print '</td><td nowrap="nowrap">'; - select_projects($socid?$socid:-1,$pid,'projectid'); + select_projects($socid?$socid:-1, $pid, 'projectid', 64); print '</td></tr>'; } diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 78887cc6a9b45ba2efa34b267de7ec84a63a2e8c..00a53319a8c68d4c6318cf8bc48cca5873873de5 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.='</option>'; } print $resultat;