--- dolibarr/htdocs/lib/lib_head.js 2008-05-19 05:00:20.000000000 +0200 +++ new_dolibarr/htdocs/lib/lib_head.js 2008-06-17 17:20:28.000000000 +0200 @@ -55,7 +55,16 @@ document.form_index.action.value="updateedit"; document.form_index.submit(); } - +function hiddenfrom(idselected,idHiddenSelect){ + if(document.getElementById(idselected).value == 0) + { + document.getElementById(idHiddenSelect).style.visibility="hidden"; + }else + { + document.getElementById(idHiddenSelect).style.visibility="visible"; + } + +} /*================================================================= @@ -676,4 +685,4 @@ /*win.getContent().innerHTML = message;*/ win.getContent().update(message); win.showCenter(); -} \ Pas de fin de ligne à la fin du fichier. +} --- dolibarr/htdocs/soc.php 2008-06-10 05:00:14.000000000 +0200 +++ new_dolibarr/htdocs/soc.php 2008-06-17 17:20:28.000000000 +0200 @@ -26,10 +26,10 @@ \brief Third party card page \version $Id: soc.php,v 1.232 2008/06/09 19:32:39 eldy Exp $ */ - require("pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); require_once(DOL_DOCUMENT_ROOT."/contact.class.php"); +require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php"); $langs->load("companies"); $langs->load("commercial"); @@ -171,12 +171,18 @@ $contact->priv=0; $result=$contact->create($user); } } if ($result >= 0) { $db->commit(); + $ajoutCat=$_POST["catMere"]; + $ajoutCatFournisseur=$_POST["catMereFournisseur"]; + $cat = new Categorie($db); + $cat->add_cat_societe($ajoutCat,"societe"); + $cat->add_cat_societe($ajoutCatFournisseur,"fournisseur"); if ( $soc->client == 1 ) { @@ -392,11 +398,13 @@ } // Client / Prospect - print ''.$langs->trans('ProspectCustomer').''; print ''; print ''; print ''; - print ''; + print ''; print ''.$langs->trans('CustomerCode').''; print ''; print ''; print ''; print '
'; @@ -420,6 +428,7 @@ print '
'.$langs->trans('Supplier').''; print $form->selectyesno("fournisseur",$soc->fournisseur,1); + print ''.$langs->trans('SupplierCode').''; print '
'; --- dolibarr/htdocs/html.form.class.php 2008-06-10 05:00:14.000000000 +0200 +++ new_dolibarr/htdocs/html.form.class.php 2008-06-17 17:20:28.000000000 +0200 @@ -2960,7 +2960,7 @@ $no="0"; } - $resultyesno = ''."\n"; if (("$value" == 'yes') || ($value == 1)) { $resultyesno .= ''."\n"; --- dolibarr/htdocs/categories/categorie.class.php 2008-04-29 05:00:13.000000000 +0200 +++ new_dolibarr/htdocs/categories/categorie.class.php 2008-06-17 17:20:28.000000000 +0200 @@ -971,5 +970,22 @@ return -1; } } + function add_cat_societe($nocategorie,$type) + { + $sql = "SELECT max(rowid) FROM ".MAIN_DB_PREFIX."societe"; + $res = $this->db->query ($sql); + if ($res) + { + while ($cat = $this->db->fetch_array ($res)) + { + $noSociete= $cat['max(rowid)']; + } + } + $sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_".$type; + $sql.= " VALUES ($nocategorie,$noSociete)"; + $this->db->query($sql); + } + + } ?>