vtiger Forum Index vtiger
The Honest Open Source CRM
 

Filtres: Filtres sur l'utilisateur courant
Click here to go to the original topic

 
       vtiger Forum Index -> French Forum
Previous topic :: Next topic  
Author Message
zitoune



Joined: 23 Jul 2007
Posts: 23

Posted: Tue Aug 21, 2007 11:32 am    Post subject: Filtres: Filtres sur l'utilisateur courant  

En version 5.0.2 il était possible de réaliser un filtre du type "mes comptes" grâce à une modification de code au début de la fonction getUserId_ol (fichier includes/util/utils.php) :

If($username == "moi")
{
$username = $GLOBALS['current_user']->user_name;
}

Une fois le code modifié, il suffisait de mettre une condition sur la colonne assigné a (equals moi)

Cette même modification portée sur le code de la 5.0.3 ne génère pas d'erreur directement mais le filtre ne retourne pas de lignes.

Des idées , des propositions?
Back to top  
pstrosser



Joined: 27 Nov 2006
Posts: 12

Posted: Thu Aug 23, 2007 6:52 am    Post subject: Filtres: Filtres sur l  

Bonjour,

Voici comment j'ai fait :
- éditer customview/customview.php
- compléter la fonction function getModifiedCvListQuery
if(isset($advfiltersql) && $advfiltersql != '')
{
//rajout pour gérer le _cuName
$query .= ' and '.str_replace("_cuName",$GLOBALS['current_user']->user_name,$advfiltersql);
}

Nota : mon _cuName est votre "moi".

Bonne journée

Philippe
Back to top  
zitoune



Joined: 23 Jul 2007
Posts: 23

Posted: Tue Sep 04, 2007 7:33 am    Post subject: Re: Filtres: Filtres sur l'utilisateur courant  

Super!javascript:emoticon(':D')
Very Happy

old code :
if(isset($advfiltersql) && $advfiltersql != '')
{
$query .= ' and '.$advfiltersql;
}
new code:
if(isset($advfiltersql) && $advfiltersql != '')
{
// $query .= ' and '.$advfiltersql;
// rajout pour gérer le moi
$query .= ' and '.str_replace("moi",$GLOBALS['current_user']->user_name,$advfiltersql);
}

Merci pstrosser
Back to top  
 
       vtiger Forum Index -> French Forum
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.15 © 2001, 2002 phpBB Group