From 58c1cb3e7c9f49e1e7931f3904f0eb1adc84c2e2 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 25 Feb 2012 09:05:36 +0100 Subject: [PATCH] Fix: function is outside of class and add TODO --- htdocs/core/class/html.formother.class.php | 90 +++++++++++----------- 1 file changed, 44 insertions(+), 46 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 3ecce003beb..e39c4ad26dd 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -631,6 +631,49 @@ class FormOther return $out; } + /** + * Show form to select addresse + * + * @param int $page Page + * @param string $selected Id condition pre-selectionne + * @param string $htmlname Nom du formulaire select + * @param string $origin Origine de l'appel pour pouvoir creer un retour + * @param int $originid Id de l'origine + * @return void + */ + function form_address($page, $selected='', $socid, $htmlname='address_id', $origin='', $originid='') + { + global $langs,$conf; + if ($htmlname != "none") + { + print '
'; + print ''; + print ''; + print ''; + print ''; + print '
'; + $this->select_address($selected, $socid, $htmlname, 1); + print ''; + $langs->load("companies"); + print '   '.$langs->trans("AddAddress").''; + print '
'; + } + else + { + if ($selected) + { + require_once(DOL_DOCUMENT_ROOT ."/societe/class/address.class.php"); + $address=new Address($this->db); + $result=$address->fetch_address($selected); + print ''.$address->label.''; + } + else + { + print " "; + } + } + } + } @@ -644,6 +687,7 @@ class FormOther * @param int $selectedtask Id selected task * @param int $selectedproject Id selected project * @return void + * TODO why this function is here ? */ function PLineSelect(&$inc, $parent, $lines, $level=0, $selectedtask=0, $selectedproject=0) { @@ -713,52 +757,6 @@ function PLineSelect(&$inc, $parent, $lines, $level=0, $selectedtask=0, $selecte $level--; } } - - - /** - * Show form to select addresse - * - * @param int $page Page - * @param string $selected Id condition pre-selectionne - * @param string $htmlname Nom du formulaire select - * @param string $origin Origine de l'appel pour pouvoir creer un retour - * @param int $originid Id de l'origine - * @return void - * @deprecated - */ - function form_address($page, $selected='', $socid, $htmlname='address_id', $origin='', $originid='') - { - global $langs,$conf; - if ($htmlname != "none") - { - print '
'; - print ''; - print ''; - print ''; - print ''; - print '
'; - $this->select_address($selected, $socid, $htmlname, 1); - print ''; - $langs->load("companies"); - print '   '.$langs->trans("AddAddress").''; - print '
'; - } - else - { - if ($selected) - { - require_once(DOL_DOCUMENT_ROOT ."/societe/class/address.class.php"); - $address=new Address($this->db); - $result=$address->fetch_address($selected); - print ''.$address->label.''; - } - else - { - print " "; - } - } - } - } ?>