diff --git a/htdocs/core/search.php b/htdocs/core/search.php index 321fc94a925..333cb218e58 100644 --- a/htdocs/core/search.php +++ b/htdocs/core/search.php @@ -50,6 +50,7 @@ if (!defined('NOREQUIREMENU')) { require_once '../main.inc.php'; + /* * Actions */ @@ -128,11 +129,11 @@ if (GETPOST('search_task') != '') { } if (GETPOST('search_user') != '') { - header("Location: ".DOL_URL_ROOT.'/user/list.php?mode=search&sall='.urlencode(GETPOST('search_user'))); + header("Location: ".DOL_URL_ROOT.'/user/list.php?search_all='.urlencode(GETPOST('search_user'))); exit; } if (GETPOST('search_group') != '') { - header("Location: ".DOL_URL_ROOT.'/user/group/list.php?mode=search&sall='.urlencode(GETPOST('search_group'))); + header("Location: ".DOL_URL_ROOT.'/user/group/list.php?search_all='.urlencode(GETPOST('search_group'))); exit; } diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index 9f7505c3de1..7e707b6b4fc 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -43,7 +43,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ09'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'aZ'); -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $search_group = GETPOST('search_group'); // Load variable for pagination @@ -152,12 +152,15 @@ if (empty($reshook)) { * View */ -$help_url=""; +$form = new Form($db); + +$help_url = ''; $title = $langs->trans("UserGroups"); $morejs = array(); $morecss = array(); - +// Build and execute select +// -------------------------------------------------------------------- $sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec, g.tms as datem, COUNT(DISTINCT ugu.fk_user) as nb, COUNT(DISTINCT ugr.fk_id) as nbpermissions"; $sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_usergroup = g.rowid"; @@ -230,6 +233,27 @@ foreach ($search as $key => $val) { if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); } +// Add $param from extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +// Add $param from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook +$param .= $hookmanager->resPrint; + +// List of mass actions available +$arrayofmassactions = array( + //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), +); +if (!empty($permissiontodelete)) { + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); +} +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { + $arrayofmassactions = array(); +} +$massactionbutton = $form->selectMassAction('', $arrayofmassactions); print '
'."\n"; + // End of page llxFooter(); $db->close(); diff --git a/htdocs/user/list.php b/htdocs/user/list.php index d3139b438e2..3cac5d06c56 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -542,7 +542,7 @@ if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.urlencode($limit); } if ($sall != '') { - $param .= '&sall='.urlencode($sall); + $param .= '&search_all='.urlencode($sall); } if ($search_user != '') { $param .= "&search_user=".urlencode($search_user);