31require
'../../../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/product/stock/stocktransfer/class/stocktransfer.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/product/stock/stocktransfer/lib/stocktransfer_stocktransfer.lib.php';
48$langs->loadLangs(array(
'facture',
'orders',
'sendings',
'companies',
'stocks'));
54$action =
GETPOST(
'action',
'alpha');
61if ($id > 0 || !empty($ref)) {
62 $ret =
$object->fetch($id, $ref);
64 $langs->load(
"errors");
75 header(
'Location: '.
dol_buildpath(
'/stocktransfer/stocktransfer_list.php', 1));
81 $socid = $user->socid;
85$permissiontoread = $user->hasRight(
'stocktransfer',
'stocktransfer',
'read');
86$permissiontoadd = $user->hasRight(
'stocktransfer',
'stocktransfer',
'write');
87$permissionnote = $user->hasRight(
'stocktransfer',
'stocktransfer',
'write');
88$permissiontodelete = $user->rights->stocktransfer->stocktransfer->delete || ($permissiontoadd && isset(
$object->status) &&
$object->status < $object::STATUS_TRANSFERED);
89$permissiondellink = $user->hasRight(
'stocktransfer',
'stocktransfer',
'write');
90$upload_dir =
$conf->stocktransfer->multidir_output[isset(
$object->entity) ?
$object->entity : 1];
99if (!$permissiontoread || ($action ===
'create' && !$permissiontoadd)) {
108if ($action ==
'addcontact' && $user->hasRight(
'stocktransfer',
'stocktransfer',
'write')) {
116 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".
$object->id);
119 if (
$object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
120 $langs->load(
"errors");
121 setEventMessages($langs->trans(
"ErrorThisContactIsAlreadyDefinedAsThisType"),
null,
'errors');
126} elseif ($action ==
'swapstatut' && $user->hasRight(
'stocktransfer',
'stocktransfer',
'write')) {
130} elseif ($action ==
'deletecontact' && $user->hasRight(
'stocktransfer',
'stocktransfer',
'write')) {
131 $result =
$object->delete_contact($lineid);
134 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".
$object->id);
146llxHeader(
'', $langs->trans(
'ModuleStockTransferName'),
'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos');
154 print
dol_get_fiche_head($head,
'contact', $langs->trans(
"StockTransfer"), -1,
'stock');
159 $linkback =
'<a href="'.DOL_URL_ROOT.
'/comm/propal/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
162 $morehtmlref =
'<div class="refidno">';
164 $morehtmlref .= empty(
$object->thirdparty) ?
'' :
$object->thirdparty->getNomUrl(1,
'customer');
166 $morehtmlref .=
' (<a href="'.DOL_URL_ROOT.
'/commande/list.php?socid='.
$object->thirdparty->id.
'">'.$langs->trans(
"OtherOrders").
'</a>)';
170 $langs->load(
"projects");
171 if (!empty(
$object->fk_project)) {
172 $morehtmlref .=
'<br>';
174 $proj->fetch(
$object->fk_project);
175 $morehtmlref .= $proj->getNomUrl(1);
177 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
181 $morehtmlref .=
'</div>';
183 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0,
'',
'', 1);
187 $user->rights->stocktransfer->write = $user->hasRight(
'stocktransfer',
'stocktransfer',
'write');
189 $dirtpls = array_merge(
$conf->modules_parts[
'tpl'], array(
'/core/tpl'));
190 foreach ($dirtpls as $reldir) {
192 if (file_exists($file)) {
193 $res = @include $file;
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage projects.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
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, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
stocktransferPrepareHead($object)
Prepare array of tabs for StockTransfer.