Skip to content
Snippets Groups Projects
Commit f213b4f5 authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: best autonomy of modules

Fix: uniformise fields and code
!! not stable !!
parent 1959dbb1
Branches
Tags
No related merge requests found
<?php <?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
......
...@@ -52,7 +52,7 @@ $origin_id = isset($_GET["id"])?$_GET["id"]:''; ...@@ -52,7 +52,7 @@ $origin_id = isset($_GET["id"])?$_GET["id"]:'';
$id = $origin_id; $id = $origin_id;
$origin = $_GET["origin"]?$_GET["origin"]:$_POST["origin"]; // Example: commande, propal $origin = $_GET["origin"]?$_GET["origin"]:$_POST["origin"]; // Example: commande, propal
$origin_id = $_GET["object_id"]?$_GET["object_id"]:$_POST["object_id"]; // Id of order or propal $origin_id = $_GET["origin_id"]?$_GET["origin_id"]:$_POST["origin_id"]; // Id of order or propal
// Security check // Security check
...@@ -60,7 +60,6 @@ if ($user->societe_id) $socid=$user->societe_id; ...@@ -60,7 +60,6 @@ if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,$origin,$origin_id,''); $result=restrictedArea($user,$origin,$origin_id,'');
/* /*
* Actions * Actions
*/ */
...@@ -91,6 +90,8 @@ if ($_POST["action"] == 'add') ...@@ -91,6 +90,8 @@ if ($_POST["action"] == 'add')
//$object->fetch_lines(); //$object->fetch_lines();
$expedition->socid = $object->socid; $expedition->socid = $object->socid;
$expedition->ref_customer = $object->ref_client;
$expedition->date_delivery = $object->date_livraison;
$expedition->fk_delivery_address = $object->fk_delivery_address; $expedition->fk_delivery_address = $object->fk_delivery_address;
$expedition->expedition_method_id = $_POST["expedition_method_id"]; $expedition->expedition_method_id = $_POST["expedition_method_id"];
$expedition->tracking_number = $_POST["tracking_number"]; $expedition->tracking_number = $_POST["tracking_number"];
...@@ -278,7 +279,7 @@ if ($_GET["action"] == 'create') ...@@ -278,7 +279,7 @@ if ($_GET["action"] == 'create')
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="origin" value="'.$origin.'">'; print '<input type="hidden" name="origin" value="'.$origin.'">';
print '<input type="hidden" name="object_id" value="'.$object->id.'">'; print '<input type="hidden" name="origin_id" value="'.$object->id.'">';
if ($_GET["entrepot_id"]) if ($_GET["entrepot_id"])
{ {
print '<input type="hidden" name="entrepot_id" value="'.$_GET["entrepot_id"].'">'; print '<input type="hidden" name="entrepot_id" value="'.$_GET["entrepot_id"].'">';
...@@ -315,6 +316,11 @@ if ($_GET["action"] == 'create') ...@@ -315,6 +316,11 @@ if ($_GET["action"] == 'create')
print "<tr><td>".$langs->trans("Date")."</td>"; print "<tr><td>".$langs->trans("Date")."</td>";
print '<td colspan="3">'.dol_print_date($object->date,"day")."</td></tr>\n"; print '<td colspan="3">'.dol_print_date($object->date,"day")."</td></tr>\n";
// Date delivery planned
print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>';
print '<td colspan="3">'.dol_print_date($object->date_livraison,'day')."</td>\n";
print '</tr>';
// Delivery address // Delivery address
if (($origin == 'commande' && $conf->global->COMMANDE_ADD_DELIVERY_ADDRESS) if (($origin == 'commande' && $conf->global->COMMANDE_ADD_DELIVERY_ADDRESS)
|| ($origin == 'propal' && $conf->global->PROPAL_ADD_DELIVERY_ADDRESS)) || ($origin == 'propal' && $conf->global->PROPAL_ADD_DELIVERY_ADDRESS))
......
...@@ -75,14 +75,14 @@ if ($_POST["action"] == 'confirm_cloture' && $_POST["confirm"] == 'yes') ...@@ -75,14 +75,14 @@ if ($_POST["action"] == 'confirm_cloture' && $_POST["confirm"] == 'yes')
} }
// Positionne ref commande client // Positionne ref commande client
if ($_POST['action'] == 'set_ref_client' && $user->rights->commande->creer) if ($_POST['action'] == 'setrefcustomer' && $user->rights->commande->creer)
{ {
$commande = new Commande($db); $commande = new Commande($db);
$commande->fetch($_GET['id']); $commande->fetch($_GET['id']);
$commande->set_ref_client($user, $_POST['ref_client']); $commande->set_ref_client($user, $_POST['ref_customer']);
} }
if ($_POST['action'] == 'setdate_livraison' && $user->rights->commande->creer) if ($_POST['action'] == 'setdatedelivery' && $user->rights->commande->creer)
{ {
//print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year']; //print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
$datelivraison=dol_mktime(0, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']); $datelivraison=dol_mktime(0, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']);
...@@ -96,11 +96,11 @@ if ($_POST['action'] == 'setdate_livraison' && $user->rights->commande->creer) ...@@ -96,11 +96,11 @@ if ($_POST['action'] == 'setdate_livraison' && $user->rights->commande->creer)
} }
} }
if ($_POST['action'] == 'setdeliveryadress' && $user->rights->commande->creer) if ($_POST['action'] == 'setdeliveryaddress' && $user->rights->commande->creer)
{ {
$commande = new Commande($db); $commande = new Commande($db);
$commande->fetch($_GET['id']); $commande->fetch($_GET['id']);
$commande->set_adresse_livraison($user,$_POST['adresse_livraison_id']); $commande->set_adresse_livraison($user,$_POST['delivery_address_id']);
} }
if ($_POST['action'] == 'setmode' && $user->rights->commande->creer) if ($_POST['action'] == 'setmode' && $user->rights->commande->creer)
...@@ -187,8 +187,8 @@ if ($id > 0 || ! empty($ref)) ...@@ -187,8 +187,8 @@ if ($id > 0 || ! empty($ref))
{ {
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">'; print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set_ref_client">'; print '<input type="hidden" name="action" value="setrefcustomer">';
print '<input type="text" class="flat" size="20" name="ref_client" value="'.$commande->ref_client.'">'; print '<input type="text" class="flat" size="20" name="ref_customer" value="'.$commande->ref_client.'">';
print ' <input type="submit" class="button" value="'.$langs->trans('Modify').'">'; print ' <input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>'; print '</form>';
} }
...@@ -261,8 +261,8 @@ if ($id > 0 || ! empty($ref)) ...@@ -261,8 +261,8 @@ if ($id > 0 || ! empty($ref))
{ {
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'" method="post">'; print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="setdate_livraison">'; print '<input type="hidden" name="action" value="setdatedelivery">';
$html->select_date($commande->date_livraison,'liv_','','','',"setdate_livraison"); $html->select_date($commande->date_livraison,'liv_','','','',"setdatedelivery");
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>'; print '</form>';
} }
...@@ -290,7 +290,7 @@ if ($id > 0 || ! empty($ref)) ...@@ -290,7 +290,7 @@ if ($id > 0 || ! empty($ref))
if ($_GET['action'] == 'editdelivery_adress') if ($_GET['action'] == 'editdelivery_adress')
{ {
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->fk_delivery_address,$_GET['socid'],'adresse_livraison_id','commande',$commande->id); $html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->fk_delivery_address,$_GET['socid'],'delivery_address_id','commande',$commande->id);
} }
else else
{ {
...@@ -603,7 +603,7 @@ if ($id > 0 || ! empty($ref)) ...@@ -603,7 +603,7 @@ if ($id > 0 || ! empty($ref))
print '<input type="hidden" name="action" value="create">'; print '<input type="hidden" name="action" value="create">';
print '<input type="hidden" name="id" value="'.$commande->id.'">'; print '<input type="hidden" name="id" value="'.$commande->id.'">';
print '<input type="hidden" name="origin" value="commande">'; print '<input type="hidden" name="origin" value="commande">';
print '<input type="hidden" name="object_id" value="'.$commande->id.'">'; print '<input type="hidden" name="origin_id" value="'.$commande->id.'">';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
$entrepot = new Entrepot($db); $entrepot = new Entrepot($db);
......
...@@ -221,14 +221,14 @@ function show_list_sending_receive($origin='commande',$origin_id,$filter='') ...@@ -221,14 +221,14 @@ function show_list_sending_receive($origin='commande',$origin_id,$filter='')
print '<td align="center">'.$objp->qty_shipped.'</td>'; print '<td align="center">'.$objp->qty_shipped.'</td>';
print '<td align="center" nowrap="nowrap">'.dol_print_date($objp->date_expedition,'dayhour').'</td>'; print '<td align="center" nowrap="nowrap">'.dol_print_date($objp->date_expedition,'day').'</td>';
if ($conf->livraison_bon->enabled) if ($conf->livraison_bon->enabled)
{ {
if ($objp->livraison_id) if ($objp->livraison_id)
{ {
print '<td><a href="'.DOL_URL_ROOT.'/livraison/fiche.php?id='.$objp->livraison_id.'">'.img_object($langs->trans("ShowSending"),'sending').' '.$objp->livraison_ref.'<a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/livraison/fiche.php?id='.$objp->livraison_id.'">'.img_object($langs->trans("ShowSending"),'sending').' '.$objp->livraison_ref.'<a></td>';
print '<td align="center">'.$objp->qty_received.'</td>'; print '<td align="center">'.$objp->qty_received.'</td>';
print '<td>'.dol_print_date($objp->date_delivery,'dayhour').'</td>'; print '<td>'.dol_print_date($objp->date_delivery,'day').'</td>';
} }
else else
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment