diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 82a6a2c0906..c307299c2f9 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -50,6 +50,7 @@ $mode = GETPOST('mode', 'alopha'); $sall = GETPOST("sall", "alpha"); $filter = GETPOST("filter", 'alpha'); +$search_ref = GETPOST('search_ref', 'alpha'); $search_lastname = GETPOST('search_lastname', 'alpha'); $search_login = GETPOST('search_login', 'alpha'); $search_email = GETPOST('search_email', 'alpha'); @@ -96,15 +97,6 @@ $hookmanager->initHooks(array('membertypecard', 'globalcard')); // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers - $search_lastname = ""; - $search_login = ""; - $search_email = ""; - $type = ""; - $sall = ""; -} - - // Security check $result = restrictedArea($user, 'adherent', $rowid, 'adherent_type'); @@ -113,6 +105,15 @@ $result = restrictedArea($user, 'adherent', $rowid, 'adherent_type'); * Actions */ +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers + $search_ref = ""; + $search_lastname = ""; + $search_login = ""; + $search_email = ""; + $type = ""; + $sall = ""; +} + if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; @@ -581,9 +582,9 @@ if ($rowid > 0) { $now = dol_now(); - $sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe as company,"; + $sql = "SELECT d.rowid, d.ref, d.entity, d.login, d.firstname, d.lastname, d.societe as company, d.fk_soc,"; $sql .= " d.datefin,"; - $sql .= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut as status,"; + $sql .= " d.email, d.photo, d.fk_adherent_type as type_id, d.morphy, d.statut as status,"; $sql .= " t.libelle as type, t.subscription, t.amount"; $sqlfields = $sql; // $sql fields to remove for count total @@ -603,6 +604,9 @@ if ($rowid > 0) { $sql .= natural_search(array("d.firstname", "d.lastname"), GETPOST('search', 'alpha')); } } + if (!empty($search_ref)) { + $sql .= natural_search("d.ref", $search_ref); + } if (!empty($search_lastname)) { $sql .= natural_search(array("d.firstname", "d.lastname"), $search_lastname); } @@ -691,6 +695,9 @@ if ($rowid > 0) { if (!empty($status)) { $param .= "&status=".urlencode($status); } + if (!empty($search_ref)) { + $param .= "&search_ref=".urlencode($search_ref); + } if (!empty($search_lastname)) { $param .= "&search_lastname=".urlencode($search_lastname); } @@ -732,6 +739,9 @@ if ($rowid > 0) { print ''; } + print '