'. $langs->trans("ChangeAccount");
+ print '
'. $langs->trans("ChangeAccount") . ' ';
print $formventilation->select_account(GETPOST('account_parent'), 'account_parent', 1);
print '
';
- print '
' . $langs->trans("Invoice") . ' ';
- print '' . $langs->trans("Ref") . ' ';
- print '' . $langs->trans("Label") . ' ';
- print '' . $langs->trans("Description") . ' ';
- print '' . $langs->trans("Amount") . ' ';
- print '' . $langs->trans("Account") . ' ';
- print ' ';
- print ' ';
+ print '';
+ print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"],"f.ref","",$param,'',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"],"p.label","",$param,'',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"],"l.description","",$param,'',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"],"l.total_ht","",$param,'align="center"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"],"aa.account_number","",$param,'align="center"',$sortfield,$sortorder);
+ print_liste_field_titre('');
+ print_liste_field_titre('');
+ print_liste_field_titre('');
print " \n";
-
- print '
';
+
+ print ' ';
print ' ';
print ' ';
print ' ';
- print ' ';
- print ' ';
- print ' ';
- print ' ';
- print ' ';
+ print ' ';
+ print ' ';
+ print ' ';
+ print ' ';
print ' ';
print "\n";
@@ -215,8 +209,8 @@ if ($result) {
print '
' . dol_trunc($objp->product_label, 24) . ' ';
print '
' . nl2br(dol_trunc($objp->description, 32)) . ' ';
- print '
' . price($objp->total_ht) . ' ';
- print '
' . $codeCompta . ' ';
+ print '
' . price($objp->total_ht) . ' ';
+ print '
' . $codeCompta . ' ';
print '
' . $objp->rowid . ' ';
print '
';
print img_edit();
diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index 924d9bc4481..9a0fecba320 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -976,7 +976,6 @@ else
$head = member_prepare_head($object);
- dol_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user');
if ($conf->use_javascript_ajax)
{
@@ -1020,6 +1019,8 @@ else
print ' ';
if ($backtopage) print ' ';
+ dol_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user');
+
print ' ';
// Ref
@@ -1179,7 +1180,9 @@ else
print '
';
- print '';
+ dol_fiche_end();
+
+ print '
';
print ' ';
print ' ';
print ' ';
@@ -1187,7 +1190,6 @@ else
print '';
- print '
';
}
if ($rowid && $action != 'edit')
@@ -1277,7 +1279,7 @@ else
$texttosend=$object->makeSubstitution($adht->getMailOnValid());
$tmp=$langs->trans("SendAnEMailToMember");
- $tmp.=' ('.$langs->trans("MailFrom").':
'.$conf->global->ADHERENT_MAIL_FROM.' , ';
+ $tmp.='
('.$langs->trans("MailFrom").':
'.$conf->global->ADHERENT_MAIL_FROM.' , ';
$tmp.=$langs->trans("MailRecipient").':
'.$object->email.' )';
$helpcontent='';
$helpcontent.='
'.$langs->trans("MailFrom").' : '.$conf->global->ADHERENT_MAIL_FROM.'
'."\n";
@@ -1298,7 +1300,7 @@ else
if (! empty($conf->mailman->enabled) && ! empty($conf->global->ADHERENT_USE_SPIP)) {
$formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"),'value'=>'');
}
- print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion,1);
+ print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion,1,1);
}
// Confirm send card by mail
@@ -1319,7 +1321,7 @@ else
$texttosend=$object->makeSubstitution($adht->getMailOnResiliate());
$tmp=$langs->trans("SendAnEMailToMember");
- $tmp.=' ('.$langs->trans("MailFrom").':
'.$conf->global->ADHERENT_MAIL_FROM.' , ';
+ $tmp.='
('.$langs->trans("MailFrom").':
'.$conf->global->ADHERENT_MAIL_FROM.' , ';
$tmp.=$langs->trans("MailRecipient").':
'.$object->email.' )';
$helpcontent='';
$helpcontent.='
'.$langs->trans("MailFrom").' : '.$conf->global->ADHERENT_MAIL_FROM.'
'."\n";
@@ -1335,7 +1337,7 @@ else
$formquestion=array();
if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?'true':'false'));
if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]));
- print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion);
+ print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion,'no',1);
}
// Confirm remove member
diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index ff6c1eb7963..1cf2a8e5e09 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -73,6 +73,10 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
$sall="";
}
+// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
+$hookmanager->initHooks(array('memberlist'));
+$extrafields = new ExtraFields($db);
+
/*
* View
@@ -91,6 +95,12 @@ $sql = "SELECT d.rowid, d.login, d.lastname, d.firstname, d.societe as company,
$sql.= " d.datefin,";
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
$sql.= " t.libelle as type, t.cotisation";
+// Add fields for extrafields
+foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
+// Add fields from hooks
+$parameters=array();
+$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
+$sql.=$hookmanager->resPrint;
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d";
if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_member as cm ON d.rowid = cm.fk_member"; // We need this table joined to the select in order to filter by categ
$sql.= ", ".MAIN_DB_PREFIX."adherent_type as t";
@@ -100,52 +110,23 @@ if ($catid == -2) $sql.= " AND cm.fk_categorie IS NULL";
if ($search_categ > 0) $sql.= " AND cm.fk_categorie = ".$db->escape($search_categ);
if ($search_categ == -2) $sql.= " AND cm.fk_categorie IS NULL";
$sql.= " AND d.entity IN (".getEntity('adherent', 1).")";
-if ($sall)
-{
- // For natural search
- $scrit = explode(' ', $sall);
- foreach ($scrit as $crit)
- {
- $sql.=" AND (";
- if (is_numeric($sall)) $sql.= "d.rowid = ".$db->escape($sall)." OR ";
- $sql.=" d.firstname LIKE '%".$db->escape($sall)."%' OR d.lastname LIKE '%".$db->escape($sall)."%' OR d.societe LIKE '%".$db->escape($sall)."%'";
- $sql.=" OR d.email LIKE '%".$db->escape($sall)."%' OR d.login LIKE '%".$db->escape($sall)."%' OR d.address LIKE '%".$db->escape($sall)."%'";
- $sql.=" OR d.town LIKE '%".$db->escape($sall)."%' OR d.note_public LIKE '%".$db->escape($sall)."%' OR d.note_private LIKE '%".$db->escape($sall)."%')";
- }
-}
-if ($type > 0)
-{
- $sql.=" AND t.rowid=".$db->escape($type);
-}
-if (isset($_GET["statut"]) || isset($_POST["statut"]))
-{
- $sql.=" AND d.statut in (".$db->escape($statut).")"; // Peut valoir un nombre ou liste de nombre separes par virgules
-}
+if ($sall) $sql.=natural_search(array("d.rowid", "d.firstname", "d.lastname", "d.societe", "d.email", "d.login", "d.address", "d.town", "d.note_public", "d.note_private"), $sall);
+if ($type > 0) $sql.=" AND t.rowid=".$db->escape($type);
+if (isset($_GET["statut"]) || isset($_POST["statut"])) $sql.=" AND d.statut in (".$db->escape($statut).")"; // Peut valoir un nombre ou liste de nombre separes par virgules
if ($search_ref)
{
if (is_numeric($search_ref)) $sql.= " AND (d.rowid = ".$db->escape($search_ref).")";
else $sql.=" AND 1 = 2"; // Always wrong
}
-if ($search_lastname)
-{
- $sql.= " AND (d.firstname LIKE '%".$db->escape($search_lastname)."%' OR d.lastname LIKE '%".$db->escape($search_lastname)."%' OR d.societe LIKE '%".$db->escape($search_lastname)."%')";
-}
-if ($search_login)
-{
- $sql.= " AND d.login LIKE '%".$db->escape($search_login)."%'";
-}
-if ($search_email)
-{
- $sql.= " AND (d.email LIKE '%".$db->escape($search_email)."%')";
-}
-if ($filter == 'uptodate')
-{
- $sql.=" AND datefin >= '".$db->idate($now)."'";
-}
-if ($filter == 'outofdate')
-{
- $sql.=" AND (datefin IS NULL OR datefin < '".$db->idate($now)."')";
-}
+if ($search_lastname) $sql.= natural_search(array("d.firstname", "d.lastname", "d.societe"), $search_lastname);
+if ($search_login) $sql.= natural_search("d.login", $search_login);
+if ($search_email) $sql.= natural_search("d.email", $search_email);
+if ($filter == 'uptodate') $sql.=" AND datefin >= '".$db->idate($now)."'";
+if ($filter == 'outofdate') $sql.=" AND (datefin IS NULL OR datefin < '".$db->idate($now)."')";
+// Add where from hooks
+$parameters=array();
+$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
+$sql.=$hookmanager->resPrint;
// Count total nb of records with no order and no limits
$nbtotalofrecords = 0;
@@ -199,11 +180,12 @@ if ($resql)
if ($sall)
{
- print $langs->trans("Filter")." (".$langs->trans("Ref").", ".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall;
+ print $langs->trans("Filter")." (".$langs->trans("Ref").", ".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ";
+ print '
'.$sall.' ';
}
print '