New: Increase length of project label into agenda filter

This commit is contained in:
Laurent Destailleur 2012-02-04 16:08:53 +01:00
parent dc80f74d2f
commit 01e5fabd0d
3 changed files with 7 additions and 6 deletions

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Eric Seigne <erics@rycks.com> * 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) 2005-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* *

View File

@ -103,7 +103,7 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt
print '<td nowrap="nowrap">'; print '<td nowrap="nowrap">';
print $langs->trans("Project").' &nbsp; '; print $langs->trans("Project").' &nbsp; ';
print '</td><td nowrap="nowrap">'; print '</td><td nowrap="nowrap">';
select_projects($socid?$socid:-1,$pid,'projectid'); select_projects($socid?$socid:-1, $pid, 'projectid', 64);
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -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 $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 int $selected Id project preselected
* @param string $htmlname Nom de la zone html * @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 * @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; global $db,$user,$conf,$langs;
@ -173,7 +174,7 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid')
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1); $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 = 'SELECT p.rowid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public';
$sql.= ' FROM '.MAIN_DB_PREFIX .'projet as p'; $sql.= ' FROM '.MAIN_DB_PREFIX .'projet as p';
$sql.= " WHERE p.entity = ".$conf->entity; $sql.= " WHERE p.entity = ".$conf->entity;
@ -201,7 +202,7 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid')
} }
else else
{ {
$labeltoshow=dol_trunc($obj->ref,16); $labeltoshow=dol_trunc($obj->ref,18);
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')'; //if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
//else $labeltoshow.=' ('.$langs->trans("Private").')'; //else $labeltoshow.=' ('.$langs->trans("Private").')';
if (!empty($selected) && $selected == $obj->rowid && $obj->fk_statut > 0) 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").')'; //if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')';
//else $labeltoshow.=' ('.$langs->trans("Private").')'; //else $labeltoshow.=' ('.$langs->trans("Private").')';
$resultat.='>'.$labeltoshow; $resultat.='>'.$labeltoshow;
if (! $disabled) $resultat.=' - '.dol_trunc($obj->title,12); if (! $disabled) $resultat.=' - '.dol_trunc($obj->title,$maxlength);
$resultat.='</option>'; $resultat.='</option>';
} }
print $resultat; print $resultat;