27 require
'../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/expedition/class/expedition.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/sendings.lib.php';
30 if (!empty($conf->project->enabled)) {
31 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
36 $langs->loadLangs(array(
'sendings',
'companies',
'bills',
'deliveries',
'orders',
'stocks',
'other',
'propal'));
40 $action =
GETPOST(
'action',
'aZ09');
43 if ($id > 0 || !empty($ref)) {
44 $object->fetch($id, $ref);
45 $object->fetch_thirdparty();
47 if (!empty($object->origin)) {
48 $typeobject = $object->origin;
49 $origin = $object->origin;
50 $object->fetch_origin();
54 if ($typeobject ==
'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) {
56 $objectsrc->fetch($object->$typeobject->id);
58 if ($typeobject ==
'propal' && $object->$typeobject->id && !empty($conf->propal->enabled)) {
59 $objectsrc =
new Propal($db);
60 $objectsrc->fetch($object->$typeobject->id);
66 $permissionnote = $user->rights->expedition->creer;
70 $socid = $user->socid;
73 $hookmanager->initHooks(array(
'expeditionnote'));
81 $reshook = $hookmanager->executeHooks(
'doActions', array(), $object, $action);
85 if (empty($reshook)) {
86 include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
98 if ($id > 0 || !empty($ref)) {
100 print
dol_get_fiche_head($head,
'note', $langs->trans(
"Shipment"), -1, $object->picto);
104 $linkback =
'<a href="'.DOL_URL_ROOT.
'/expedition/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
106 $morehtmlref =
'<div class="refidno">';
108 $morehtmlref .=
$form->editfieldkey(
"RefCustomer",
'', $object->ref_customer, $object, $user->rights->expedition->creer,
'string',
'', 0, 1);
109 $morehtmlref .=
$form->editfieldval(
"RefCustomer",
'', $object->ref_customer, $object, $user->rights->expedition->creer,
'string',
'',
null,
null,
'', 1);
111 $morehtmlref .=
'<br>'.$langs->trans(
'ThirdParty').
' : '.$object->thirdparty->getNomUrl(1);
113 if (!empty($conf->project->enabled)) {
114 $langs->load(
"projects");
115 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
117 if ($action !=
'classify') {
118 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> : ';
120 if ($action ==
'classify') {
122 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
123 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
124 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
125 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
126 $morehtmlref .=
'<input type="submit" class="button button-edit" value="'.$langs->trans(
"Modify").
'">';
127 $morehtmlref .=
'</form>';
129 $morehtmlref .=
$form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project,
'none', 0, 0, 0, 1);
134 $morehtmlref .=
' : ';
135 if (!empty($objectsrc->fk_project)) {
137 $proj->fetch($objectsrc->fk_project);
138 $morehtmlref .=
' : '.$proj->getNomUrl(1);
140 $morehtmlref .=
' - '.$proj->title;
147 $morehtmlref .=
'</div>';
150 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
153 print
'<div class="underbanner clearboth"></div>';
155 $cssclass =
'titlefield';
156 include DOL_DOCUMENT_ROOT.
'/core/tpl/notes.tpl.php';