26 require
'../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.
'/reception/class/reception.class.php';
28 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/reception.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
33 if (!empty($conf->projet->enabled)) {
34 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
38 $langs->load(
"orders");
39 $langs->load(
"receptions");
40 $langs->load(
"companies");
44 $action =
GETPOST(
'action',
'aZ09');
47 if ($user->socid) $socid = $user->socid;
51 if ($id > 0 || !empty($ref))
53 $object->fetch($id, $ref);
54 $object->fetch_thirdparty();
56 if (!empty($object->origin))
58 $origin = $object->origin;
60 $object->fetch_origin();
61 $typeobject = $object->origin;
65 if ($origin ==
'order_supplier' && $object->$typeobject->id && !empty($conf->fournisseur->enabled))
68 $objectsrc->fetch($object->$typeobject->id);
77 if ($action ==
'addcontact' && $user->rights->reception->creer)
79 if ($result > 0 && $id > 0)
83 $result = $objectsrc->add_contact($contactid, $typeid,
GETPOST(
"source",
'aZ09'));
88 header(
"Location: ".
$_SERVER[
'PHP_SELF'].
"?id=".$object->id);
91 if ($objectsrc->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS')
93 $langs->load(
"errors");
94 $mesg = $langs->trans(
"ErrorThisContactIsAlreadyDefinedAsThisType");
96 $mesg = $objectsrc->error;
97 $mesgs = $objectsrc->errors;
104 elseif ($action ==
'swapstatut' && $user->rights->reception->creer)
106 $result = $objectsrc->swapContactStatus(
GETPOST(
'ligne'));
110 elseif ($action ==
'deletecontact' && $user->rights->reception->creer)
112 $result = $objectsrc->delete_contact(
GETPOST(
"lineid"));
116 header(
"Location: ".
$_SERVER[
'PHP_SELF'].
"?id=".$object->id);
135 llxHeader(
'', $langs->trans(
'Reception'),
'EN:Customers_Orders|FR:receptions_Clients|ES:Pedidos de clientes');
137 $form =
new Form($db);
140 $contactstatic =
new Contact($db);
141 $userstatic =
new User($db);
150 if ($id > 0 || !empty($ref))
152 $langs->trans(
"OrderCard");
159 $linkback =
'<a href="'.DOL_URL_ROOT.
'/reception/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
161 $morehtmlref =
'<div class="refidno">';
163 $morehtmlref .= $form->editfieldkey(
"RefSupplier",
'', $object->ref_supplier, $object, $user->rights->reception->creer,
'string',
'', 0, 1);
164 $morehtmlref .= $form->editfieldval(
"RefSupplier",
'', $object->ref_supplier, $object, $user->rights->reception->creer,
'string',
'', null, null,
'', 1);
166 $morehtmlref .=
'<br>'.$langs->trans(
'ThirdParty').
' : '.$object->thirdparty->getNomUrl(1);
168 if (!empty($conf->projet->enabled)) {
169 $langs->load(
"projects");
170 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
172 if ($action !=
'classify') {
173 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&id='.$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> : ';
175 if ($action ==
'classify') {
177 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
178 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
179 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
180 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
181 $morehtmlref .=
'<input type="submit" class="button" value="'.$langs->trans(
"Modify").
'">';
182 $morehtmlref .=
'</form>';
184 $morehtmlref .= $form->form_project(
$_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project,
'none', 0, 0, 0, 1);
189 $morehtmlref .=
' : ';
190 if (!empty($objectsrc->fk_project)) {
192 $proj->fetch($objectsrc->fk_project);
193 $morehtmlref .=
'<a href="'.DOL_URL_ROOT.
'/projet/card.php?id='.$objectsrc->fk_project.
'" title="'.$langs->trans(
'ShowProject').
'">';
194 $morehtmlref .= $proj->ref;
195 $morehtmlref .=
'</a>';
201 $morehtmlref .=
'</div>';
203 $object->picto =
'sending';
204 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
207 print '<div class="fichecenter">';
209 print '<div class="underbanner clearboth"></div>';
211 print '<table class="border centpercent">';
213 if ($origin ==
'order_supplier' && $object->$typeobject->id && !empty($conf->fournisseur->enabled))
215 print '<tr><td class="titlefield">';
217 $objectsrc->fetch($object->$typeobject->id);
218 print $langs->trans(
"RefOrder").
'</td>';
219 print '<td colspan="3">';
220 print $objectsrc->getNomUrl(1,
'commande');
224 if ($typeobject ==
'propal' && $object->$typeobject->id && !empty($conf->propal->enabled))
226 print '<tr><td class="titlefield">';
227 $objectsrc =
new Propal($db);
228 $objectsrc->fetch($object->$typeobject->id);
229 print $langs->trans(
"RefProposal").
'</td>';
230 print '<td colspan="3">';
231 print $objectsrc->getNomUrl(1,
'reception');
249 print '<div class="clearboth"></div>';
258 $dirtpls = array_merge($conf->modules_parts[
'tpl'], array(
'/core/tpl'));
259 foreach ($dirtpls as $reldir)
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.
Class to manage Dolibarr users.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
Class to manage projects.
Class to manage receptions.
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.
reception_prepare_head(Reception $object)
Prepare array with list of tabs.
print
Draft customers invoices.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.