27require
'../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/expedition/class/expedition.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/sendings.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
33if (isModEnabled(
'project')) {
34 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
39$langs->loadLangs(array(
'orders',
'sendings',
'companies'));
43$action =
GETPOST(
'action',
'aZ09');
46if ($id > 0 || !empty($ref)) {
47 $object->fetch($id, $ref);
48 $object->fetch_thirdparty();
50 if (!empty($object->origin)) {
51 $typeobject = $object->origin;
52 $origin = $object->origin;
53 $object->fetch_origin();
57 if ($typeobject ==
'commande' && $object->$typeobject->id && isModEnabled(
'commande')) {
59 $objectsrc->fetch($object->$typeobject->id);
61 if ($typeobject ==
'propal' && $object->$typeobject->id && isModEnabled(
"propal")) {
62 $objectsrc =
new Propal($db);
63 $objectsrc->fetch($object->$typeobject->id);
69 $socid = $user->socid;
78if ($action ==
'addcontact' && $user->rights->expedition->creer) {
79 if ($result > 0 && $id > 0) {
82 $result = $objectsrc->add_contact($contactid, $typeid,
GETPOST(
"source",
'aZ09'));
86 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".$object->id);
89 if ($objectsrc->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
90 $langs->load(
"errors");
91 $mesg = $langs->trans(
"ErrorThisContactIsAlreadyDefinedAsThisType");
93 $mesg = $objectsrc->error;
94 $mesgs = $objectsrc->errors;
98} elseif ($action ==
'swapstatut' && $user->rights->expedition->creer) {
100 $result = $objectsrc->swapContactStatus(
GETPOST(
'ligne',
'int'));
101} elseif ($action ==
'deletecontact' && $user->rights->expedition->creer) {
103 $result = $objectsrc->delete_contact(
GETPOST(
"lineid",
'int'));
106 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".$object->id);
119$help_url =
'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones|DE:Modul_Lieferungen';
121llxHeader(
'', $langs->trans(
'Order'), $help_url);
123$form =
new Form($db);
126$contactstatic =
new Contact($db);
127$userstatic =
new User($db);
136if ($id > 0 || !empty($ref)) {
137 $langs->trans(
"OrderCard");
140 print
dol_get_fiche_head($head,
'contact', $langs->trans(
"Shipment"), -1, $object->picto);
144 $linkback =
'<a href="'.DOL_URL_ROOT.
'/expedition/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
146 $morehtmlref =
'<div class="refidno">';
148 $morehtmlref .= $form->editfieldkey(
"RefCustomer",
'', $object->ref_customer, $object, $user->rights->expedition->creer,
'string',
'', 0, 1);
149 $morehtmlref .= $form->editfieldval(
"RefCustomer",
'', $object->ref_customer, $object, $user->rights->expedition->creer,
'string',
'',
null,
null,
'', 1);
151 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1);
153 if (isModEnabled(
'project')) {
154 $langs->load(
"projects");
155 $morehtmlref .=
'<br>';
157 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
158 if ($action !=
'classify') {
159 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.newToken().
'&id='.$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
161 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $objectsrc->socid, $objectsrc->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
163 if (!empty($objectsrc) && !empty($objectsrc->fk_project)) {
165 $proj->fetch($objectsrc->fk_project);
166 $morehtmlref .= $proj->getNomUrl(1);
168 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
173 $morehtmlref .=
'</div>';
176 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
179 print
'<div class="fichecenter">';
181 print
'<div class="underbanner clearboth"></div>';
183 print
'<table class="border centpercent tableforfield">';
186 if ($typeobject ==
'commande' && $object->$typeobject->id && isModEnabled(
'commande')) {
187 print
'<tr><td class="titlefield">';
189 $objectsrc->fetch($object->$typeobject->id);
190 print $langs->trans(
"RefOrder").
'</td>';
191 print
'<td colspan="3">';
192 print $objectsrc->getNomUrl(1,
'commande');
196 if ($typeobject ==
'propal' && $object->$typeobject->id && isModEnabled(
"propal")) {
197 print
'<tr><td class="titlefield">';
198 $objectsrc =
new Propal($db);
199 $objectsrc->fetch($object->$typeobject->id);
200 print $langs->trans(
"RefProposal").
'</td>';
201 print
'<td colspan="3">';
202 print $objectsrc->getNomUrl(1,
'expedition');
218 print
'<div class="clearboth"></div>';
227 $dirtpls = array_merge($conf->modules_parts[
'tpl'], array(
'/core/tpl'));
228 $preselectedtypeofcontact =
dol_getIdFromCode($db,
'SHIPPING',
'c_type_contact',
'code',
'rowid');
229 foreach ($dirtpls as $reldir) {
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage customers orders.
Class to manage shipments.
Class to manage projects.
Class to manage proposals.
Class to manage Dolibarr users.
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.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='')
Return an id or code from a code or id.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
restrictedArea(User $user, $features, $object=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.
shipping_prepare_head($object)
Prepare array with list of tabs.