Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 17.0
This commit is contained in:
parent
5254b6ba14
commit
cfae78c86f
@ -181,7 +181,8 @@ $result = restrictedArea($user, 'adherent');
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST('cancel', 'alpha')) {
|
if (GETPOST('cancel', 'alpha')) {
|
||||||
$action = 'list'; $massaction = '';
|
$action = 'list';
|
||||||
|
$massaction = '';
|
||||||
}
|
}
|
||||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
|
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
|
||||||
$massaction = '';
|
$massaction = '';
|
||||||
@ -317,10 +318,16 @@ $formother = new FormOther($db);
|
|||||||
$membertypestatic = new AdherentType($db);
|
$membertypestatic = new AdherentType($db);
|
||||||
$memberstatic = new Adherent($db);
|
$memberstatic = new Adherent($db);
|
||||||
|
|
||||||
$title = $langs->trans("Members");
|
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
|
// Page Header
|
||||||
|
$title = $langs->trans("Members")." - ".$langs->trans("List");
|
||||||
|
$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
|
||||||
|
$morejs = array();
|
||||||
|
$morecss = array();
|
||||||
|
|
||||||
|
// Build and execute select
|
||||||
|
// --------------------------------------------------------------------
|
||||||
if ((!empty($search_categ) && $search_categ > 0) || !empty($catid)) {
|
if ((!empty($search_categ) && $search_categ > 0) || !empty($catid)) {
|
||||||
$sql = "SELECT DISTINCT";
|
$sql = "SELECT DISTINCT";
|
||||||
} else {
|
} else {
|
||||||
@ -343,8 +350,8 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
}
|
}
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sqlfields = $sql; // $sql fields to remove for count total
|
$sqlfields = $sql; // $sql fields to remove for count total
|
||||||
@ -471,16 +478,14 @@ if ($search_country) {
|
|||||||
if ($search_import_key) {
|
if ($search_import_key) {
|
||||||
$sql .= natural_search("d.import_key", $search_import_key);
|
$sql .= natural_search("d.import_key", $search_import_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add where from extra fields
|
// Add where from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||||
|
|
||||||
// Add where from hooks
|
// Add where from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= $hookmanager->resPrint;
|
$sql .= $hookmanager->resPrint;
|
||||||
|
|
||||||
// Count total nb of records with no order and no limits
|
// Count total nb of records
|
||||||
$nbtotalofrecords = '';
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||||
@ -494,7 +499,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
|
||||||
$page = 0;
|
$page = 0;
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
}
|
}
|
||||||
@ -517,8 +522,7 @@ if (!$resql) {
|
|||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
|
||||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
// Direct jump if only one record found
|
||||||
|
|
||||||
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall) {
|
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
$id = $obj->rowid;
|
$id = $obj->rowid;
|
||||||
@ -526,8 +530,12 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
|
// Output page
|
||||||
llxHeader('', $title, $help_url);
|
// --------------------------------------------------------------------
|
||||||
|
|
||||||
|
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
|
||||||
|
|
||||||
|
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||||
|
|
||||||
if ($search_type > 0) {
|
if ($search_type > 0) {
|
||||||
$membertype = new AdherentType($db);
|
$membertype = new AdherentType($db);
|
||||||
@ -1274,7 +1282,7 @@ if ($num == 0) {
|
|||||||
$colspan++;
|
$colspan++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
|
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user