Dbut ajout de la gestion des adresses de livraison
This commit is contained in:
parent
827b97884c
commit
403fda125b
@ -47,6 +47,8 @@ if (! $user->rights->societe->creer)
|
||||
}
|
||||
|
||||
$idl = isset($_GET["idl"])?$_GET["idl"]:'';
|
||||
$origin = isset($_GET["origin"])?$_GET["origin"]:'';
|
||||
$originid = isset($_GET["originid"])?$_GET["originid"]:'';
|
||||
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
|
||||
if (! $socid && ($_REQUEST["action"] != 'create' && $_REQUEST["action"] != 'add' && $_REQUEST["action"] != 'update')) accessforbidden();
|
||||
|
||||
@ -98,8 +100,16 @@ if ($_POST["action"] == 'add' || $_POST["action"] == 'update')
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
if ($origin == commande)
|
||||
{
|
||||
Header("Location: ../commande/fiche.php?action=editdelivery_adress&socid=".$socid."&id=".$originid);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
Header("Location: adresse_livraison.php?socid=".$socid);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -739,7 +739,7 @@ else
|
||||
print '</td><td colspan="2">';
|
||||
if ($_GET['action'] == 'editdelivery_adress')
|
||||
{
|
||||
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'adresse_livraison_id');
|
||||
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'adresse_livraison_id','commande',$commande->id);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1584,9 +1584,10 @@ class Form
|
||||
* \param page Page
|
||||
* \param selected Id condition présélectionnée
|
||||
* \param htmlname Nom du formulaire select
|
||||
* \param addempty Ajoute entrée vide
|
||||
* \param origin origine de l'appel pour pouvoir créer un retour
|
||||
* \param id id de l'origine
|
||||
*/
|
||||
function form_adresse_livraison($page, $selected='', $socid, $htmlname='adresse_livraison_id')
|
||||
function form_adresse_livraison($page, $selected='', $socid, $htmlname='adresse_livraison_id', $origin='', $id)
|
||||
{
|
||||
global $langs,$conf;
|
||||
if ($htmlname != "none")
|
||||
@ -1602,7 +1603,7 @@ class Form
|
||||
if ($numaddress==0)
|
||||
{
|
||||
$langs->load("companies");
|
||||
print ' <a href='.DOL_DOCUMENT_ROOT .'/comm/adresse_livraison.php?socid='.$socid.'&action=create>'.$langs->trans("AddAddress").'</a>';
|
||||
print ' <a href='.DOL_DOCUMENT_ROOT .'/comm/adresse_livraison.php?socid='.$socid.'&action=create&origin='.$origin.'&originid='.$id.'>'.$langs->trans("AddAddress").'</a>';
|
||||
}
|
||||
print '</td></tr></table></form>';
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user