diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index ee683f5747d..b1ab8280c66 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -6199,6 +6199,8 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
{
global $db,$langs;
+ $value=trim($value);
+
if ($mode == 0)
{
$value=preg_replace('/\*/','%',$value); // Replace * with %
diff --git a/htdocs/don/card.php b/htdocs/don/card.php
index 203c35caa72..72ea8e84792 100644
--- a/htdocs/don/card.php
+++ b/htdocs/don/card.php
@@ -345,7 +345,7 @@ if ($action == 'create')
// Public note
print '
';
- print '| ' . $langs->trans('NotePrivate') . ' | ';
+ print '' . $langs->trans('NotePrivate') . ' | ';
print '';
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
@@ -542,7 +542,7 @@ if (! empty($id) && $action != 'edit')
$hselected='card';
$head = donation_prepare_head($object);
- dol_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'generic');
+ dol_fiche_head($head, $hselected, $langs->trans("Donation"), -1, 'generic');
// Print form confirm
print $formconfirm;
diff --git a/htdocs/don/document.php b/htdocs/don/document.php
index 115f58e5cc1..0ae81231bc1 100644
--- a/htdocs/don/document.php
+++ b/htdocs/don/document.php
@@ -104,7 +104,7 @@ if ($object->id)
$head=donation_prepare_head($object);
- dol_fiche_head($head, 'documents', $langs->trans("Donation"), 0, 'generic');
+ dol_fiche_head($head, 'documents', $langs->trans("Donation"), -1, 'generic');
// Construit liste des fichiers
@@ -116,7 +116,7 @@ if ($object->id)
}
$linkback = ''.$langs->trans("BackToList").'';
-
+
$morehtmlref=' ';
// Project
if (! empty($conf->projet->enabled))
@@ -151,13 +151,13 @@ if ($object->id)
}
}
$morehtmlref.=' ';
-
-
+
+
dol_banner_tab($object, 'rowid', $linkback, 1, 'rowid', 'ref', $morehtmlref);
-
+
print '';
print ' ';
-
+
print ' ';
// Ref
@@ -166,7 +166,7 @@ if ($object->id)
print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
print '';
*/
-
+
// Societe
//print "| ".$langs->trans("Company")." | ".$object->client->getNomUrl(1)." | ";
@@ -175,9 +175,9 @@ if ($object->id)
print ' ';
print ' ';
-
+
print '';
-
+
dol_fiche_end();
$modulepart = 'don';
diff --git a/htdocs/don/info.php b/htdocs/don/info.php
index 46f398d4749..30c2129b6c6 100644
--- a/htdocs/don/info.php
+++ b/htdocs/don/info.php
@@ -67,7 +67,7 @@ $object->info($id);
$head = donation_prepare_head($object);
-dol_fiche_head($head, 'info', $langs->trans("Donation"), 0, 'generic');
+dol_fiche_head($head, 'info', $langs->trans("Donation"), -1, 'generic');
$linkback = ''.$langs->trans("BackToList").'';
@@ -116,7 +116,7 @@ print ' ';
print '| ';
dol_print_object_info($object);
print ' | ';
-
+
print '';
dol_fiche_end();
diff --git a/htdocs/don/list.php b/htdocs/don/list.php
index 3d0422da917..5521b233a28 100644
--- a/htdocs/don/list.php
+++ b/htdocs/don/list.php
@@ -42,7 +42,7 @@ $pagenext = $page + 1;
if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="d.datedon";
-$statut=isset($_GET["statut"])?$_GET["statut"]:"-1";
+$statut=(GETPOST("statut",'intcomma')!='')?GETPOST("statut",'intcomma'):"-1";
$search_all=GETPOST('sall', 'alphanohtml');
$search_ref=GETPOST('search_ref','alpha');
$search_company=GETPOST('search_company','alpha');
@@ -90,13 +90,13 @@ $sql.= " d.amount, d.fk_statut as statut, ";
$sql.= " p.rowid as pid, p.ref, p.title, p.public";
$sql.= " FROM ".MAIN_DB_PREFIX."don as d LEFT JOIN ".MAIN_DB_PREFIX."projet AS p";
$sql.= " ON p.rowid = d.fk_projet WHERE 1 = 1";
-if ($statut >= 0)
+if ($statut != '' && $statut != '-1')
{
- $sql .= " AND d.fk_statut = ".$statut;
+ $sql .= " AND d.fk_statut IN (".$statut.")";
}
if (trim($search_ref) != '')
{
- $sql.= ' AND d.rowid LIKE \'%'.$db->escape(trim($search_ref)) . '%\'';
+ $sql.= natural_search('d.ref',$search_ref);
}
if (trim($search_all) != '')
{
@@ -110,7 +110,7 @@ if (trim($search_name) != '')
{
$sql .= natural_search(array('d.lastname', 'd.firstname'), $search_name);
}
-if ($search_amount) $sql.= natural_search(array('d.amount'), price2num(trim($search_amount)), 1);
+if ($search_amount) $sql.= natural_search('d.amount', $search_amount, 1);
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = '';
@@ -131,17 +131,7 @@ if ($resql)
//if ($page > 0) $param.= '&page='.$page;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
- if ($statut >= 0)
- {
- $donationstatic->statut=$statut;
- $label=$donationstatic->getLibStatut(0);
- print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num,$nbtotalofrecords);
- }
- else
- {
- print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num,$nbtotalofrecords);
- }
-
+ print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num,$nbtotalofrecords);
print ' |