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");
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if($cancel &&!$id) if($action== 'add'&&!$cancel) if($action== 'delete') if($id) $form
Actions.
dol_now($mode= 'auto')
Return date for now.
Class to manage Dolibarr users.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save"&&empty($cancel)) $help_url
View.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
ordersupplier_prepare_head(CommandeFournisseur $object)
Prepare array with list of tabs.
Class to manage projects.
Class to manage predefined suppliers products.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
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.