FIX The search on user/group was not using new code. Fiels used for
search was not visible.
This commit is contained in:
parent
38e5b773ce
commit
84f4f2d40f
@ -126,8 +126,19 @@ if (GETPOST('search_project') != '')
|
|||||||
}
|
}
|
||||||
if (GETPOST('search_task') != '')
|
if (GETPOST('search_task') != '')
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT.'/projet/tasks/list.php?mode=search&search_all='.urlencode(GETPOST('search_task')));
|
header("Location: ".DOL_URL_ROOT.'/projet/tasks/list.php?mode=search&search_all='.urlencode(GETPOST('search_task')));
|
||||||
exit;
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GETPOST('search_user') != '')
|
||||||
|
{
|
||||||
|
header("Location: ".DOL_URL_ROOT.'/user/index.php?mode=search&sall='.urlencode(GETPOST('search_user')));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
if (GETPOST('search_group') != '')
|
||||||
|
{
|
||||||
|
header("Location: ".DOL_URL_ROOT.'/user/group/index.php?mode=search&sall='.urlencode(GETPOST('search_group')));
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -49,6 +49,12 @@ $pagenext = $page + 1;
|
|||||||
if (! $sortfield) $sortfield="g.nom";
|
if (! $sortfield) $sortfield="g.nom";
|
||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortorder) $sortorder="ASC";
|
||||||
|
|
||||||
|
// List of fields to search into when doing a "search in all"
|
||||||
|
$fieldstosearchall = array(
|
||||||
|
'g.nom'=>"Group",
|
||||||
|
'g.note'=>"Note"
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -85,7 +91,19 @@ if ($resql)
|
|||||||
|
|
||||||
$param="&search_group=".urlencode($search_group)."&sall=".urlencode($sall);
|
$param="&search_group=".urlencode($search_group)."&sall=".urlencode($sall);
|
||||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||||
print '<table class="noborder" width="100%">';
|
|
||||||
|
if ($sall)
|
||||||
|
{
|
||||||
|
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||||
|
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
||||||
|
}
|
||||||
|
|
||||||
|
$moreforfilter='';
|
||||||
|
|
||||||
|
//$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
|
//$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
|
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("Group"),$_SERVER["PHP_SELF"],"g.nom",$param,"","",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Group"),$_SERVER["PHP_SELF"],"g.nom",$param,"","",$sortfield,$sortorder);
|
||||||
//multicompany
|
//multicompany
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -63,31 +63,23 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
|||||||
|
|
||||||
// Search User
|
// Search User
|
||||||
$var=false;
|
$var=false;
|
||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/user/index.php">';
|
print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<table class="noborder nohover" width="100%">';
|
print '<table class="noborder nohover" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAUser").'</td></tr>';
|
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td>';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print $langs->trans("Ref").':</td><td><input class="flat" type="text" name="search_user" size="18"></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
print $langs->trans("User").':</td><td><input class="flat" type="text" name="search_user" size="18"></td><td'.($canreadperms?' rowspan="2"':'').'><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td></tr>';
|
|
||||||
print "</table><br>\n";
|
|
||||||
print '</form>';
|
|
||||||
|
|
||||||
// Search Group
|
// Search Group
|
||||||
if ($canreadperms)
|
if ($canreadperms)
|
||||||
{
|
{
|
||||||
$var=false;
|
$var=false;
|
||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/user/group/index.php">';
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
||||||
print '<table class="noborder nohover" width="100%">';
|
|
||||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAGroup").'</td></tr>';
|
|
||||||
print '<tr '.$bc[$var].'><td>';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print $langs->trans("Ref").':</td><td><input class="flat" type="text" name="search_group" size="18"></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
print $langs->trans("Group").':</td><td><input class="flat" type="text" name="search_group" size="18"></td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td></tr>';
|
|
||||||
print "</table><br>\n";
|
|
||||||
print '</form>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print "</table><br>\n";
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
//print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
|
//print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
|
||||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user