28 require
'../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/expedition/class/expedition.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/sendings.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
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');
47 if ($id > 0 || !empty($ref)) {
60 $objectsrc->fetch(
$object->origin_object->id);
63 $objectsrc =
new Propal($db);
64 $objectsrc->fetch(
$object->origin_object->id);
70 $socid = $user->socid;
73 $hookmanager->initHooks(array(
'shipmentcontactcard',
'globalcard'));
79 $parameters = array(
'id'=>$id);
80 $reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
85 if (empty($reshook)) {
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(
GETPOSTINT(
'ligne'));
109 } elseif ($action ==
'deletecontact' && $user->hasRight(
'expedition',
'creer')) {
111 $result = $objectsrc->delete_contact(
GETPOSTINT(
"lineid"));
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';
129 llxHeader(
'', $langs->trans(
'Order'), $help_url);
131 $form =
new Form($db);
134 $contactstatic =
new Contact($db);
135 $userstatic =
new User($db);
144 if ($id > 0 || !empty($ref)) {
145 $langs->trans(
"OrderCard");
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);
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">';
195 print
'<tr><td class="titlefield">';
197 $objectsrc->fetch(
$object->origin_object->id);
198 print $langs->trans(
"RefOrder").
'</td>';
199 print
'<td colspan="3">';
200 print $objectsrc->getNomUrl(1,
'commande');
205 print
'<tr><td class="titlefield">';
206 $objectsrc =
new Propal($db);
207 $objectsrc->fetch(
$object->origin_object->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($user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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_get_fiche_end($notab=0)
Return tab footer of a card.
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='')
Return an id or code from a code or id.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
isModEnabled($module)
Is Dolibarr module enabled.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify 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.