diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 497ec4532d4..4291d998559 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -563,7 +563,7 @@ if ($rowid) print ''; print ''; print ''; print ''; print '
'; - print $form->select_societes($adh->fk_soc,'socid','',1); + print $form->select_company($adh->fk_soc,'socid','',1); print '
'; diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 4f371c27b38..bccc2733d21 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -789,7 +789,7 @@ if ($action == 'create') if ($conf->societe->enabled) { print ''.$langs->trans("LinkedToDolibarrThirdParty").''; - print $form->select_societes($object->fk_soc,'socid','',1); + print $form->select_company($object->fk_soc,'socid','',1); print ''; } @@ -1336,7 +1336,7 @@ if ($rowid && $action != 'edit') print ''; print ''; print ''; print ''; print '
'; - print $form->select_societes($object->fk_soc,'socid','',1); + print $form->select_company($object->fk_soc,'socid','',1); print '
'; diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php index 5b2d565378b..254ea1c6263 100644 --- a/htdocs/cashdesk/admin/cashdesk.php +++ b/htdocs/cashdesk/admin/cashdesk.php @@ -103,7 +103,7 @@ print "\n"; $var=!$var; print ''.$langs->trans("CashDeskThirdPartyForSell").''; print ''; -print $form->select_societes($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,1); +print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,1); print ''; if ($conf->banque->enabled) { diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index b5a1a4fbfb1..104532b469d 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -93,7 +93,7 @@ print ''; $disabled=0; $langs->load("companies"); if (! empty($conf->global->CASHDESK_ID_THIRDPARTY)) $disabled=1; // If a particular third party is defined, we disable choice -$form->select_societes(GETPOST('socid')?GETPOST('socid'):$conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',!$disabled,$disabled,1); +print $form->select_company(GETPOST('socid')?GETPOST('socid'):$conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',!$disabled,$disabled,1); //print ''; print ''; print "\n"; diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 7b90eab7aaa..85bb92979bd 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -523,7 +523,7 @@ if ($action == 'create') } else { - print $form->select_societes('','socid','',1,1); + print $form->select_company('','socid','',1,1); } print ''; @@ -742,7 +742,7 @@ if ($id) // Company print ''.$langs->trans("ActionOnCompany").''; print ''; - print $form->select_societes($act->societe->id,'socid','',1,1); + print $form->select_company($act->societe->id,'socid','',1,1); print ''; // Contact diff --git a/htdocs/compta/deplacement/fiche.php b/htdocs/compta/deplacement/fiche.php index 0c12272b21c..3df794bba82 100644 --- a/htdocs/compta/deplacement/fiche.php +++ b/htdocs/compta/deplacement/fiche.php @@ -287,7 +287,7 @@ if ($action == 'create') // Company print ""; print ''.$langs->trans("CompanyVisited").''; - print $form->select_societes(GETPOST("socid"),'socid','',1); + print $form->select_company(GETPOST("socid"),'socid','',1); print ''; // Public note @@ -375,7 +375,7 @@ else if ($id) // Where print ""; print ''.$langs->trans("CompanyVisited").''; - print $form->select_societes($soc->id,'socid','',1); + print $form->select_company($soc->id,'socid','',1); print ''; // Public note diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index e10f83c9174..213980d55a1 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -389,9 +389,7 @@ else } else { print ''.$langs->trans("Company").''; - print $form->select_societes(isset($_POST["socid"])?$_POST["socid"]:'','socid','',1); - //print $form->select_societes('','socid',''); - //print $langs->trans("ContactNotLinkedToCompany"); + print $form->select_company(GETPOST("socid"),'socid','',1); print ''; } } @@ -563,7 +561,7 @@ else { print ''.$langs->trans("Company").''; print ''; - print $form->select_societes(isset($_POST["socid"])?$_POST["socid"]:($object->socid?$object->socid:-1),'socid','',1); + print $form->select_company(GETPOST("socid")?GETPOST("socid"):($object->socid?$object->socid:-1),'socid','',1); print ''; print ''; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8962f7add5d..09f352c7ec0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -609,28 +609,13 @@ class Form /** * Output html form to select a third party * - * @param string $selected Preselected type - * @param string $htmlname Name of field in form - * @param string $filter Optionnal filters criteras + * @param string $selected Preselected type + * @param string $htmlname Name of field in form + * @param string $filter Optionnal filters criteras * @param int $showempty Add an empty field * @param int $showtype Show third party type in combolist (customer, prospect or supplier) * @param int $forcecombo Force to use combo box - * @return void - */ - function select_societes($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0) - { - print $this->select_company($selected,$htmlname,$filter,$showempty,$showtype,$forcecombo); - } - - /** - * Output html form to select a third party - * - * @param selected Preselected type - * @param htmlname Name of field in form - * @param filter Optionnal filters criteras - * @param showempty Add an empty field - * @param showtype Show third party type in combolist (customer, prospect or supplier) - * @param forcecombo Force to use combo box + * @return string HTML string with */ function select_company($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0) { @@ -647,7 +632,7 @@ class Form if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " ORDER BY nom ASC"; - dol_syslog("Form::select_societes sql=".$sql); + dol_syslog(get_class($this)."::select_company sql=".$sql); $resql=$this->db->query($sql); if ($resql) { @@ -2649,11 +2634,11 @@ class Form } /** - * Affiche formulaire de selection des tiers + * Output html select to select thirdparty * - * @param page Page - * @param selected Id contact pre-selectionne - * @param htmlname Nom du formulaire select + * @param string $page Page + * @param string $selected Id preselected + * @param string $htmlname Name of HTML select * @return void */ function form_thirdparty($page, $selected='', $htmlname='socid') @@ -2667,7 +2652,7 @@ class Form print ''; print ''; print ''; print ''; print '
'; - $num=$this->select_societes($selected , $htmlname); + print $this->select_company($selected , $htmlname); print '
'; @@ -2680,7 +2665,9 @@ class Form $soc = new Societe($this->db); $soc->fetch($selected); print $soc->getNomUrl($langs); - } else { + } + else + { print " "; } } diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index ca7b9176387..40c42a2e81c 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -741,7 +741,7 @@ if ($action == 'create') print '
'; print ''; print ''; print '
'.$langs->trans("ThirdParty").''; - $form->select_societes('','socid','',1,1); + print $form->select_company('','socid','',1,1); print '
'; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 9995aaa152e..001666bea71 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -5,17 +5,17 @@ * Copyright (C) 2005 Marc Barilley * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2011 Juanjo Menent - * + * * 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 . */ @@ -918,7 +918,7 @@ if ($action == 'create') } else { - $form->select_societes((empty($_GET['socid'])?'':$_GET['socid']),'socid','s.fournisseur = 1',1); + print $form->select_company((empty($_GET['socid'])?'':$_GET['socid']),'socid','s.fournisseur = 1',1); } print ''; @@ -1254,7 +1254,7 @@ else // Label print ''.$form->editfieldkey("Label",'label',$object->label,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer)).''; print ''.$form->editfieldval("Label",'label',$object->label,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer)).''; - + /* * List of payments */ diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 773ed3a48f1..b274009897a 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -273,8 +273,7 @@ if ($id || $ref) } else { - $form=new Form($db); - $form->select_societes($_POST["id_fourn"],'id_fourn','fournisseur=1',1); + print $form->select_company($_POST["id_fourn"],'id_fourn','fournisseur=1',1); } print ''; diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index 995a9365f61..95aba87efb0 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/fiche.php @@ -414,7 +414,7 @@ else // Customer print ''.$langs->trans("Company").''; - print $form->select_societes($project->societe->id,'socid','',1,1); + print $form->select_company($project->societe->id,'socid','',1,1); print ''; // Visibility