From 250a995de824d361be68a53cd22a2df6cd9d2310 Mon Sep 17 00:00:00 2001 From: Ion Agorria Date: Sun, 28 Dec 2014 02:54:42 +0100 Subject: [PATCH 1/2] Bug? --- dev/translation/strip_language_file.php | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/dev/translation/strip_language_file.php b/dev/translation/strip_language_file.php index d6c45d9f249..42a70c8c1a6 100755 --- a/dev/translation/strip_language_file.php +++ b/dev/translation/strip_language_file.php @@ -1,20 +1,20 @@ #!/usr/bin/php - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Copyright (C) 2014 Laurent Destailleur + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . * * ----- * @@ -270,8 +270,8 @@ foreach($filesToProcess as $fileToProcess) print "Output can be found at $output.\n"; - print "To rename all .delta files, you can do\n"; - print 'for fic in `ls *.delta`; do f=`echo $fic | sed -e \'s/\.delta//\'`; echo $f; mv $f.delta $f; done'."\n"; + print "To rename all .delta files, you can do\n"; + print 'for fic in `ls *.delta`; do f=`echo $fic | sed -e \'s/\.delta//\'`; echo $f; mv $f.delta $f; done'."\n"; } From bdd7e9df2386ff8cf05dfcb9e01a0da94266b653 Mon Sep 17 00:00:00 2001 From: Ion Agorria Date: Sun, 28 Dec 2014 03:39:30 +0100 Subject: [PATCH 2/2] Added searching using year --- htdocs/projet/index.php | 3 ++- htdocs/projet/list.php | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) 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);