28 require
'../../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/fourn.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
31 if (!empty($conf->project->enabled)) {
32 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
36 $langs->loadLangs(array(
"suppliers",
"orders",
"companies",
"stocks"));
40 $action =
GETPOST(
'action',
'aZ09');
44 $socid = $user->socid;
47 $hookmanager->initHooks(array(
'ordersuppliercardnote'));
48 $result =
restrictedArea($user,
'fournisseur', $id,
'commande_fournisseur',
'commande');
51 $object->fetch($id, $ref);
53 $permissionnote = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
60 $reshook = $hookmanager->executeHooks(
'doActions', array(), $object, $action);
64 if (empty($reshook)) {
65 include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
72 $title = $langs->trans(
'SupplierOrder').
" - ".$langs->trans(
'Notes');
73 $help_url =
'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores';
86 if ($id > 0 || !empty($ref)) {
88 $object->fetch_thirdparty();
90 $author =
new User($db);
91 $author->fetch($object->user_author_id);
95 $title = $langs->trans(
"SupplierOrder");
100 $linkback =
'<a href="'.DOL_URL_ROOT.
'/fourn/commande/list.php'.(!empty($socid) ?
'?socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
102 $morehtmlref =
'<div class="refidno">';
104 $morehtmlref .=
$form->editfieldkey(
"RefSupplier",
'ref_supplier', $object->ref_supplier, $object, 0,
'string',
'', 0, 1);
105 $morehtmlref .=
$form->editfieldval(
"RefSupplier",
'ref_supplier', $object->ref_supplier, $object, 0,
'string',
'',
null,
null,
'', 1);
107 $morehtmlref .=
'<br>'.$langs->trans(
'ThirdParty').
' : '.$object->thirdparty->getNomUrl(1);
109 if (!empty($conf->project->enabled)) {
110 $langs->load(
"projects");
111 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
112 if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) {
113 if ($action !=
'classify') {
115 $morehtmlref .=
' : ';
117 if ($action ==
'classify') {
119 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
120 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
121 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
122 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
123 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
124 $morehtmlref .=
'</form>';
126 $morehtmlref .=
$form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project,
'none', 0, 0, 0, 1);
129 if (!empty($object->fk_project)) {
131 $proj->fetch($object->fk_project);
132 $morehtmlref .=
' : '.$proj->getNomUrl(1);
134 $morehtmlref .=
' - '.$proj->title;
141 $morehtmlref .=
'</div>';
143 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
146 print
'<div class="fichecenter">';
147 print
'<div class="underbanner clearboth"></div>';
150 $cssclass =
"titlefield";
151 include DOL_DOCUMENT_ROOT.
'/core/tpl/notes.tpl.php';
158 $langs->load(
"errors");
159 print $langs->trans(
"ErrorRecordNotFound");