From 4b2b11d59e5ec2fd7014055b844d358d831da38a Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 16 Feb 2004 17:15:26 +0000 Subject: [PATCH] =?UTF-8?q?Affiche=20les=20num=E9ros=20de=20t=E9l=E9phones?= =?UTF-8?q?=20avec=20la=20fonction=20dolibarr=5Fprint=5Fphone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/soc.php | 102 ++++++++++++++++++++----------------------------- 1 file changed, 42 insertions(+), 60 deletions(-) diff --git a/htdocs/soc.php b/htdocs/soc.php index 672b48625d9..b628f5ba78c 100644 --- a/htdocs/soc.php +++ b/htdocs/soc.php @@ -33,60 +33,36 @@ if ($user->societe_id > 0) $socid = $user->societe_id; } -if ($action == 'add') +if ($HTTP_POST_VARS["action"] == 'add' or $HTTP_POST_VARS["action"] == 'update') { $soc = new Societe($db); - $soc->nom = $nom; - - $soc->adresse = $adresse; - $soc->cp = $cp; - $soc->ville = $ville; - - $soc->tel = $tel; - $soc->fax = $fax; - $soc->url = ereg_replace( "http://", "", $url ); - $soc->siren = $siren; - - $soc->siret = $HTTP_POST_VARS["siret"]; - $soc->ape = $HTTP_POST_VARS["ape"]; - $soc->capital = $HTTP_POST_VARS["capital"]; - $soc->tva_intra = $HTTP_POST_VARS["tva_intra_code"] . $HTTP_POST_VARS["tva_intra_num"]; + $soc->nom = $HTTP_POST_VARS["nom"]; + $soc->adresse = $HTTP_POST_VARS["adresse"]; + $soc->cp = $HTTP_POST_VARS["cp"]; + $soc->ville = $HTTP_POST_VARS["ville"]; + $soc->departement_id = $HTTP_POST_VARS["departement_id"]; + $soc->tel = $HTTP_POST_VARS["tel"]; + $soc->fax = $HTTP_POST_VARS["fax"]; + $soc->url = ereg_replace( "http://", "", $HTTP_POST_VARS["url"] ); + $soc->siren = $HTTP_POST_VARS["siren"]; + $soc->siret = $HTTP_POST_VARS["siret"]; + $soc->ape = $HTTP_POST_VARS["ape"]; + $soc->capital = $HTTP_POST_VARS["capital"]; + $soc->tva_intra = $HTTP_POST_VARS["tva_intra_code"] . $HTTP_POST_VARS["tva_intra_num"]; $soc->forme_juridique_id = $HTTP_POST_VARS["forme_juridique_id"]; - $soc->effectif_id = $HTTP_POST_VARS["effectif_id"]; + $soc->effectif_id = $HTTP_POST_VARS["effectif_id"]; + $soc->client = $HTTP_POST_VARS["client"]; + $soc->fournisseur = $HTTP_POST_VARS["fournisseur"]; - $soc->client = $client; - $soc->fournisseur = $fournisseur; - - $socid = $soc->create(); -} - -if ($action == 'update') -{ - $soc = new Societe($db); - - $soc->nom = $nom; - - $soc->adresse = $adresse; - $soc->cp = $cp; - $soc->ville = $ville; - - $soc->tel = $tel; - $soc->fax = $fax; - $soc->url = ereg_replace( "http://", "", $url ); - - $soc->siren = $HTTP_POST_VARS["siren"]; - $soc->siret = $HTTP_POST_VARS["siret"]; - $soc->ape = $HTTP_POST_VARS["ape"]; - $soc->capital = $HTTP_POST_VARS["capital"]; - $soc->tva_intra = $HTTP_POST_VARS["tva_intra_code"] . $HTTP_POST_VARS["tva_intra_num"]; - - $soc->forme_juridique_id = $HTTP_POST_VARS["forme_juridique_id"]; - $soc->effectif_id = $HTTP_POST_VARS["effectif_id"]; - $soc->client = $client; - $soc->fournisseur = $fournisseur; - - $soc->update($socid); + if ($HTTP_POST_VARS["action"] == 'update') + { + $soc->update($socid); + } + if ($HTTP_POST_VARS["action"] == 'add') + { + $socid = $soc->create(); + } } /* @@ -94,6 +70,7 @@ if ($action == 'update') * */ llxHeader(); +$form = new Form($db); if ($action == 'create') { @@ -106,8 +83,12 @@ if ($action == 'create') print ''; print ''; print ''; - print ''; + print ''; + + print ''; print ''; print ''; @@ -122,12 +103,11 @@ if ($action == 'create') print ''; print ''; print ''; print '
Nom
Adresse
CP '; - print 'Ville 
CP '; + print 'Ville Département'; + print $form->select_departement(0); + print '
TéléphoneFax
Capital '.MAIN_MONNAIE.'
Forme juridique'; - $html = new Form($db); - print $html->select_array("forme_juridique_id",$soc->forme_juridique_array(), $soc->forme_juridique, 0, 1); + print $form->select_array("forme_juridique_id",$soc->forme_juridique_array(), $soc->forme_juridique, 0, 1); print '
Effectif'; - print $html->select_array("effectif_id",$soc->effectif_array(), $soc->effectif_id); + print $form->select_array("effectif_id",$soc->effectif_array(), $soc->effectif_id); print '
Numéro de TVA Intracommunautaire'; @@ -165,14 +145,16 @@ elseif ($action == 'edit') print ''; print ''; - print ''; + print ''; print ''; - print ''; - + print ''; + print ''; print ''; print ''; print ''; @@ -289,8 +271,8 @@ else print ''; - print ''; - print ''; + print ''; + print ''; print '';
Nom
Nom
Adresse
CP '; - print 'Ville 
CP '; + print 'Ville Département'; + print $form->select_departement($soc->departement_id); + print '
TéléphoneFax
Webhttp://
Adresse'.nl2br($soc->adresse).' '; print '
'.$soc->cp.' '.$soc->ville.'
Tel'.$soc->tel.'Fax'.$soc->fax.'
Téléphone'.dolibarr_print_phone($soc->tel).'Fax'.dolibarr_print_phone($soc->fax).'
Web'; if ($soc->url) { print 'http://'.$soc->url.''; } print '