From 127534ef55939dc4fa5e2570b5815fcb117f6589 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 23 May 2020 20:09:31 +0200 Subject: [PATCH] Fix common var name seems to be $objref for subdir of doc --- htdocs/comm/propal/card.php | 4 ++-- htdocs/commande/card.php | 8 ++++---- htdocs/fourn/commande/card.php | 10 +++++----- htdocs/website/websiteaccount_card.php | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index bd5430c440a..28fdc7845d2 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2596,13 +2596,13 @@ if ($action == 'create') /* * Documents generes */ - $filename = dol_sanitizeFileName($object->ref); + $objref = dol_sanitizeFileName($object->ref); $filedir = $conf->propal->multidir_output[$object->entity]."/".dol_sanitizeFileName($object->ref); $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; $genallowed = $usercanread; $delallowed = $usercancreate; - print $formfile->showdocuments('propal', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang, '', $object); + print $formfile->showdocuments('propal', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang, '', $object); // Show links to link elements $linktoelem = $form->showLinkToObjectBlock($object, null, array('propal')); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 4764b53a5c9..21f558219eb 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2688,13 +2688,13 @@ if ($action == 'create' && $usercancreate) print '
'; print ''; // ancre // Documents - $comref = dol_sanitizeFileName($object->ref); - $relativepath = $comref.'/'.$comref.'.pdf'; - $filedir = $conf->commande->multidir_output[$object->entity].'/'.$comref; + $objref = dol_sanitizeFileName($object->ref); + $relativepath = $objref.'/'.$objref.'.pdf'; + $filedir = $conf->commande->multidir_output[$object->entity].'/'.$objref; $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; $genallowed = $usercanread; $delallowed = $usercancreate; - print $formfile->showdocuments('commande', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang, '', $object); + print $formfile->showdocuments('commande', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang, '', $object); // Show links to link elements diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 0cd823304ee..71ed66ffc09 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2625,15 +2625,15 @@ elseif (!empty($object->id)) print '
'; // Generated documents - $comfournref = dol_sanitizeFileName($object->ref); - $file = $conf->fournisseur->dir_output.'/commande/'.$comfournref.'/'.$comfournref.'.pdf'; - $relativepath = $comfournref.'/'.$comfournref.'.pdf'; - $filedir = $conf->fournisseur->dir_output.'/commande/'.$comfournref; + $objref = dol_sanitizeFileName($object->ref); + $file = $conf->fournisseur->dir_output.'/commande/'.$objref.'/'.$objref.'.pdf'; + $relativepath = $objref.'/'.$objref.'.pdf'; + $filedir = $conf->fournisseur->dir_output.'/commande/'.$objref; $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; $genallowed = $user->rights->fournisseur->commande->lire; $delallowed = $user->rights->fournisseur->commande->creer; - print $formfile->showdocuments('commande_fournisseur', $comfournref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 0, 0, '', '', '', $object->thirdparty->default_lang); + print $formfile->showdocuments('commande_fournisseur', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 0, 0, '', '', '', $object->thirdparty->default_lang); $somethingshown = $formfile->numoffiles; // Show links to link elements diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index be0c4c3cc41..54accb48fd3 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -349,13 +349,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; // ancre // Documents - /*$comref = dol_sanitizeFileName($object->ref); - $relativepath = $comref . '/' . $comref . '.pdf'; - $filedir = $conf->website->dir_output . '/' . $comref; + /*$objref = dol_sanitizeFileName($object->ref); + $relativepath = $objref . '/' . $objref . '.pdf'; + $filedir = $conf->website->dir_output . '/' . $objref; $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; $genallowed = $user->rights->website->read; // If you can read, you can build the PDF to read content $delallowed = $user->rights->website->create; // If you can create/edit, you can remove a file on card - print $formfile->showdocuments('website', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); + print $formfile->showdocuments('website', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); */ // Show links to link elements