Fix regression
This commit is contained in:
parent
8578a7cd7c
commit
6c1f60f6c0
@ -51,7 +51,6 @@ function shipping_prepare_head($object)
|
|||||||
{
|
{
|
||||||
// delivery link
|
// delivery link
|
||||||
$object->fetchObjectLinked($object->id, $object->element);
|
$object->fetchObjectLinked($object->id, $object->element);
|
||||||
var_dump($object->id);
|
|
||||||
if (is_array($object->linkedObjectsIds['delivery']) && count($object->linkedObjectsIds['delivery']) > 0) // If there is a delivery
|
if (is_array($object->linkedObjectsIds['delivery']) && count($object->linkedObjectsIds['delivery']) > 0) // If there is a delivery
|
||||||
{
|
{
|
||||||
// Take first one element of array
|
// Take first one element of array
|
||||||
@ -158,11 +157,21 @@ function delivery_prepare_head($object)
|
|||||||
$tmpobject = $object;
|
$tmpobject = $object;
|
||||||
}
|
}
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$tmpobject->id;
|
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
|
||||||
$head[$h][1] = $langs->trans("ContactsAddresses");
|
{
|
||||||
$head[$h][2] = 'contact';
|
$objectsrc = $tmpobject;
|
||||||
$h++;
|
if ($tmpobject->origin == 'commande' && $tmpobject->origin_id > 0)
|
||||||
|
{
|
||||||
|
$objectsrc = new Commande($db);
|
||||||
|
$objectsrc->fetch($tmpobject->origin_id);
|
||||||
|
}
|
||||||
|
$nbContact = count($objectsrc->liste_contact(-1, 'internal')) + count($objectsrc->liste_contact(-1, 'external'));
|
||||||
|
$head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$tmpobject->id;
|
||||||
|
$head[$h][1] = $langs->trans("ContactsAddresses");
|
||||||
|
if ($nbContact > 0) $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbContact.'</span>';
|
||||||
|
$head[$h][2] = 'contact';
|
||||||
|
$h++;
|
||||||
|
}
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||||
|
|||||||
@ -57,7 +57,7 @@ $backtopage = GETPOST('backtopage', 'alpha');
|
|||||||
// Security check
|
// Security check
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
if ($user->socid) $socid = $user->socid;
|
if ($user->socid) $socid = $user->socid;
|
||||||
$result = restrictedArea($user, 'expedition', $id, 'delivery', 'livraison');
|
$result = restrictedArea($user, 'expedition', $id, 'delivery', 'delivery');
|
||||||
|
|
||||||
$object = new Delivery($db);
|
$object = new Delivery($db);
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
@ -87,13 +87,14 @@ if ($action == 'add')
|
|||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$object->date_livraison = time();
|
$object->date_livraison = time();
|
||||||
$object->note = $_POST["note"];
|
$object->note = GETPOST("note", 'restricthtml');
|
||||||
$object->commande_id = $_POST["commande_id"];
|
$object->note_private = GETPOST("note", 'restricthtml');
|
||||||
|
$object->commande_id = GETPOST("commande_id", 'int');
|
||||||
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
||||||
|
|
||||||
if (!$conf->expedition_bon->enabled && !empty($conf->stock->enabled))
|
if (!$conf->expedition_bon->enabled && !empty($conf->stock->enabled))
|
||||||
{
|
{
|
||||||
$expedition->entrepot_id = $_POST["entrepot_id"];
|
$expedition->entrepot_id = GETPOST('entrepot_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
// On boucle sur chaque ligne de commande pour completer objet livraison
|
// On boucle sur chaque ligne de commande pour completer objet livraison
|
||||||
@ -276,7 +277,6 @@ if ($action == 'create') // Create. Seems to no be used
|
|||||||
|
|
||||||
$head = delivery_prepare_head($object);
|
$head = delivery_prepare_head($object);
|
||||||
|
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="update_extras_line">';
|
print '<input type="hidden" name="action" value="update_extras_line">';
|
||||||
@ -364,7 +364,7 @@ if ($action == 'create') // Create. Seems to no be used
|
|||||||
}
|
}
|
||||||
$morehtmlref .= '</div>';
|
$morehtmlref .= '</div>';
|
||||||
|
|
||||||
$morehtmlright = $langs->trans("StatusReceipt").' : '.$object->getLibStatut(6).'<br>';
|
$morehtmlright = $langs->trans("StatusReceipt").' : '.$object->getLibStatut(6).'<br><br class="small">';
|
||||||
|
|
||||||
dol_banner_tab($expedition, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
|
dol_banner_tab($expedition, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
|
||||||
|
|
||||||
|
|||||||
@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/commonincoterm.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||||
if (!empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
if (!empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||||
if (!empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
if (!empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||||
@ -39,6 +40,8 @@ if (!empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/
|
|||||||
*/
|
*/
|
||||||
class Delivery extends CommonObject
|
class Delivery extends CommonObject
|
||||||
{
|
{
|
||||||
|
use CommonIncoterm;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string ID to identify managed object
|
* @var string ID to identify managed object
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user