';
print '';
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 6a13f097a7a..3841183a7d1 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -3264,109 +3264,6 @@ class Form
}
}
- /**
- * Return HTML combo list of week
- * @param selected Preselected value
- * @param htmlname Nom de la zone select
- * @param useempty Affiche valeur vide dans liste
- * TODO Move into html.formother
- */
- function select_dayofweek($selected='',$htmlname='weekid',$useempty=0)
- {
- global $langs;
-
- $week = array( 0=>$langs->trans("Day0"),
- 1=>$langs->trans("Day1"),
- 2=>$langs->trans("Day2"),
- 3=>$langs->trans("Day3"),
- 4=>$langs->trans("Day4"),
- 5=>$langs->trans("Day5"),
- 6=>$langs->trans("Day6"));
-
- $select_week = '';
- return $select_week;
- }
-
- /**
- * Return HTML combo list of month
- * @param selected Preselected value
- * @param htmlname Nom de la zone select
- * @param useempty Affiche valeur vide dans liste
- * TODO Move into html.formother
- */
- function select_month($selected='',$htmlname='monthid',$useempty=0)
- {
- $month = monthArrayOrSelected(-1); // Get array
-
- $select_month = '';
- return $select_month;
- }
-
- /**
- * Return HTML combo list of years
- * @param selected Preselected value (''=current year, -1=none, year otherwise)
- * @param htmlname Name of HTML select object
- * @param useempty Affiche valeur vide dans liste
- * @param $min_year Offset of minimum year into list (by default current year -10)
- * @param $max_year Offset of maximum year into list (by default current year + 5)
- * TODO Move into html.formother
- */
- function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5)
- {
- $currentyear = date("Y");
- $max_year = $currentyear+$max_year;
- $min_year = $currentyear-$min_year;
- if(empty($selected)) $selected = $currentyear;
-
- print '\n";
- }
-
/**
* Return a HTML area with the reference of object and a navigation bar for a business object
* To add a particular filter on select, you must set $object->next_prev_filter to SQL criteria.
diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php
index 12ed562a12e..71da7f1106d 100644
--- a/htdocs/core/class/html.formother.class.php
+++ b/htdocs/core/class/html.formother.class.php
@@ -4,7 +4,7 @@
* Copyright (C) 2004 Benoit Mortier
* Copyright (C) 2004 Sebastien Di Cintio
* Copyright (C) 2004 Eric Seigne
- * Copyright (C) 2005-2010 Regis Houssin
+ * Copyright (C) 2005-2011 Regis Houssin
* Copyright (C) 2006 Andre Cianfarani
* Copyright (C) 2006 Marc Barilley/Ocebo
* Copyright (C) 2007 Franky Van Liedekerke
@@ -470,6 +470,118 @@ class FormOther
ImagePng($image,$file); //renvoie une image sous format png
ImageDestroy($image);
}
+
+ /**
+ * Return HTML combo list of week
+ * @param selected Preselected value
+ * @param htmlname Nom de la zone select
+ * @param useempty Affiche valeur vide dans liste
+ */
+ function select_dayofweek($selected='',$htmlname='weekid',$useempty=0)
+ {
+ global $langs;
+
+ $week = array( 0=>$langs->trans("Day0"),
+ 1=>$langs->trans("Day1"),
+ 2=>$langs->trans("Day2"),
+ 3=>$langs->trans("Day3"),
+ 4=>$langs->trans("Day4"),
+ 5=>$langs->trans("Day5"),
+ 6=>$langs->trans("Day6"));
+
+ $select_week = '';
+ return $select_week;
+ }
+
+ /**
+ * Return HTML combo list of month
+ * @param selected Preselected value
+ * @param htmlname Nom de la zone select
+ * @param useempty Affiche valeur vide dans liste
+ */
+ function select_month($selected='',$htmlname='monthid',$useempty=0)
+ {
+ $month = monthArrayOrSelected(-1); // Get array
+
+ $select_month = '';
+ return $select_month;
+ }
+
+ /**
+ * Return HTML combo list of years
+ * @param selected Preselected value (''=current year, -1=none, year otherwise)
+ * @param htmlname Name of HTML select object
+ * @param useempty Affiche valeur vide dans liste
+ * @param $min_year Offset of minimum year into list (by default current year -10)
+ * @param $max_year Offset of maximum year into list (by default current year + 5)
+ */
+ function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='')
+ {
+ $currentyear = date("Y")+$offset;
+ $max_year = $currentyear+$max_year;
+ $min_year = $currentyear-$min_year;
+ if(empty($selected)) $selected = $currentyear;
+
+ print '\n";
+ }
}
diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php
index 632e7a26302..61f8131f847 100644
--- a/htdocs/fourn/facture/index.php
+++ b/htdocs/fourn/facture/index.php
@@ -28,6 +28,7 @@
require("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.facture.class.php");
require_once(DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.class.php");
+require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php");
if (!$user->rights->fournisseur->facture->lire)
@@ -93,6 +94,7 @@ if ($_POST["mode"] == 'search')
$now=gmmktime();
$html=new Form($db);
+$htmlother=new FormOther($db);
llxHeader('',$langs->trans("SuppliersInvoices"),'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
@@ -206,7 +208,7 @@ if ($resql)
//print ' '.$langs->trans('Year').': ';
$syear = $year;
//if ($syear == '') $syear = date("Y");
- $html->select_year($syear?$syear:-1,'year',1, 20, 5);
+ $htmlother->select_year($syear?$syear:-1,'year',1, 20, 5);
print '