forked from Wavyzz/dolibarr
Fix: si il y avait une adresse de livraison de cre on n'tait oblig de la slectionner
This commit is contained in:
@@ -209,7 +209,7 @@ if ($_GET["action"] == 'create')
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('DeliveryAddress').'</td>';
|
||||
print '<td colspan="3">';
|
||||
$numaddress = $html->select_adresse_livraison($soc->adresse_livraison_id, $_GET['socidp'],'adresse_livraison_id');
|
||||
$numaddress = $html->select_adresse_livraison($soc->adresse_livraison_id, $_GET['socidp'],'adresse_livraison_id',1);
|
||||
if ($numaddress==0)
|
||||
{
|
||||
print ' <a href=../comm/adresse_livraison.php?socid='.$soc->id.'&action=create>'.$langs->trans("AddAddress").'</a>';
|
||||
|
||||
@@ -660,7 +660,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
|
||||
|
||||
// Adresse de livraison
|
||||
print '<tr><td nowrap="nowrap">'.$langs->trans('DeliveryAddress').'</td><td>';
|
||||
$numaddress = $html->select_adresse_livraison($soc->adresse_livraison_id, $_GET['socidp'],'adresse_livraison_id');
|
||||
$numaddress = $html->select_adresse_livraison($soc->adresse_livraison_id, $_GET['socidp'],'adresse_livraison_id',1);
|
||||
|
||||
if ($numaddress==0)
|
||||
{
|
||||
|
||||
@@ -911,7 +911,7 @@ class Form
|
||||
* \param selected Id contact pr<70>-s<>lectionn
|
||||
* \param htmlname Nom champ formulaire
|
||||
*/
|
||||
function select_adresse_livraison($selected='', $socid, $htmlname='adresse_livraison_id')
|
||||
function select_adresse_livraison($selected='', $socid, $htmlname='adresse_livraison_id',$showempty=0)
|
||||
{
|
||||
// On recherche les utilisateurs
|
||||
$sql = "SELECT a.rowid, a.label";
|
||||
@@ -922,6 +922,7 @@ class Form
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
print '<select class="flat" name="'.$htmlname.'">';
|
||||
if ($showempty) print '<option value="0"> </option>';
|
||||
$num = $this->db->num_rows();
|
||||
$i = 0;
|
||||
if ($num)
|
||||
@@ -1756,7 +1757,7 @@ class Form
|
||||
print '<input type="hidden" name="action" value="setdeliveryadress">';
|
||||
print '<table class="noborder" cellpadding="0" cellspacing="0">';
|
||||
print '<tr><td>';
|
||||
$numaddress = $this->select_adresse_livraison($selected, $socid, $htmlname);
|
||||
$numaddress = $this->select_adresse_livraison($selected, $socid, $htmlname, 1);
|
||||
print '</td>';
|
||||
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
if ($numaddress==0)
|
||||
|
||||
Reference in New Issue
Block a user