27 require
'../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/reception/class/reception.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/reception.lib.php';
31 if (!empty($conf->project->enabled)) {
32 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
36 $langs->loadLangs(array(
"receptions",
"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);
64 $permissionnote = $user->rights->reception->creer;
67 if ($user->socid > 0) {
68 $socid = $user->socid;
73 $hookmanager->initHooks(array(
'receptionnote'));
75 if ($origin ==
'reception') {
78 if ($origin ==
'reception') {
81 if ($origin ==
'supplierorder' || $origin ==
'order_supplier') {
82 $result =
restrictedArea($user,
'fournisseur', $origin_id,
'commande_fournisseur',
'commande');
83 } elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
95 $reshook = $hookmanager->executeHooks(
'doActions', array(), $object, $action);
99 if (empty($reshook)) {
100 include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
112 if ($id > 0 || !empty($ref)) {
114 print
dol_get_fiche_head($head,
'note', $langs->trans(
"Reception"), -1,
'dollyrevert');
118 $linkback =
'<a href="'.DOL_URL_ROOT.
'/reception/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
120 $morehtmlref =
'<div class="refidno">';
122 $morehtmlref .=
$form->editfieldkey(
"RefSupplier",
'', $object->ref_supplier, $object, $user->rights->reception->creer,
'string',
'', 0, 1);
123 $morehtmlref .=
$form->editfieldval(
"RefSupplier",
'', $object->ref_supplier, $object, $user->rights->reception->creer,
'string',
'', null, null,
'', 1);
125 $morehtmlref .=
'<br>'.$langs->trans(
'ThirdParty').
' : '.$object->thirdparty->getNomUrl(1);
127 if (!empty($conf->project->enabled)) {
128 $langs->load(
"projects");
129 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
131 if ($action !=
'classify') {
132 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> : ';
134 if ($action ==
'classify') {
136 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
137 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
138 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
139 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
140 $morehtmlref .=
'<input type="submit" class="button button-edit" value="'.$langs->trans(
"Modify").
'">';
141 $morehtmlref .=
'</form>';
143 $morehtmlref .=
$form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project,
'none', 0, 0, 0, 1);
148 $morehtmlref .=
' : ';
149 if (!empty($objectsrc->fk_project)) {
151 $proj->fetch($objectsrc->fk_project);
152 $morehtmlref .=
' : '.$proj->getNomUrl(1);
154 $morehtmlref .=
' - '.$proj->title;
161 $morehtmlref .=
'</div>';
163 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
166 print
'<div class="underbanner clearboth"></div>';
168 $cssclass =
'titlefield';
169 include DOL_DOCUMENT_ROOT.
'/core/tpl/notes.tpl.php';
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname= '')
Make an include_once using default root and alternate root if it fails.
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
img_edit($titlealt= 'default', $float=0, $other= '')
Show logo editer/modifier fiche.
if($cancel &&!$id) if($action== 'add'&&!$cancel) if($action== 'delete') if($id) $form
Actions.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
Class to manage projects.
Class to manage receptions.
Class to manage customers orders.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
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.
reception_prepare_head(Reception $object)
Prepare array with list of tabs.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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.
Class to manage proposals.