28require
'../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/expedition/class/expedition.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/sendings.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
34if (isModEnabled(
'project')) {
35 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
40$langs->loadLangs(array(
'orders',
'sendings',
'companies'));
44$action =
GETPOST(
'action',
'aZ09');
47if ($id > 0 || !empty($ref)) {
48 $object->fetch($id, $ref);
49 $object->fetch_thirdparty();
51 if (!empty($object->origin)) {
52 $typeobject = $object->origin;
53 $origin = $object->origin;
54 $object->fetch_origin();
58 if ($typeobject ==
'commande' && $object->$typeobject->id && isModEnabled(
'commande')) {
60 $objectsrc->fetch($object->$typeobject->id);
62 if ($typeobject ==
'propal' && $object->$typeobject->id && isModEnabled(
"propal")) {
63 $objectsrc =
new Propal($db);
64 $objectsrc->fetch($object->$typeobject->id);
70 $socid = $user->socid;
73$hookmanager->initHooks(array(
'shipmentcontactcard',
'globalcard'));
79$parameters = array(
'id'=>$id);
80$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
86 if ($action ==
'addcontact' && $user->hasRight(
'expedition',
'creer')) {
87 if ($result > 0 && $id > 0) {
90 $result = $objectsrc->add_contact($contactid, $typeid,
GETPOST(
"source",
'aZ09'));
94 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".$object->id);
97 if ($objectsrc->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
98 $langs->load(
"errors");
99 $mesg = $langs->trans(
"ErrorThisContactIsAlreadyDefinedAsThisType");
101 $mesg = $objectsrc->error;
102 $mesgs = $objectsrc->errors;
106 } elseif ($action ==
'swapstatut' && $user->hasRight(
'expedition',
'creer')) {
108 $result = $objectsrc->swapContactStatus(
GETPOST(
'ligne',
'int'));
109 } elseif ($action ==
'deletecontact' && $user->hasRight(
'expedition',
'creer')) {
111 $result = $objectsrc->delete_contact(
GETPOST(
"lineid",
'int'));
114 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".$object->id);
127$help_url =
'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones|DE:Modul_Lieferungen';
129llxHeader(
'', $langs->trans(
'Order'), $help_url);
131$form =
new Form($db);
134$contactstatic =
new Contact($db);
135$userstatic =
new User($db);
144if ($id > 0 || !empty($ref)) {
145 $langs->trans(
"OrderCard");
148 print
dol_get_fiche_head($head,
'contact', $langs->trans(
"Shipment"), -1, $object->picto);
152 $linkback =
'<a href="'.DOL_URL_ROOT.
'/expedition/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
154 $morehtmlref =
'<div class="refidno">';
156 $morehtmlref .= $form->editfieldkey(
"RefCustomer",
'', $object->ref_customer, $object, $user->hasRight(
'expedition',
'creer'),
'string',
'', 0, 1);
157 $morehtmlref .= $form->editfieldval(
"RefCustomer",
'', $object->ref_customer, $object, $user->hasRight(
'expedition',
'creer'),
'string',
'',
null,
null,
'', 1);
159 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1);
161 if (isModEnabled(
'project')) {
162 $langs->load(
"projects");
163 $morehtmlref .=
'<br>';
165 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
166 if ($action !=
'classify') {
167 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.newToken().
'&id='.$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
169 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $objectsrc->socid, $objectsrc->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
171 if (!empty($objectsrc) && !empty($objectsrc->fk_project)) {
173 $proj->fetch($objectsrc->fk_project);
174 $morehtmlref .= $proj->getNomUrl(1);
176 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
181 $morehtmlref .=
'</div>';
184 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
187 print
'<div class="fichecenter">';
189 print
'<div class="underbanner clearboth"></div>';
191 print
'<table class="border centpercent tableforfield">';
194 if ($typeobject ==
'commande' && $object->$typeobject->id && isModEnabled(
'commande')) {
195 print
'<tr><td class="titlefield">';
197 $objectsrc->fetch($object->$typeobject->id);
198 print $langs->trans(
"RefOrder").
'</td>';
199 print
'<td colspan="3">';
200 print $objectsrc->getNomUrl(1,
'commande');
204 if ($typeobject ==
'propal' && $object->$typeobject->id && isModEnabled(
"propal")) {
205 print
'<tr><td class="titlefield">';
206 $objectsrc =
new Propal($db);
207 $objectsrc->fetch($object->$typeobject->id);
208 print $langs->trans(
"RefProposal").
'</td>';
209 print
'<td colspan="3">';
210 print $objectsrc->getNomUrl(1,
'expedition');
226 print
'<div class="clearboth"></div>';
235 $dirtpls = array_merge($conf->modules_parts[
'tpl'], array(
'/core/tpl'));
236 $preselectedtypeofcontact =
dol_getIdFromCode($db,
'SHIPPING',
'c_type_contact',
'code',
'rowid');
237 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.