diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php
index 36f53b02680..ec807f5a5a3 100644
--- a/htdocs/projet/index.php
+++ b/htdocs/projet/index.php
@@ -84,7 +84,8 @@ if (! empty($conf->projet->enabled) && $user->rights->projet->lire)
print '
| '.$langs->trans("SearchAProject").' |
';
print '';
print '| : | | ';
- print ' |
';
+ print ' | ';
+ print '| : | | ';
print '
| : | | ';
print '
';
print "\n";
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 614f91468cc..f00a6ef518b 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -27,6 +27,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$langs->load('projects');
@@ -61,6 +62,7 @@ $mine = $_REQUEST['mode']=='mine' ? 1 : 0;
$search_ref=GETPOST("search_ref");
$search_label=GETPOST("search_label");
$search_societe=GETPOST("search_societe");
+$search_year=GETPOST("search_year");
$search_all=GETPOST("search_all");
// Purge criteria
@@ -69,6 +71,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
$search_ref="";
$search_label="";
$search_societe="";
+ $search_year="";
$search_all=0;
}
@@ -106,6 +109,10 @@ if ($search_societe)
{
$sql .= natural_search('s.nom', $search_societe);
}
+if ($search_year) {
+ $sql .= " AND (p.dateo IS NULL OR p.dateo <= ".$db->idate(dol_get_last_day($search_year,12,false)).")";
+ $sql .= " AND (p.datee IS NULL OR p.datee >= ".$db->idate(dol_get_first_day($search_year,1,false)).")";
+}
if ($search_all)
{
$sql .= natural_search(array('p.ref','p.title','s.nom'), $search_all);