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->projet->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');
43 if ($user->socid) $socid = $user->socid;
44 $result =
restrictedArea($user,
'fournisseur', $id,
'commande_fournisseur',
'commande');
47 $object->fetch($id, $ref);
49 $permissionnote = $user->rights->fournisseur->commande->creer;
56 include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
62 $help_url =
'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores';
63 llxHeader(
'', $langs->trans(
"Order"), $help_url);
65 $form =
new Form($db);
75 if ($id > 0 || !empty($ref))
79 $object->fetch_thirdparty();
81 $author =
new User($db);
82 $author->fetch($object->user_author_id);
86 $title = $langs->trans(
"SupplierOrder");
91 $linkback =
'<a href="'.DOL_URL_ROOT.
'/fourn/commande/list.php'.(!empty($socid) ?
'?socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
93 $morehtmlref =
'<div class="refidno">';
95 $morehtmlref .= $form->editfieldkey(
"RefSupplier",
'ref_supplier', $object->ref_supplier, $object, 0,
'string',
'', 0, 1);
96 $morehtmlref .= $form->editfieldval(
"RefSupplier",
'ref_supplier', $object->ref_supplier, $object, 0,
'string',
'', null, null,
'', 1);
98 $morehtmlref .=
'<br>'.$langs->trans(
'ThirdParty').
' : '.$object->thirdparty->getNomUrl(1);
100 if (!empty($conf->projet->enabled))
102 $langs->load(
"projects");
103 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
104 if ($user->rights->fournisseur->commande->creer)
106 if ($action !=
'classify') {
108 $morehtmlref .=
' : ';
110 if ($action ==
'classify') {
112 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
113 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
114 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
115 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
116 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
117 $morehtmlref .=
'</form>';
119 $morehtmlref .= $form->form_project(
$_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project,
'none', 0, 0, 0, 1);
122 if (!empty($object->fk_project)) {
124 $proj->fetch($object->fk_project);
125 $morehtmlref .=
'<a href="'.DOL_URL_ROOT.
'/projet/card.php?id='.$object->fk_project.
'" title="'.$langs->trans(
'ShowProject').
'">';
126 $morehtmlref .= $proj->ref;
127 $morehtmlref .=
'</a>';
133 $morehtmlref .=
'</div>';
135 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
138 print '<div class="fichecenter">';
139 print '<div class="underbanner clearboth"></div>';
142 $cssclass =
"titlefield";
143 include DOL_DOCUMENT_ROOT.
'/core/tpl/notes.tpl.php';
150 $langs->load(
"errors");
151 print $langs->trans(
"ErrorRecordNotFound");
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
ordersupplier_prepare_head($object)
Prepare array with list of tabs.
dol_now($mode= 'auto')
Return date for now.
Class to manage Dolibarr users.
Class to manage projects.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
Class to manage predefined suppliers products.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_banner_tab($object, $paramid, $morehtml= '', $shownav=1, $fieldid= 'rowid', $fieldref= 'ref', $morehtmlref= '', $moreparam= '', $nodbprefix=0, $morehtmlleft= '', $morehtmlstatus= '', $onlybanner=0, $morehtmlright= '')
Show tab footer of a card.