Fix common var name seems to be $objref for subdir of doc

This commit is contained in:
Laurent Destailleur 2020-05-23 20:09:31 +02:00
parent 64f72daa7e
commit 127534ef55
4 changed files with 15 additions and 15 deletions

View File

@ -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'));

View File

@ -2688,13 +2688,13 @@ if ($action == 'create' && $usercancreate)
print '<div class="fichecenter"><div class="fichehalfleft">';
print '<a name="builddoc"></a>'; // 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

View File

@ -2625,15 +2625,15 @@ elseif (!empty($object->id))
print '<div class="fichecenter"><div class="fichehalfleft">';
// 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

View File

@ -349,13 +349,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<a name="builddoc"></a>'; // 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