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 ''; + print ''; + print ''; print ''; @@ -761,6 +771,7 @@ if ($rowid > 0) { if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder); } + print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "d.ref", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("NameSlashCompany", $_SERVER["PHP_SELF"], "d.lastname", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("Login", $_SERVER["PHP_SELF"], "d.login", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("MemberNature", $_SERVER["PHP_SELF"], "d.morphy", $param, "", "", $sortfield, $sortorder); @@ -780,13 +791,19 @@ if ($rowid > 0) { $datefin = $db->jdate($objp->datefin); + $adh->id = $objp->rowid; + $adh->ref = $objp->ref; + $adh->login = $objp->login; $adh->lastname = $objp->lastname; $adh->firstname = $objp->firstname; $adh->datefin = $datefin; $adh->need_subscription = $objp->subscription; $adh->statut = $objp->status; + $adh->email = $objp->email; + $adh->photo = $objp->photo; print ''; + // Actions if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print ''; @@ -798,6 +815,12 @@ if ($rowid > 0) { } print ""; } + + // Ref + print ""; + print $adh->getNomUrl(-1, 0, 'card', 'ref', '', -1, 0, 1); + print "\n"; + // Lastname if ($objp->company != '') { print ''.img_object($langs->trans("ShowMember"), "user", 'class="paddingright"').$adh->getFullName($langs, 0, -1, 20).' / '.dol_trunc($objp->company, 12).''."\n";