29require
'../../../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/product/stock/stocktransfer/class/stocktransfer.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/product/stock/stocktransfer/lib/stocktransfer_stocktransfer.lib.php';
38$langs->loadLangs(array(
'facture',
'orders',
'sendings',
'companies',
'stocks'));
42$lineid =
GETPOST(
'lineid',
'int');
43$action =
GETPOST(
'action',
'alpha');
48if ($id > 0 || !empty($ref)) {
49 $ret = $object->fetch($id, $ref);
51 $langs->load(
"errors");
60 $object->fetch_thirdparty();
62 header(
'Location: '.
dol_buildpath(
'/stocktransfer/stocktransfer_list.php', 1));
68 $socid = $user->socid;
71$result =
restrictedArea($user,
'stocktransfer', $id,
'',
'stocktransfer');
78if ($action ==
'addcontact' && $user->hasRight(
'stocktransfer',
'stocktransfer',
'write')) {
79 if ($object->id > 0) {
81 $result = $object->add_contact($contactid, !empty($_POST[
"typecontact"]) ? $_POST[
"typecontact"] : $_POST[
"type"], $_POST[
"source"]);
85 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".$object->id);
88 if ($object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
89 $langs->load(
"errors");
90 setEventMessages($langs->trans(
"ErrorThisContactIsAlreadyDefinedAsThisType"),
null,
'errors');
95} elseif ($action ==
'swapstatut' && $user->hasRight(
'stocktransfer',
'stocktransfer',
'write')) {
96 if ($object->id > 0) {
97 $result = $object->swapContactStatus(
GETPOST(
'ligne'));
99} elseif ($action ==
'deletecontact' && $user->hasRight(
'stocktransfer',
'stocktransfer',
'write')) {
100 $result = $object->delete_contact($lineid);
103 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".$object->id);
121llxHeader(
'', $langs->trans(
'ModuleStockTransferName'),
'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos');
123$form =
new Form($db);
127if ($object->id > 0) {
129 print
dol_get_fiche_head($head,
'contact', $langs->trans(
"StockTransfer"), -1,
'stock');
134 $linkback =
'<a href="'.DOL_URL_ROOT.
'/comm/propal/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
137 $morehtmlref =
'<div class="refidno">';
139 $morehtmlref .= empty($object->thirdparty) ?
'' : $object->thirdparty->getNomUrl(1,
'customer');
140 if (!
getDolGlobalInt(
'MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
141 $morehtmlref .=
' (<a href="'.DOL_URL_ROOT.
'/commande/list.php?socid='.$object->thirdparty->id.
'&search_societe='.urlencode($object->thirdparty->name).
'">'.$langs->trans(
"OtherOrders").
'</a>)';
144 if (isModEnabled(
'project')) {
145 $langs->load(
"projects");
146 if (!empty($object->fk_project)) {
147 $morehtmlref .=
'<br>';
149 $proj->fetch($object->fk_project);
150 $morehtmlref .= $proj->getNomUrl(1);
152 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
156 $morehtmlref .=
'</div>';
158 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0,
'',
'', 1);
162 $user->rights->stocktransfer->write = $user->rights->stocktransfer->stocktransfer->write;
164 $dirtpls = array_merge($conf->modules_parts[
'tpl'], array(
'/core/tpl'));
165 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 projects.
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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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.
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.
stocktransferPrepareHead($object)
Prepare array of tabs for StockTransfer.