Fix link to warehouses for events
This commit is contained in:
parent
de447d88d7
commit
e51aa68284
@ -631,6 +631,7 @@ if ($resql)
|
||||
// Linked object
|
||||
if (! empty($arrayfields['a.fk_element']['checked'])) {
|
||||
print '<td>';
|
||||
//var_dump($obj->fkelement.' '.$obj->elementtype);
|
||||
if ($obj->fk_element > 0 && ! empty($obj->elementtype)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
print dolGetElementUrl($obj->fk_element,$obj->elementtype,1);
|
||||
|
||||
@ -601,7 +601,7 @@ class FormFile
|
||||
$modellist=call_user_func($class.'::liste_modeles',$this->db);
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
dol_print_error($this->db,'Bad value for modulepart');
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1830,6 +1830,11 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='')
|
||||
$module='projet';
|
||||
$subelement='task';
|
||||
}
|
||||
if ($objecttype == 'stock') {
|
||||
$classpath = 'product/stock/class';
|
||||
$module='stock';
|
||||
$subelement='stock';
|
||||
}
|
||||
|
||||
//print "objecttype=".$objecttype." module=".$module." subelement=".$subelement;
|
||||
|
||||
@ -1840,22 +1845,30 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='')
|
||||
$classpath = 'fourn/class';
|
||||
$module='fournisseur';
|
||||
}
|
||||
if ($objecttype == 'order_supplier') {
|
||||
elseif ($objecttype == 'order_supplier') {
|
||||
$classfile = 'fournisseur.commande';
|
||||
$classname='CommandeFournisseur';
|
||||
$classpath = 'fourn/class';
|
||||
$module='fournisseur';
|
||||
}
|
||||
|
||||
elseif ($objecttype == 'stock') {
|
||||
$classpath = 'product/stock/class';
|
||||
$classfile='entrepot';
|
||||
$classname='Entrepot';
|
||||
}
|
||||
if (! empty($conf->$module->enabled))
|
||||
{
|
||||
$res=dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
|
||||
if ($res)
|
||||
{
|
||||
$object = new $classname($db);
|
||||
$res=$object->fetch($objectid);
|
||||
if ($res > 0) $ret=$object->getNomUrl($withpicto,$option);
|
||||
unset($object);
|
||||
if (class_exists($classname))
|
||||
{
|
||||
$object = new $classname($db);
|
||||
$res=$object->fetch($objectid);
|
||||
if ($res > 0) $ret=$object->getNomUrl($withpicto,$option);
|
||||
unset($object);
|
||||
}
|
||||
else dol_syslog("Class with classname ".$classname." is unknown even after the include", LOG_ERR);
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
|
||||
@ -1,9 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||
/* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -23,10 +19,9 @@
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
|
||||
|
||||
/**
|
||||
* \class ModeleStock
|
||||
* \brief Parent class for stock models of doc generators
|
||||
* Parent class for stock models of doc generators
|
||||
*/
|
||||
abstract class ModeleStock extends CommonDocGenerator
|
||||
abstract class ModelePDFStock extends CommonDocGenerator
|
||||
{
|
||||
var $error='';
|
||||
|
||||
|
||||
@ -2165,8 +2165,6 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete')
|
||||
$genallowed=$usercanread;
|
||||
$delallowed=$usercancreate;
|
||||
|
||||
$var=true;
|
||||
|
||||
print $formfile->showdocuments($modulepart,$object->ref,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang, '', $object);
|
||||
$somethingshown=$formfile->numoffiles;
|
||||
|
||||
|
||||
@ -117,7 +117,7 @@ if ($action == 'add' && $user->rights->stock->creer)
|
||||
// Delete warehouse
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->stock->supprimer)
|
||||
{
|
||||
$object->fetch($_REQUEST["id"]);
|
||||
$object->fetch(GETPOST('id','int'));
|
||||
$result=$object->delete($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
@ -169,9 +169,17 @@ if ($cancel == $langs->trans("Cancel"))
|
||||
$action = '';
|
||||
}
|
||||
|
||||
|
||||
// Actions to build doc
|
||||
$upload_dir = $conf->stock->dir_output;
|
||||
$permissioncreate = $user->rights->stock->creer;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
|
||||
|
||||
/*
|
||||
* Build document
|
||||
*/
|
||||
/*
|
||||
if ($action == 'builddoc') // En get ou en post
|
||||
{
|
||||
if ($id > 0 || $ref)
|
||||
@ -185,7 +193,7 @@ if ($action == 'builddoc') // En get ou en post
|
||||
}
|
||||
}
|
||||
|
||||
// Save last template used to generate document
|
||||
// Save last template used to generate document
|
||||
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
|
||||
|
||||
// Define output language
|
||||
@ -218,7 +226,7 @@ elseif ($action == 'remove_file')
|
||||
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -728,8 +736,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete')
|
||||
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||
$genallowed=$usercanread;
|
||||
$delallowed=$usercancreate;
|
||||
|
||||
$var=true;
|
||||
$modulepart = 'stock';
|
||||
|
||||
print $formfile->showdocuments($modulepart,$object->ref,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang, '', $object);
|
||||
$somethingshown=$formfile->numoffiles;
|
||||
|
||||
@ -418,8 +418,6 @@ if (empty($action))
|
||||
$genallowed=$usercanread;
|
||||
$delallowed=$usercancreate;
|
||||
|
||||
$var=true;
|
||||
|
||||
print $formfile->showdocuments('product_batch',dol_sanitizeFileName($object->ref),$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang, '', $object);
|
||||
$somethingshown=$formfile->numoffiles;
|
||||
|
||||
|
||||
@ -612,8 +612,6 @@ if ($id > 0 || ! empty($ref))
|
||||
$genallowed=($user->rights->projet->lire);
|
||||
$delallowed=($user->rights->projet->creer);
|
||||
|
||||
$var=true;
|
||||
|
||||
print $formfile->showdocuments('project_task',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
@ -2455,7 +2455,7 @@ else
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
/*
|
||||
* Documents generes
|
||||
*/
|
||||
*/
|
||||
$filename = dol_sanitizeFileName($object->ref);
|
||||
$filedir = $conf->user->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user