diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php
index 65a44cb64f9..80ceb1e8bd5 100644
--- a/htdocs/expedition/contact.php
+++ b/htdocs/expedition/contact.php
@@ -29,6 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
+if (! empty($conf->projet->enabled)) {
+ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
+ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
+}
$langs->load("orders");
$langs->load("sendings");
@@ -165,11 +169,10 @@ if ($id > 0 || ! empty($ref))
// Thirdparty
$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
- /*
if (! empty($conf->projet->enabled)) {
$langs->load("projects");
$morehtmlref .= '
' . $langs->trans('Project') . ' ';
- if ($user->rights->supplier_proposal->creer) {
+ if (0) { // Do not change on shipment
if ($action != 'classify') {
$morehtmlref .= '' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
}
@@ -185,17 +188,20 @@ if ($id > 0 || ! empty($ref))
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
- if (! empty($object->fk_project)) {
+ // We don't have project on shipment, so we will use the project or source object instead
+ // TODO Add project on shipment
+ $morehtmlref .= ' : ';
+ if (! empty($objectsrc->fk_project)) {
$proj = new Project($db);
- $proj->fetch($object->fk_project);
- $morehtmlref .= '';
+ $proj->fetch($objectsrc->fk_project);
+ $morehtmlref .= '';
$morehtmlref .= $proj->ref;
$morehtmlref .= '';
} else {
$morehtmlref .= '';
}
}
- }*/
+ }
$morehtmlref.='';
diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php
index 849ec6e66bc..031ba85322e 100644
--- a/htdocs/expedition/note.php
+++ b/htdocs/expedition/note.php
@@ -27,6 +27,10 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php';
+if (! empty($conf->projet->enabled)) {
+ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
+ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
+}
$langs->load("sendings");
$langs->load("companies");
@@ -110,37 +114,39 @@ if ($id > 0 || ! empty($ref))
// Thirdparty
$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
- /*
- if (! empty($conf->projet->enabled)) {
- $langs->load("projects");
- $morehtmlref .= '
' . $langs->trans('Project') . ' ';
- if ($user->rights->supplier_proposal->creer) {
- if ($action != 'classify') {
- $morehtmlref .= '' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
- }
- if ($action == 'classify') {
- // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
- $morehtmlref .= '